DBD::Sybase prepare() with placeholders fails with ASE 11.0.x

From: Michael Peppler (mpeppler_at_peppler.org)
Date: 12/19/03


To: Sybperl-L Mailing List <sybperl-l@peppler.org>, dbi-users@perl.org
Date: Fri, 19 Dec 2003 08:35:10 -0800

I've just discovered that DBD::Sybase 1.01 prepare() call with
placeholders will fail with

ct_result(ct_dynamic(CS_PREPARE)) returned -205 at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/Sybase.pm
line 124.
DBD::Sybase::db prepare failed: Server message number=193 severity=15
state=4 line=1 text=The object or column name starting with '' is too
long. The maximum length is 10 characters.

when connected to an 11.0.3.3 server (in my case the free 11.0.3.3
release for linux).

The reason is that in 1.01 I increased the length of the identifier used
when creating the temporary stored proc/dynamic statement, and that
identifier now exceeds the max limit of 10 characters that 11.0.3.3 has.

A fix will be in 1.02, but in the meantime you can fix it by changing:

            sprintf(imp_sth->dyn_id, "DBD%d_%x", getpid(), (int)tt++);
to
            sprintf(imp_sth->dyn_id, "DBD_%x", (int)tt++);

around line 1990 of dbdimp.c and rebuilding.

Michael

-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                 http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.mbay.net/~mpeppler/resume.html


Relevant Pages

  • Re: [OT] I love that writing style. (Was: Re: Is this Regular Expression for UTF-8 Correct??)
    ... consider if the following were a specifcation for a C identifier: ... characters from being used for Identifiers. ... sense from the perspective of natural language. ... to use accented characters is a similar burden. ...
    (microsoft.public.vc.mfc)
  • Re: Ho do I control the length of a mergefield
    ... The problem is that if none of the first 8 cells in the "problem column" contain a "long" text (i.e. a wso-called "memo" text, which in the case of Excel means a text over 255 characters long), all the texts in that column will be truncated to 255 characters, or worse. ... The trouble is that there is no simple fix that is likely to suit everyone. ... I would have referred to the FAQ rather than constructing a problem ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Stored proc with version number ?
    ... in addition to letter characters from other languages. ... > Certain symbols at the beginning of an identifier have special meaning ... > Need SQL Server Examples check out my website ... >> the existing stored proc uspTableSave and right click Properties. ...
    (microsoft.public.sqlserver.programming)
  • Re: Stored proc with version number ?
    ... in addition to letter characters from other languages. ... Certain symbols at the beginning of an identifier have special meaning ... in SQL Server. ... I choose> the existing stored proc uspTableSave and right click Properties. ...
    (microsoft.public.sqlserver.programming)
  • Re: [OT] I love that writing style. (Was: Re: Is this Regular Expression for UTF-8 Correct??)
    ... consider if the following were a specifcation for a C identifier: ... It is not whether or not that it makes sense within the context of natural human language that restricts the use of these punctuation characters from being used for Identifiers. ... to use accented characters is a similar burden. ...
    (microsoft.public.vc.mfc)