Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/Sql code for a text file

Status
Not open for further replies.
Apr 20, 2000
41
US
I'm looking for some example code in Oracle Pl/sql language using oracle 7.34 that manipulates a text file to;

- create an empty text file and name it with todays date (20020102.dat)
- code to open it and append data as records
- code to close the text file

I'm new to PL/Sql programming....
thanks !
 

You can can check out the UTL_FILE built-in package for this. Robbie

"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
 
Sounds like a lot of work when you can just do the following:

SPOOL 20020102.dat

SELECT *
FROM MyTable
WHERE CheckDate = '02-JAN-02';

SPOOL OFF

If you are wanting to automate this, you may need to use the UTL_FILE package, but I would think you could build a variable (&) and then use that variable for the filename and in the WHERE clause (&&).

Hope that helps... "Alcohol is our friend, and it's about time we had more friends over."

Terry M. Hoey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top