Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: export Data as Text ?
Never heard of one, but if you're not looking to export the object definitions/grants etc, why not write a pl/sql script which will write a sql script to select all rows from all tables in csv format?
Logic would be something like:
spool selectfile.sql
cursor 1: select owner,table_name from dba_tables; cursor 2: select column_name from dba_tab_columns where table_name=cursor1.table_name and owner=cursor1.owner;
loop through cursor 1
write 'select'
loop through cursor 2
write cursor2.column_name||'||'',''||'||chr(10)
end loop 2
write 'NULL'
write 'from '||cursor1.owner||'.'||cursor1.table_name||';'
end loop 1
spool off
This should then give you a sqlplus script which reads like :
select
dummy||','||,
NULL
from sys.dual;
for all tables and owners. Obviously you can change the SQL to generate sets
of tables/specific owners.
Then run the resulting script as SYSTEM and spool the output to a csv file
of choice. You could also do a trap to determine the last column name
retrieved - so don't write a comma.
It's simple but effective and I've used it myself in the past (if I had the
code with me I'd give it to you!)
You may have already tried this, I dunno. Maybe it doesn't meet your
requirements.
Hope it's been of some use otherwise!
Regards,
Paul Bowskill
Firman-Jack (Cedargroup) DBA
"Frank Langelage" <langel_at_st-oneline.de> wrote in message
news:399069D4.B2BBB850_at_st-oneline.de...
> Which tools are free available to export Tabledata (Server 7.3.4) as an
> csv-File (ascii-text, field values of variable length separated by an
> delimiter) ?
>
>
Received on Wed Aug 16 2000 - 15:14:31 CDT