[Zope] how to check if the ResultSet is null?

Peter Marriott peter@bmssolutions.com
Thu, 13 Jul 2000 15:51:39 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0002_01BFECE2.3B8C07A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

You could always do something like this first:
"select Count(usr_email)  from info(table name) where usr_email =
<dtml-sqlvar usr_email type=string>"
Then check the result will be either 1 or 0.

Cheers
Peter
  -----Original Message-----
  From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Sa
  Sent: Thursday, 13 July 2000 6:04 AM
  To: zope@zope.org
  Subject: [Zope] how to check if the ResultSet is null?


  Hi, I stuck on a problem: I am creating a registration form. I need to
check if the person info has already in database. I created a Z SQL method
which I used "select usr_email from info(table name) where usr_email =
<dtml-sqlvar usr_email type=string>" I want to call this method from my dtml
method and see if it returns "null". But I'm not sure how to implement this.
In Java, it has ResultSet which I can check if it returns null. I'm not sure
how to accomplish this in Zope. I could not find relevant document. If you
know this, could you give me a hand? Thanks!

  Sa

------=_NextPart_000_0002_01BFECE2.3B8C07A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D138445007-13072000>You=20
could always do something like this first:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D138445007-13072000>"select Count(usr_email)  from info(table =
name) where=20
usr_email =3D &lt;dtml-sqlvar usr_email type=3Dstring&gt;" =
</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D138445007-13072000>Then=20
check the result will be either 1 or 0.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D138445007-13072000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D138445007-13072000>Cheers</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D138445007-13072000>Peter</SPAN></FONT></DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
  <DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B> =
zope-admin@zope.org=20
  [mailto:zope-admin@zope.org]<B>On Behalf Of </B>Sa<BR><B>Sent:</B> =
Thursday,=20
  13 July 2000 6:04 AM<BR><B>To:</B> zope@zope.org<BR><B>Subject:</B> =
[Zope] how=20
  to check if the ResultSet is null?<BR><BR></DIV></FONT>
  <DIV><FONT color=3D#000000 face=3DArial size=3D2>Hi, I stuck on a =
problem: I am=20
  creating a registration form. I need to check if the person info has =
already=20
  in database. I created a Z SQL method which I used "select usr_email =
from=20
  info(table name) where usr_email =3D &lt;dtml-sqlvar usr_email =
type=3Dstring&gt;"=20
  I want to call this method from my dtml method and see if it returns =
"null".=20
  But I'm not sure how to implement this. In Java, it has ResultSet =
which I can=20
  check if it returns null. I'm not sure how to accomplish this in Zope. =
I could=20
  not find relevant document. If you know this, could you give me a =
hand?=20
  Thanks!</FONT></DIV>
  <DIV><FONT color=3D#000000 face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT color=3D#000000 face=3DArial=20
size=3D2>Sa</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0002_01BFECE2.3B8C07A0--