PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Gisle Aas <aas at bergen dot sn dot no>
Subject: Re: char or varchar
Date: Feb 27 1996 8:37AM

In message <9602270823.AA15805@itf.ch>, Michael Peppler writes:
> An alternate solution:
> 
> Make sure all double quotes are converted to single quotes in your $tmp
> variable, and then use double quotes in the SQL insert statement:
> 
> $tmp =~ s/"/'/g;
> $db->dbcmd("insert foo(column1) values(\"$tmp\")");
>                                        ^^^^^^^^^
>                                        Need to escape the double quotes here

I would write:

 $tmp =~ s/"/""/g;
 $db->dbcmd(qq(insert foo(column1) values("$tmp")));

--Gisle