Selecting univarchar columns

"Jeffrey Zelt" <[email protected]> Thu, 1 Oct 2009 15:24:41 +0200
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
This is a multi-part message in MIME format.

--===============4873094739913096241==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CA429A.89A92840"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA429A.89A92840
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

When I execute a simple SELECT statement that includes columns of type
UNIVARCHAR, python-sybase throws a TypeError exception as shown here:

=20

Traceback (most recent call last):

  File
"/home/jeffreyz/workspace-3.5/sybase-tests/src/connection_tests.py",
line 61, in <module>

    cursor.execute("SELECT AccountTypeID, Description FROM AccountType")

  File "build/bdist.linux-i686/egg/Sybase.py", line 554, in execute

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

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

  File "build/bdist.linux-i686/egg/Sybase.py", line 775, in _row_result

  File "build/bdist.linux-i686/egg/Sybase.py", line 689, in _fetch_rows

  File "build/bdist.linux-i686/egg/Sybase.py", line 292, in _extract_row

TypeError: unknown data format

=20

In this example, the column "Description" is of type UNIVARCHAR(50).  Is
this a known problem and is there a fix?

=20

I compiled python-sybase on Ubuntu Linux with the ASE 15.02 Express
Edition for Linux.=20

=20

Has anyone else tried to select Unicode columns with any success?

=20

Regards,

Jeffrey

=20

=20


------_=_NextPart_001_01CA429A.89A92840
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>When I execute a simple SELECT statement that =
includes
columns of type UNIVARCHAR, python-sybase throws a TypeError exception =
as shown
here:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Traceback (most recent call last):<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;/home/jeffreyz/workspace-3.5/sybase-tests/src/connection_tests.py&q=
uot;,
line 61, in &lt;module&gt;<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; cursor.execute(&quot;SELECT
AccountTypeID, Description FROM AccountType&quot;)<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 554, in =
execute<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 703, in =
_start<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 736, in =
_mainloop<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 775, in =
_row_result<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 689, in =
_fetch_rows<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp; File
&quot;build/bdist.linux-i686/egg/Sybase.py&quot;, line 292, in =
_extract_row<o:p></o:p></p>

<p class=3DMsoNormal>TypeError: unknown data format<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>In this example, the column =
&#8220;Description&#8221; is of
type UNIVARCHAR(50).&nbsp; Is this a known problem and is there a =
fix?<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I compiled python-sybase on Ubuntu Linux with the =
ASE 15.02
Express Edition for Linux. <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Has anyone else tried to select Unicode columns =
with any
success?<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Regards,<o:p></o:p></p>

<p class=3DMsoNormal>Jeffrey<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA429A.89A92840--


--===============4873094739913096241==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
--===============4873094739913096241==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============4873094739913096241==--