I.T. Discussion Community!
-Collapse +Expand
DBA
Search DBA Group:

Advanced
-Collapse +Expand DBA Store
PRESTWOODSTORE

Prestwood eMagazine

February Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyDBA, Databases, & Data BoardOracle Topic   Print This     

Export a Fixed Length AScii file from Oracle

Export a Fixed Length AScii file from Oracle in Oracle topic (part of our DBA, Databases, & Data group).

Quick Search: Export Fixed   Export Fixed Length   AScii file  
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)
Comment Quote
About andreK -Collapse +Expand
Visit Profile
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 
Joined=15 years ago   MB Posts=15  
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
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
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 
Joined=19 years ago   MB Posts=442   KB Posts=19  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1266A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #939 Counter
3582
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech