The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
insert a header in a huge data file without using an intermediate file deepaktanna Shell Programming and Scripting 10 02-23-2009 03:38 PM
How can I add a header to a csv file Pablo_beezo Shell Programming and Scripting 6 10-20-2008 11:14 AM
Reading the header of a tar file(posix header) Tanvirk Linux 2 01-31-2008 08:50 AM
insert header row into .xls Tish UNIX for Dummies Questions & Answers 11 12-07-2007 03:53 PM
help with header of sql forevercalz Shell Programming and Scripting 4 12-02-2005 03:19 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-11-2009
s1a2m3 s1a2m3 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 11
Insert Header Name in CSV

Can anyone help.
I have sql to CSV showing header with ALIAS names but I want to generate CSV file with user friendly name i.e from AIAN8 to Adress Book Number etc.
SELECT AIAN8 || , || F0101.ABALPH || , || AICO ||

showing following below in CSV output intead of above

Address NumberCustomer Name Company

thanks
Akbar

Last edited by s1a2m3; 06-11-2009 at 05:19 PM..
  #2 (permalink)  
Old 06-11-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,418
change the alias names of the column to whatever name you want and run the query
  #3 (permalink)  
Old 06-11-2009
kripssmart kripssmart is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 43
I also would like to go with Vidyadhar85 if I understand your question properly…

Thanks - Kripa.
  #4 (permalink)  
Old 06-11-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,418
Quote:
Originally Posted by s1a2m3 View Post
Can anyone help.
I have sql to CSV showing header with ALIAS names but I want to generate CSV file with user friendly name i.e from AIAN8 to Adress Book Number etc.
SELECT AIAN8 || , || F0101.ABALPH || , || AICO ||

showing following below in CSV output intead of above

Address NumberCustomer Name Company

thanks
Akbar
post your full query that might help
  #5 (permalink)  
Old 06-12-2009
s1a2m3 s1a2m3 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 11
full sql statement

@@\.login_JDEDB.sql
set echo off
set verify off
set feed off term off
prompt ********************************************************
prompt Todays Date
prompt ********************************************************
prompt This SQL runs every Monday prompt ********************************************************
set feedback on
set echo off head off feed off veri off trimspool on
spool /home/oracle/log/Weekly_BlueGrassCrdHld.csv
set heading on;
set linesize 200;
SELECT AIAN8 || ',' || F0101.ABALPH || ',' || AICO || ',' || AIHOLD || ',' || AIARC || ',' || AIACL || ',' || AITRAR || ',' || F0014.PNPTD || ',' || AIBADT || ',' || F0101.ABAN81
FROM PRODDTA.F0014, PRODDTA.F0101, PRODDTA.F03012
WHERE F0101.ABAN8 = AIAN8 AND F0014.PNPTC = AITRAR AND ((AICO='00271') AND (AIHOLD>'1'));
spool off
exit

What I am getting with above sql is CSV file with Header as shown within pipes || ||. I need to chage those to user friendly names like Adress Book etc.

Thanks for you help.

Akbar
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:54 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0