Re: 30-character limit for identifiers with ASE 15.x?

SĂ©bastien SablĂ© <[email protected]> Thu, 27 Aug 2009 18:25:37 +0200
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
Hi Jeffrey,

I think this may be the same problem which was recently reported in =

other emails and which is also reported in this bug tracker:

http://sourceforge.net/tracker/?func=3Ddetail&aid=3D2809032&group_id=3D1840=
50&atid=3D907701


python-sybase is currently specifying at initialization to Sybase that =

it wants sybase 10.0 capabilities.

You need to modify python-sybase in this way if you want to use =

capabilities of Sybase 15 :

Index: ctx.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- ctx.c	(r=E9vision 443)
+++ ctx.c	(copie de travail)
@@ -1083,7 +1083,7 @@
  	return NULL;
      }

-    version =3D CS_VERSION_100;
+    version =3D CS_VERSION_150;
      if (!PyArg_ParseTuple(args, "|i", &version))
  	return NULL;


It should be easy to write a small patch so that the maximum available =

version of CS_VERSION_* is detected at compilation time, so that =

python-sybase always use the capability of the version of Sybase it is =

compiled with. I will add that for python-sybase 0.40.

regards

--
S=E9bastien Sabl=E9

Jeffrey Zelt a =E9crit :
> I have a problem where a Sybase.DatabaseError exception is thrown by the =

> python-sybase module when I execute a Sybase ASE 15.0.3 stored procedure =

> that contains a local variable with a name longer than 30-characters.
> =

>  =

> =

> Here is exact error text:
> =

>  =

> =

> Traceback (most recent call last):
> =

>   File =

> "/home/jeffreyz/workspace-3.5/generate-client-test-data/src/generate_data=
_run.py", =

> line 11, in <module>
> =

>     '--logging-stderr-on', '--logging-stderr-level', str(logging.DEBUG),
> =

>   File =

> "/home/jeffreyz/workspace-3.5/generate-client-test-data/src/generate_data=
.py", =

> line 415, in main
> =

>     generate_client(cursor, options)
> =

>   File =

> "/home/jeffreyz/workspace-3.5/generate-client-test-data/src/generate_data=
.py", =

> line 271, in generate_client
> =

>     '@op_AccountNumber': Sybase.OUTPUT(1)})
> =

>   File "build/bdist.linux-i686/egg/Sybase.py", line 418, in callproc
> =

>   File "build/bdist.linux-i686/egg/Sybase.py", line 695, in _start
> =

>   File "build/bdist.linux-i686/egg/Sybase.py", line 709, in _mainloop
> =

>   File "build/bdist.linux-i686/egg/Sybase.py", line 753, in _raise_error
> =

> Sybase.DatabaseError: Msg 103, Level 15, State 205, Line 13
> =

> The identifier that starts with '@tmp_HasFixedInitialCreditLimi' is too =

> long. Maximum length is 30.
> =

> Msg 103, Level 15, State 205, Line 14
> =

> The identifier that starts with '@tmp_HasFixedClearingCreditLim' is too =

> long. Maximum length is 30.
> =

> Msg 137, Level 15, State 1, Line 14
> =

> Must declare variable '@tmp_HasFixedClearingCreditLimi'.
> =

>  =

> =

> Notice that it is complaining that the name of the local variable =

> =91@tmp_HasFixedClearingCreditLimit=92 is too long.
> =

>  =

> =

> This was a known problem with ASE 12.x.  However, I compiled the =

> python-sybase module on Ubuntu 9.04 against:
> =

>  =

> =

>     Linux Express Edition for ASE 15.0.3
> =

>  =

> =

> I have never installed a version of ASE 12.x, so I could not have =

> accidentally compiled against old libraries.  The server on which the =

> stack trace above was created was running ASE 15.0.3 on Fedora Linux.
> =

>  =

> =

> Does anyone know why I triggered an exception for identifiers over =

> 30-characters when all libraries involved seem to be for Sybase ASE 15.x?
> =

>  =

> =

> Is there a way to fix this problem so that no exception is thrown?
> =

>  =

> =

> Regards,
> =

> Jeffrey
> =

>  =

> =

> =

> ------------------------------------------------------------------------
> =

> -------------------------------------------------------------------------=
-----
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-D=
ay =

> trial. Simplify your report design, integration and deployment - and focu=
s on =

> what you do best, core application coding. Discover what's new with =

> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> =

> =

> ------------------------------------------------------------------------
> =

> _______________________________________________
> Python-sybase-misc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/python-sybase-misc


---------------------------------------------------------------------------=
---
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day =

trial. Simplify your report design, integration and deployment - and focus =
on =

what you do best, core application coding. Discover what's new with =

Crystal Reports now.  http://p.sf.net/sfu/bobj-july