Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: untainting or encoding for shelled sqlplus update

by goibhniu (Hermit)
on May 19, 2008 at 19:21 UTC ( #687448=note: print w/replies, xml ) Need Help??

in reply to untainting or encoding for shelled sqlplus update

I have a solution. For those interested, all my attempts to escape special characters were slightly off target. If I ran the script in a DB IDE like SQL Navigator, it worked fine. The only time it failed was in sqlplus. It turns out that when sqlplus is processing multiline info, it treats an empty line sorta like the end of a <<HERE doc.

I've left in all the special character encoding (for sql insertion reasons), but the thing that really fixed my script was:

$string =~ s/\n\n/\n'||CHR(10)||'/g;

and thanks to the guys in the Chatterbox (Intrepid, jdporter, mwah, bart, ambrus) for helping me write the regexp and consider corner cases on this.

#my sig used to say 'I humbly seek wisdom. '. Now it says:
use strict;
use warnings;
I humbly seek wisdom.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://687448]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2018-05-26 02:13 GMT
Find Nodes?
    Voting Booth?