![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading the header of a tar file(posix header) | Tanvirk | Linux | 2 | 01-31-2008 05:50 AM |
| insert header row into .xls | Tish | UNIX for Dummies Questions & Answers | 11 | 12-07-2007 12:53 PM |
| How to Parse TCP header | cool_vip | High Level Programming | 2 | 08-23-2005 05:27 AM |
| Creating a header. | rooh | UNIX for Dummies Questions & Answers | 2 | 04-06-2002 02:41 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help with header of sql
i have this script here..
text=/d:/...../1.txt ORACLE_HOME/bin/sqlplus -S............ ................................................... spool $text; select item || '|' || ord_no || '|' || price || '|' || from order_table The output header of this spooled data will be item||'|'||ord_no||'|'||price||'|'| -------------------------------- F42777|073059|100| However now i want the header to be like this and the output remains the same....is there a way to do it? item|ord_no|price| -------------------------------- F42777|073059|100| thanks for great help! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You have to explicitly spool the contents of the header also like this.
Code:
spool $text; select 'item|ord_no|price|' from dual; select item || '|' || ord_no || '|' || price || '|' || from order_table; spool off |
|
#3
|
|||
|
|||
|
Quote:
'item|ord_no|price| ------------------- item|ord_no|price| item || '|' ||ord_no || '|' ||price || '|' || --------------------------------------- F42777|073059|100| now i have 3 header...... |
|
#4
|
|||
|
|||
|
No '|' in alias
The '|' is the concatenation character in SQL. Hence it cannot be used in an alias name. Otherwise you could have given your column name an alias. Try reteivbg the column names in your script through another query and then merge the header and the data.
Regards, Rahul. |
|
#5
|
|||
|
|||
|
ok thanks! i got it..
Last edited by forevercalz; 12-02-2005 at 12:27 AM. |
|||
| Google The UNIX and Linux Forums |