Newby to Oracle (and SQL) so please excuse simple question.
We have a sql script that exports data from joined tables to a CSV file, no problem
basically
SPOOL exportfile.csv
select ca.column1||','||ca.column2||','|| va column1
from table1 ca, table2 va
where ca.opid = va.opid
SPOOL off
what we want to do is add column names at the beginning:
colname1,colname2,colname3
I have tried adding a select 'colname1,colname2,colname3' from dual statement before the actual select, but all that appears is the colname text, not the data.
Can anyone tell me what I am doing wrong?
Thanks folks
Rog
We have a sql script that exports data from joined tables to a CSV file, no problem
basically
SPOOL exportfile.csv
select ca.column1||','||ca.column2||','|| va column1
from table1 ca, table2 va
where ca.opid = va.opid
SPOOL off
what we want to do is add column names at the beginning:
colname1,colname2,colname3
I have tried adding a select 'colname1,colname2,colname3' from dual statement before the actual select, but all that appears is the colname text, not the data.
Can anyone tell me what I am doing wrong?
Thanks folks
Rog