[EMAIL PROTECTED] [[EMAIL PROTECTED]] wrote:
> What about swapping ' for '' ? Is the insertion of '' safe across the
> board, or is this dbms specific ?

I believe(?) that's dbms specific - better to use dbi "quote"
function, and *best* to use placeholders.  Read about placeholders
by doing

   perldoc DBI

at a command prompt - provided you have DBI installed.

HTH.

-- 
Hardy Merrill
Senior Software Engineer
Red Hat, Inc.

> 
> I ask because having come from programming in other environments, I am
> already used to placing my sql commands through a formating function that
> swaps a single ' for two '', and just stuck with this method for perl.
> 
> -Josh
> 
> Original Message:
> -----------------
> From: Kipp, James [EMAIL PROTECTED]
> Date: Tue, 15 Oct 2002 15:07:13 -0400
> To: [EMAIL PROTECTED]
> Subject: RE: :: delimiting apostrophes to insert data w/o errors ::
> 
> 
> you can try the qw(...) function or use the DBI 'quote' method.
> 
> > -----Original Message-----
> > From: Hastie, Christa [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 15, 2002 2:45 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: :: delimiting apostrophes to insert data w/o errors ::
> > 
> > 
> > Hello!
> > I bet there is some really simple DBI function/reg ex that 
> > delimits the
> > apostrophes like such (\') so data can be inserted into the db without
> > errors.
> >  
> > i.e. this string:
> > INSERT INTO db (SomeColumn) VALUES ('John's car is cool!')
> >  
> > becomes:
> > INSERT INTO db (SomeColumn) VALUES ('John\'s car is cool!')
> >  
> > Anybody know the function/reg ex for this?
> > Thanks for any help in advance!
> > Appreciate it!
> >  
> > - christa :)
> >  
> > - - - - - - - - - - - - - - - - - - - - - - - - -
> > christa hastie

Reply via email to