Export a Fixed Length AScii file from Oracle

|
andreK
(Inactive)
Balikpapan, AK ID
|
Apart from using an export utility, is there a way to export a file to ascii format, fixed length using sql. I would like to wrap this in a stored procedure.
Thanks
Lans
|
Posted 20 years ago (Thread Starter)
|
|
About andreK |
|
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #939, 1 replies
Thread Started 2/8/2001 1:30:00 PM
View Counter=3582
Last Reply Posted 2/13/2001 12:18:00 PM)
|
|
|
Location=Balikpapan, AK ID
|
|
 |
Most Recent Post
|
Scott Wehrly
Prestwood IT
(Inactive)
Las Vegas, NV USA
|
Let's assume that you are talking about exporting the data from the execution of a SQL script, using Oracle's SQL*Plus utility.
Whenever you execute a SQL query in Oracle SQL*Plus, the output is already formatted in fixed length ASCII. If you save your results to a file, you will see that there are fixed-length column boundaries in the output.
The Oracle SQL*Plus Reference has an entire section on custom-formatting the output of a query, using COLUMN commands. However, these are commands to the SQL session only. The width, precision, and/or format of a data field reverts back to the default (defined in the database's data dictionary) in each session.
Because they are session commands, not query commands, they would not be recognized in a stored procedure. You could use a stored procedure to generate the output columns of the export, and create a script file with COLUMN commands for those output columns, and call the stored procedure in the script. The same thing could be achieved with selections against a view in a script.
There are some good examples of formatted query output scripts in the Oracle SQL*Plus Reference, and even more in the book "Oracle: A Complete Reference".
------------------ Scott Wehrly Software Engineer swehrly@schoolhousesoftware.com
|
Posted 20 years ago
|
|
About Scott Wehrly |
|
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #992 (Level 1.1)
Reply to 939
Thread Started 2/13/2001 12:18:00 PM
View Counter=2
|
|
|
Location=Las Vegas, NV USA
|
|
Revive Thread!
Add a comment to revive this old thread and make this archived thread more useful.
Thread #939 Counter |
3582 |
Since 4/2/2008
|
|
|
|