Home » Other » Client Tools » SQL*Plus Script Dropping Column Headings
SQL*Plus Script Dropping Column Headings [message #269123] Thu, 20 September 2007 14:57 Go to next message
tmajor
Messages: 6
Registered: September 2007
Junior Member
I have a sql*plus script that I am trying to execute from a concurrent program.

When I run the script in sql*plus, it executes fine and output contains the column headings.

However when I run it in concurrent program and view the output the column headings are not there.

Any ideas?
Re: SQL*Plus Script Dropping Column Headings [message #269124 is a reply to message #269123] Thu, 20 September 2007 15:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is SQL*Plus that adds the column headers.
Your program has to do the same thing.

Regards
Michel
Re: SQL*Plus Script Dropping Column Headings [message #269128 is a reply to message #269124] Thu, 20 September 2007 15:11 Go to previous messageGo to next message
tmajor
Messages: 6
Registered: September 2007
Junior Member
When you say my program has to do the same thing - do you mean the concurrent program?

If so, how is that accomplished?

The sql script select statment is VERY simple:
select customer from all_customers;
Re: SQL*Plus Script Dropping Column Headings [message #269130 is a reply to message #269128] Thu, 20 September 2007 15:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
do you mean the concurrent program?

Yes your concurrent program.

Quote:
If so, how is that accomplished?

I don't know what is your concurrent program.

Regards
Michel
Re: SQL*Plus Script Dropping Column Headings [message #269131 is a reply to message #269130] Thu, 20 September 2007 15:22 Go to previous messageGo to next message
tmajor
Messages: 6
Registered: September 2007
Junior Member
I'm not clear on what you mean by "what is my concurrent program", so I'll try to explain.

I have a very simple sql script to select a few columns from a table. The output is a report I'm developing for a user.

Rather than have the users run it from SQL*Plus, I want them to run it as a concurrent program.

I created the executable of type SQL*Plus, then created a concurrent program using that executable.

Does that answer your question?
Re: SQL*Plus Script Dropping Column Headings [message #269140 is a reply to message #269131] Thu, 20 September 2007 16:25 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A concurrent program, as I've understood it, could be a DOS batch file. Let's see an example: batch file which first executes a SQL script and shows spooled result on the screen:
REM MAJOR.BAT

sqlplus -s scott/tiger@ora10lp @major.sql

type major.txt
It will call a simple SQL script which creates a TXT file:
REM MAJOR.SQL

set termout off

spool major.txt

select ename, job, sal
from emp
where deptno = 10;

spool off;

exit;
OK, let's execute it!
C:\TEMP>major

C:\TEMP>sqlplus -s scott/tiger@ora10lp @major.sql

C:\TEMP>type major.txt

ENAME      JOB              SAL

---------- --------- ----------

CLARK                      2450

KING                       5000

MILLER                     1300



C:\TEMP>
Column headings are here.

Now, could you reproduce such an example or, even better, show us what you did (copy-paste if possible), not tell us a story?
Re: SQL*Plus Script Dropping Column Headings [message #269142 is a reply to message #269123] Thu, 20 September 2007 16:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Does that answer your question?
Not for me.
Rather than trying to "paint a picture" by explaining or describing what you think you are doing, it might help if you actually took a picture by using CUT & PASTE & showed us exactly
what you have, what you are doing, & the responses you are seeing.

Please read & following the posting guidelines as stated in the #1 STICKY post at the top of this forum; including the use of <code tags>.

Re: SQL*Plus Script Dropping Column Headings [message #269150 is a reply to message #269142] Thu, 20 September 2007 19:59 Go to previous messageGo to next message
tmajor
Messages: 6
Registered: September 2007
Junior Member
Unfortunately, no that doesn't answer the question of how to get the column headings to print in the output from the concurrent program.

Anyone else - or maybe further clarification?
Re: SQL*Plus Script Dropping Column Headings [message #269151 is a reply to message #269150] Thu, 20 September 2007 20:01 Go to previous messageGo to next message
tmajor
Messages: 6
Registered: September 2007
Junior Member
I am talking about a concurrent program in Oracle applications if that helps explain more what I'm doing.

The user would log onto a certain responsibility and then select reports -> run and choose this report.

Sorry if I wasn't clear on that.
Re: SQL*Plus Script Dropping Column Headings [message #269329 is a reply to message #269151] Fri, 21 September 2007 13:06 Go to previous messageGo to next message
Soumen Kamilya
Messages: 128
Registered: August 2007
Location: Kolkata
Senior Member

If you are not getting the column heading in your report then run a qery to get the column names before running your original report, it will solve your problem.

Cheers
Soumen
Re: SQL*Plus Script Dropping Column Headings [message #269546 is a reply to message #269123] Sun, 23 September 2007 04:14 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Check out the heading settings within script as well as in SQL*PLUS.Simply in SQL*PLUS check,

Show heading

If you are inside a .txt file search .
Re: SQL*Plus Script Dropping Column Headings [message #269567 is a reply to message #269546] Sun, 23 September 2007 09:45 Go to previous message
tmajor
Messages: 6
Registered: September 2007
Junior Member
This problem was solved by adding a select column names from dual with a union to my original select.

Previous Topic: passing one parameter from Shell-script to Sql-script
Next Topic: How to refresh variable in loop
Goto Forum:
  


Current Time: Thu Mar 28 18:53:49 CDT 2024