Double quotes in select statement throw an error
From: James Moosmann (james.moosmann_at_bankofamerica.com)
Date: 01/18/05
- Next message: David Goodman: "Re: Double quotes in select statement throw an error"
- Previous message: charles_at_swifttel.net: "Problem with connecting to an Oracle database using Perl"
- Next in thread: David Goodman: "Re: Double quotes in select statement throw an error"
- Reply: David Goodman: "Re: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: Will Rutherdale: "RE: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: Amonotod: "RE: Double quotes in select statement throw an error"
- Reply: Jonathan Leffler: "Re: Double quotes in select statement throw an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 18 Jan 2005 16:10:52 -0500 To: dbi-users@perl.org
The following line produces and error in DBI excuting with either a do or a
prepare, execute
my $statement = "SELECT \"Rows inserted\" + @rows "); # ODBC error
my $statement2 = "SELECT 'Rows inserted' + @rows "); # works
$dbh->do( $statement );
or
$sth->prepare( $statement );
$sth->execute();
DBI: 1.46
DBD-ODBC: 1.11
Active State Perl 5.8.3 multi-thread
Win2K
The error:
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid column name 'Rows inserted: '. (SQL-42S22)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Rows
inserted: '. (SQL-42S22)(DBD: Execute immediate failed err=-1) at
c:/Cw/Dev/Library/Executables/sptool line 215, <$fileHandle> line 211.:
MSSQL isql and Embarqadero do not complain about the double quotes.
This is in a stored procedure, the text of which we are trying to run.
Other tools do not complain about the double quotes, only DBI.
Any ideas? Is this a bug? Or, is it simply incorrect for the user to be
using double quotes (ie, not ANSI ? )
Thanks,
James
- Next message: David Goodman: "Re: Double quotes in select statement throw an error"
- Previous message: charles_at_swifttel.net: "Problem with connecting to an Oracle database using Perl"
- Next in thread: David Goodman: "Re: Double quotes in select statement throw an error"
- Reply: David Goodman: "Re: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: Will Rutherdale: "RE: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: James Moosmann: "RE: Double quotes in select statement throw an error"
- Maybe reply: Amonotod: "RE: Double quotes in select statement throw an error"
- Reply: Jonathan Leffler: "Re: Double quotes in select statement throw an error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|