by TDIMSO27.backend.tdata.com.ar (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with ESMTPA id <0HN600FYZQUF5M at TDIMSO27.backend.tdata.com.ar> for EUforum at topica.com; Wed, 22 Oct 2003 22:01:28 -0300 (GMT) From: Guillermo Bonvehi <knixeur at speedy.com.ar> Subject: Re: Simple eusql prog now works - kinda lla vundefinedundefined) Gecko/20030624 I hadn=B4t been following this thread but you create a variable named data= =20 and you don=B4t assing anything to it, and then pass it in the=20 get_record function. What are u passing if data contains nothing? :) That=B4s the error. ronaustin at alltel.net wrote: >=20 >=20 > Thanks to Matt I saw the error of my way and now have a new simple=20 > program that does write records to the eusql database. >=20 > include database.e > include eusql.e >=20 > sequence dbname, > tname, > ok, > code, -- code=20 > descrip, -- descripton > categ -- category >=20=09=20 >=20=09=20 > dbname =3D open_db("TEST.EDB") > tname =3D "DIAG" > code =3D "V43.1" > descrip =3D "Psudoaphakia" > categ =3D "Surg" >=20=20=20=20=20 > ok =3D insert_record(dbname,tname,blank_record(dbname,tname), > {code,descrip,categ},{{1},{2},{3}}) >=20 > close_db (dbname) >=20 > Before I started dancing around and throwing my hat in the air I thought= =20 > I should try to read a record out of the database. Alas, this program= =20 > don't work. >=20 > include database.e > include eusql.e >=20 >=20 > sequence ok, > dbname, > tname, > data >=20 > integer key > key =3D 1 >=20 > dbname =3D "TEST.EDB" > tname =3D "DIAG" >=20=09=09=20=20=20=20=20 > ok =3D open_db(dbname) > ok =3D get_record(dbname,tname,"V43.1",data,key) > puts(1,data) >=20 > close_db (dbname) >=20 > I get an error that says,"variable data not defined". Can someone tell= =20 > me why? >=20 > In the database I have an index for all three fields. I'm trying to use= =20 > the code for the key and I have the key set to 1. >=20 > If I wanted to find by diagnosis do I replace the "V43.1" with what I'm= =20 > looking for and change the key to 3?=20=20 >=20 > (Since the index table is sorted in alph order, the indexes are 1 =3D= =20 > code, 2 =3D category and 3 =3D Description)