On Tue, 18 Jan 2005 16:10:52 -0500, Moosmann, James
<[EMAIL PROTECTED]> wrote:
> 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
> From: "Moosmann, James" <[EMAIL PROTECTED]>
> Date: 2005/01/19 Wed AM 08:24:12 CST
> Does anyone know how to check/set this attribute using DBI so I don't have
> to instruct a user on changing his DSN? ( I don't see this option mentioned
> in DBD::ODBC )
Might I suggest using DSN-less connecti
>
> Thank you everyone who responded and to Tim and Jeff:
>
> The reason the server generates an error is because there are
> 2 flags which can be set when you create the DSN:
>
> Use ANSI quoted identifiers
> Use ANSI null, padding and warning
>
> And they were both selected.
>
> De-select
Thank you everyone who responded and to Tim and Jeff:
The reason the server generates an error is because there are 2 flags which
can be set when you create the DSN:
Use ANSI quoted identifiers
Use ANSI null, padding and warning
And they were both selected.
De-selecting "Use ANSI null, paddin
ost.Net [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 18, 2005 6:49 PM
> To: dbi-users@perl.org
> Subject: Re: Double quotes in select statement throw an error
>
>
>
>
> Moosmann, James wrote:
> > Nope, same results, Here is a simple example:
> >
On Tue, Jan 18, 2005 at 11:22:58PM -0500, Moosmann, James wrote:
> Perl DBI thinks any double quoted string must be a column
> or table name ( [ and ] are preferred, but double quotes are still
> acceptable).
Not true. Neither the DBI nor the driver (generally) parse the SQL.
The DBI gives it to t
Moosmann, James wrote:
Lee,
Hello,
The select statement is very valid and so is:
SELECT 'Hello World!' as 'My first SQL Statement'
-or-
SELECT answer = 2+3
Really, try it.
ok, but if you $dbh->quote() it, it becomes something like:
'SELECT \'Hello World!\' as \'My first SQL Statement\''
literal
MAIL PROTECTED]
Sent: Tuesday, January 18, 2005 6:49 PM
To: dbi-users@perl.org
Subject: Re: Double quotes in select statement throw an error
Moosmann, James wrote:
> Nope, same results, Here is a simple example:
>
> Is the syntax invalid?
>
> use DBI;
> my $dbh = DBI->connect(&
Moosmann, James wrote:
Nope, same results, Here is a simple example:
Is the syntax invalid?
use DBI;
my $dbh = DBI->connect('dbi:ODBC:somedb','','');
my $qs = $dbh->quote( "SELECT \"Rows returned: \" ");
Why are you quoting the entire query as a string?
$dbh->do($qs);
Use a valid query:
$dbh->do
dman'
Cc: dbi-users@perl.org
Subject: RE: Double quotes in select statement throw an error
Nope, same results, Here is a simple example:
Is the syntax invalid?
use DBI;
my $dbh = DBI->connect('dbi:ODBC:somedb','','');
my $qs = $dbh->quote( "SELECT
David Goodman [mailto:[EMAIL PROTECTED] wrote:
>
> Use DBI's quote:
>
> my $statement = dbh->quote("SELECT \"Rows inserted\" +
> @rows");
This is not at all how quote() is meant to be used. quote() is for quoting
a single value for interpolation, not an entire SQL statement.
For example:
m
D::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid column name 'Rows returned: '. (SQL-42S22)
-Original Message-
From: David Goodman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 18, 2005 6:03 PM
To: dbi-users@perl.org
Subject: Re: Double quo
Use DBI's quote:
my $statement = dbh->quote("SELECT \"Rows inserted\" +
@rows");
regards,
David
--- "Moosmann, James"
<[EMAIL PROTECTED]> wrote:
> The following line produces and error in DBI
> excuting with either a do or a
> prepare, execute
>
> my $statement = "SELECT \"Rows inserted\" + @
13 matches
Mail list logo