Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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.


Comment on Re: untainting or encoding for shelled sqlplus update
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://687448]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2014-10-23 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (128 votes), past polls