[Zope] ZSQL Method result fields names?

Paul Latushko latpaul@online.sinor.ru
Fri, 5 Apr 2002 15:35:48 +0700


This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C1DCB7.972A6B30
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: 7bit

Hello all,

Suppose I have ZSQL Method called SelectCustomers:

-----

select * from Customers

-----

In my Python script I have:

-----

Result = context.SelectCustomers

-----

I can get values from Result:

Result[recordIND][fieldIND]

But how can I get the names of fields in Result (suppose I don't know the
structure of Customers table)?

Any ideas?

Thanks in advance,

Paul.

------=_NextPart_000_0001_01C1DCB7.972A6B30
Content-Type: text/html;
	charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dkoi8-r">


<META content=3D"MSHTML 5.50.4913.1100" name=3DGENERATOR></HEAD>
<BODY>
<DIV>
<P class=3DMsoNormal><FONT face=3DArial size=3D2>Hello all,</P>
<P class=3DMsoNormal>Suppose I have ZSQL Method called =
SelectCustomers:</P>
<P class=3DMsoNormal>-----</P>
<P class=3DMsoNormal>select * from Customers</P>
<P class=3DMsoNormal>-----</P>
<P class=3DMsoNormal>In my Python script I have:</P>
<P class=3DMsoNormal>-----</P>
<P class=3DMsoNormal>Result =3D context.SelectCustomers</P>
<P class=3DMsoNormal>-----</P>
<P class=3DMsoNormal>I can get values from Result:</P>
<P class=3DMsoNormal>Result[recordIND][fieldIND]</P>
<P class=3DMsoNormal>But how can I get the names of fields in Result =
(suppose I=20
don&#8217;t know the structure of Customers table)?</P>
<P class=3DMsoNormal>Any ideas?</P>
<P class=3DMsoNormal>Thanks in advance,</P>
<P class=3DMsoNormal>Paul.</P></FONT></DIV></BODY></HTML>

------=_NextPart_000_0001_01C1DCB7.972A6B30--