Home » SQL & PL/SQL » SQL & PL/SQL » utl_file
utl_file [message #197430] Wed, 11 October 2006 04:37 Go to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Hya Guys

Does anyone know if it's possible in an PL/SQL procedure
to open a file with utl_file package and then append a new
line as the first line in the file(default is last)


Would have been nice to use fseek to a certain postion and append the line..

Im only intrested in a solution from the PL/SQL perspective.

Cheers&Thnx for any advice on this
Re: utl_file [message #197463 is a reply to message #197430] Wed, 11 October 2006 05:58 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Does this still stand ?

If you want to insert a line of text between the 1,267th and 1,268th lines, you will have to (a) read those 1,267 lines, (b) write them to a new file, (c) write the inserted line of text, and (d) read/write the remainder of the file. Ugh.

Nightmare...
Re: utl_file [message #197472 is a reply to message #197430] Wed, 11 October 2006 06:26 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Just to update my own query , asked Oracle and...

ANSWER
=======
No, it is not possible.








Mad

Re: utl_file [message #197606 is a reply to message #197472] Thu, 12 October 2006 00:43 Go to previous messageGo to next message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!
if it's really not possible in plsql then add some java c",)
Re: utl_file [message #197631 is a reply to message #197606] Thu, 12 October 2006 02:03 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Well as I said, it's no problem doing this with java , unix script or whatever. I was just curious if it was possible with PL/SQL

But thnx for the reply Smile
Re: utl_file [message #197859 is a reply to message #197631] Thu, 12 October 2006 23:41 Go to previous messageGo to next message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
hi!
dont know why they didnt put that funcionality in pl/sql, maybe it wasnt design for that task, but luckily other languages are there to help =)
Re: utl_file [message #197901 is a reply to message #197859] Fri, 13 October 2006 03:22 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

So true So true Laughing

Have great weekend Smile
Previous Topic: Calculating running percentage discount
Next Topic: how to findout diffrence between creation date and sysdate
Goto Forum:
  


Current Time: Fri Dec 09 19:39:14 CST 2016

Total time taken to generate the page: 0.22824 seconds