webengr has asked for the wisdom of the Perl Monks concerning the following question:
<code style="font-size:100%"> $SQLstring = qq{ select rtrim('$lastname',' ')LAST from SYS.DUAL }; </code>
which works okay unless the last name is something like O'Reilly. I believe that the SQL statement is okay if the lone apostrophe is doubled (but not a double quote). My solution then is this,<code style="font-size:100%">
($tmp = $lastname) =~ s/'/''/;
$SQLstring = qq{ select rtrim('$tmp',' ')LAST from SYS.DUAL };
</code>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(crazyinsomniac) Re: Temporary string substitution
by crazyinsomniac (Prior) on Nov 10, 2001 at 10:52 UTC | |
|
Re: Temporary string substitution
by blakem (Monsignor) on Nov 10, 2001 at 10:57 UTC | |
|
Re: Temporary string substitution
by webengr (Pilgrim) on Nov 11, 2001 at 02:27 UTC |