| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: replace text in a file, with PL/SQL
"Epicentre Team B Annecy" <carmanet_at_epicentre.fr> wrote in message news:<af6p5j$7u$1_at_wanadoo.fr>...
> Hello,
>
> I've an opened file in a PL/SQL procedure (with UTL_FILE), and I would like
> to know if it's possible
> to replace a string in this file by another string, in my procedure?
>
> Thanks!
>
> Céline.
UTL_FILE package, while easy to use does not come with lots of functionality. You can only open a file at one time in either read, write or append mode. One *Untested* way I could think of right away would be to read the entire file into a buffer...as long as it is smaller then maximum buffer size of 32000. Search and replace/modify the string. Close file --> Reopen file in *write* mode and write buffer with modified string. Bit of a work.
On the other hand, for more control, use External procedure call by using CREATE LIBRARY.... or use Java cartridge if you have installed JVM in your database. Received on Mon Jun 24 2002 - 11:03:58 CDT
![]() |
![]() |