quote

quote is used to quote a string that is to be used in an SQL query statement. Some databases have different methods of quoting the data in SQL statements, so to maintain as much compatibility as possible, use the quote function instead of quoting the data manually.

Example:

my $oldstring = "Brent's kids are named: Luc, Rae, and Logan."; my $newstring = $db_handle->quote($oldstring);

The string in $newstring is now ready to be used in an SQL statement and should have no problems with the handling of the apostrophe.



Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net