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: Michael Peppler <mpeppler at MBAY dot NET>
Subject: RE: single quotes in text datatypes
Date: Apr 16 1998 4:50PM

Adam Naylor writes:
 > David,
 > 
 > The secret is to do something like this:
 > 
 > dbproc->dbcmd("The quick brown fox jumps over the lazy dog's tail.");
 > dbproc->dbsqlexec;
 > 
 > This should work without resorting to DBSAFESTR.
 > 
 > Gets interesting if you want both quotes in a string, though!

Use the generic quote operators:

$dbh->dbproc(qq[The quick brown fox jumps over the lazy dog's tail.]);

Michael

 > 
 > Regards,
 > 
 > Adam Naylor
 > 
 > 
 > > ----------
 > > From: 	David Carter
 > > Sent: 	16 April 1998 15:47
 > > To: 	SYBPERL-L@trln.lib.unc.edu
 > > Subject: 	single quotes in text datatypes
 > > 
 > > Hi,
 > > 
 > > Hope this is an easy one for my first posting:
 > > 
 > > How do I insert a TEXT datatype containing a '?
 > > 
 > > Read the FAQ, but didn't find a satisfactory solution (the description for
 > > dbsafestr seems to imply that it will convert ' to "). It's not correct to
 > > say `David"s book`. Besides - it looks wierd. As would `David`s Book`.
 > > 
 > > Perhaps I should invent a code like &^*$-m, which should
 > > never occur in text, to mean ' :-)
 > > 
 > > The Que Sybase book I've got says "TEXT and IMAGE" types are the same, yet
 > > our server cries when I try to feed it 0x..... expecting a TEXT type. It
 > > also cries when I try to feed it 'The quick brown fox jumps over the lazy
 > > dog's tail.'
 > > 
 > > Help!
 > > 
 > > Many TIA,
 > > David.
 > > SOL Bors. 
 > > 
 > > 
 > 
 > 

-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@datamig.com    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com