DBD::ODBC tries to bind nonexisting placeholders
DBD::ODBC tries to bind nonexisting placeholders
am 04.05.2007 10:33:55 von atschauschev
--0-2133194001-1178267635=:76620
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hello everybody,
I'm using DBI v1.51 and DBD::ODBC v1.13. I'm connecting to MSSQL2000/MSSQL2005. Statements are executed in prepare-execute-fetch order.
Everything works fine, since I found something suspicious: if a string ":00" occurs in a comment, then DBD::ODBC tries to bind this "placeholder" and break with error "Can't rebind placeholder 00 at ..." (line 1971 in dbdimp.c). The Microsoft ODBC driver produces error "[Microsoft][ODBC Driver Manager] Invalid parameter number" (described as error number S1093 on http://www.microsoft.com/technet/prodtechnol/sql/70/proddocs /diag/part3/75528c16.mspx?mfr=true)
Example 1:
-- :00
SELECT 'FOO'
Example 1 produces the error above.
Example 2:
-- :01
SELECT 'FOO'
Example 2 works fine...
Can anybody else reproduce this error? Is this a bug?
Thanks!
Andon
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
--0-2133194001-1178267635=:76620--
Re: DBD::ODBC tries to bind nonexisting placeholders
am 04.05.2007 13:00:37 von Martin.Evans
Andon Tschauschev wrote:
> Hello everybody,
>
> I'm using DBI v1.51 and DBD::ODBC v1.13. I'm connecting to MSSQL2000/MSSQL2005. Statements are executed in prepare-execute-fetch order.
>
> Everything works fine, since I found something suspicious: if a string ":00" occurs in a comment, then DBD::ODBC tries to bind this "placeholder" and break with error "Can't rebind placeholder 00 at ..." (line 1971 in dbdimp.c). The Microsoft ODBC driver produces error "[Microsoft][ODBC Driver Manager] Invalid parameter number" (described as error number S1093 on http://www.microsoft.com/technet/prodtechnol/sql/70/proddocs /diag/part3/75528c16.mspx?mfr=true)
>
> Example 1:
>
> -- :00
> SELECT 'FOO'
>
> Example 1 produces the error above.
>
> Example 2:
>
> -- :01
> SELECT 'FOO'
>
> Example 2 works fine...
>
> Can anybody else reproduce this error? Is this a bug?
>
> Thanks!
>
> Andon
>
I think you need to look up odbc_ignore_named_placeholders in the
DBD::ODBC documentation.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
RE: :ODBC tries to bind nonexisting placeholders
am 04.05.2007 16:01:16 von campbelb
Yes, I was able to reproduce your result with this configuration:
Perl 5.8.7, DBI v1.53 and DBD::ODBC v1.13, connectiong to MSSQL2000.
Seems that any number of zeros (:0, :00, :000) will cause the "problem",
as long as it is NOT followed by any other numeric digits.
-----Original Message-----
From: Andon Tschauschev [mailto:atschauschev@yahoo.com]=20
Sent: Friday, May 04, 2007 1:34 AM
To: dbi-users@perl.org
Cc: jan.selzer@s4m.de; lutz.kraeft@s4m.de; roland.voss@s4m.de
Subject: DBD::ODBC tries to bind nonexisting placeholders
Hello everybody,
I'm using DBI v1.51 and DBD::ODBC v1.13. I'm connecting to
MSSQL2000/MSSQL2005. Statements are executed in prepare-execute-fetch
order.
Everything works fine, since I found something suspicious: if a string
":00" occurs in a comment, then DBD::ODBC tries to bind this
"placeholder" and break with error "Can't rebind placeholder 00 at ..."
(line 1971 in dbdimp.c). The Microsoft ODBC driver produces error
"[Microsoft][ODBC Driver Manager] Invalid parameter number" (described
as error number S1093 on
http://www.microsoft.com/technet/prodtechnol/sql/70/proddocs /diag/part3/
75528c16.mspx?mfr=3Dtrue)
Example 1:
-- :00
SELECT 'FOO'
Example 1 produces the error above.
Example 2:
-- :01
SELECT 'FOO'
Example 2 works fine...
Can anybody else reproduce this error? Is this a bug?
Thanks!
Andon
=20
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
RE: :ODBC tries to bind nonexisting placeholders
am 04.05.2007 19:05:14 von atschauschev
--0-1051998421-1178298314=:18667
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Yes, this is very strange...
Martin Evans offered to try a work-around with
odbc_ignore_named_placeholders, I didn't tried it yet, but since these "placeholders" are in the comment part, they must be simply ignored and not parsed?
Regards
Andon
"CAMPBELL, BRIAN D (BRIAN)" wrote: Yes, I was able to reproduce your result with this configuration:
Perl 5.8.7, DBI v1.53 and DBD::ODBC v1.13, connectiong to MSSQL2000.
Seems that any number of zeros (:0, :00, :000) will cause the "problem",
as long as it is NOT followed by any other numeric digits.
-----Original Message-----
From: Andon Tschauschev [mailto:atschauschev@yahoo.com]
Sent: Friday, May 04, 2007 1:34 AM
To: dbi-users@perl.org
Cc: jan.selzer@s4m.de; lutz.kraeft@s4m.de; roland.voss@s4m.de
Subject: DBD::ODBC tries to bind nonexisting placeholders
Hello everybody,
I'm using DBI v1.51 and DBD::ODBC v1.13. I'm connecting to
MSSQL2000/MSSQL2005. Statements are executed in prepare-execute-fetch
order.
Everything works fine, since I found something suspicious: if a string
":00" occurs in a comment, then DBD::ODBC tries to bind this
"placeholder" and break with error "Can't rebind placeholder 00 at ..."
(line 1971 in dbdimp.c). The Microsoft ODBC driver produces error
"[Microsoft][ODBC Driver Manager] Invalid parameter number" (described
as error number S1093 on
http://www.microsoft.com/technet/prodtechnol/sql/70/proddocs /diag/part3/
75528c16.mspx?mfr=true)
Example 1:
-- :00
SELECT 'FOO'
Example 1 produces the error above.
Example 2:
-- :01
SELECT 'FOO'
Example 2 works fine...
Can anybody else reproduce this error? Is this a bug?
Thanks!
Andon
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
--0-1051998421-1178298314=:18667--