From: Jeffrey Z. <Jef...@q-...> - 2009-08-28 13:00:59
|
Thank you Sébastien, I changed CS_VERSION_100 to CS_VERSION_150 in both: ctx.c sybasect.c and then recompiled. This fixed my problem. There are no exceptions thrown now when executing a stored procedure that contains a local variable name longer than 30 characters. Regards, Jeffrey ============================================================ 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=detail&aid=2809032&group_id=184050&atid=907701 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 =================================================================== --- ctx.c (révision 443) +++ ctx.c (copie de travail) @@ -1083,7 +1083,7 @@ return NULL; } - version = CS_VERSION_100; + version = 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ébastien Sablé Jeffrey Zelt a écrit : > 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 > '@tmp_HasFixedClearingCreditLimit' 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-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 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Python-sybase-misc mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-sybase-misc |