Re: 30-character limit for identifiers with ASE 15.x?
"Cserna, Zsolt" <[email protected]> Fri, 28 Aug 2009 13:59:28 +0100
| Newsgroups | gmane.comp.python.sybase |
|---|---|
| Message-ID | <0FE1D5D2B5C6754898C9E32C1230EC6544BF719849@LNWEXMBX0105.msad.ms.com> |
Sorry if I generate some noise, but for me it was required to change the li=
ne 173 in sybasect.c as well:
Original:
171 static PyObject *sybasect_cs_ctx_alloc(PyObject *module, PyObject *ar=
gs)
172 {
173 int version =3D CS_VERSION_100;
174
175 if (!PyArg_ParseTuple(args, "|i", &version))
176 return NULL;
177 return ctx_alloc(version);
178 }
It was required to gain access to wide tables (eg. tables containing varcha=
r / char fields sized more than 255 chars).
Zsolt
=
> -----Original Message-----
> From: S=E9bastien Sabl=E9 [mailto:[email protected]] =
> Sent: Thursday, August 27, 2009 18:26
> To: Jeffrey Zelt
> Cc: [email protected]
> Subject: Re: [Python-sybase-misc] 30-character limit for =
> identifiers with ASE 15.x?
> =
> 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=3D184050&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_d
> > ata_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_d
> > ata.py",
> > line 415, in main
> > =
> > generate_client(cursor, options)
> > =
> > File
> > =
> "/home/jeffreyz/workspace-3.5/generate-client-test-data/src/generate_d
> > ata.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
> > [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 =
> _______________________________________________
> Python-sybase-misc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/python-sybase-misc
> =
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender doe=
s not intend to waive confidentiality or privilege. Use of this email is pr=
ohibited when received in error. We may monitor and store emails to the ext=
ent permitted by applicable law.
---------------------------------------------------------------------------=
---
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