costas has asked for the wisdom of the Perl Monks concerning the following question:
As you can see the $message contains a "'". I have used the qq() operator but I still get an error unless i remove the single quote from within. The error i get is$message="Couldn't connect: Net::FTP: Timeout "; my $dbh = db_connect(); my $sql = qq{ INSERT INTO tblErrorLog (clientID, streamID, errorDe +tails) VALUES ($clientID, $streamID, '$message')}; #db_execute_query($dbh, $sql); my $sth = $dbh->prepare( $sql ); $sth->execute(); $sth->finish(); db_disconnect($dbh);
Can anyone help?DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]COUNT + field incorrect or syntax error (SQL-07001)(DBD: st_execute/SQLExecu +te err=-1) at wmsdb.pl line 73. INSERT INTO tblErrorLog (clientID, st +reamID, errorDetails) VALUES (1, 8, 'Couldn't connect: Net::FTP: Time +out ')
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: trouble using the qq operator
by derby (Abbot) on Apr 08, 2002 at 12:48 UTC | |
|
Re: trouble using the qq operator
by mattriff (Chaplain) on Apr 08, 2002 at 12:55 UTC | |
|
Re: trouble using the qq operator
by perlplexer (Hermit) on Apr 08, 2002 at 12:56 UTC | |
|
Re: trouble using the qq operator
by Rich36 (Chaplain) on Apr 08, 2002 at 13:25 UTC | |
by kappa (Chaplain) on Apr 08, 2002 at 14:00 UTC | |
by Rich36 (Chaplain) on Apr 08, 2002 at 14:05 UTC |