in reply to Calling SQL with embedded quotes
You use '' to quote the string that you set "cmd" to, so you just need to make sure that any ' quotes inside that string are doubled.$test = q/RunSql "delete sometable where strike like '%[A-Za-z]%'"/; $test =~ s/'/''/g; $sql = "update job set cmd='$test' where jobname='somejob'";
There are other methods as well - placeholders for example when using DBI or Sybase::CTlib as mentioned by others in this thread, but there are drawbacks to those as well - nothing's perfect :-)
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calling SQL with embedded quotes
by budman (Sexton) on May 22, 2002 at 02:26 UTC | |
by budman (Sexton) on May 22, 2002 at 02:35 UTC |