Re: Simple eusql prog now works - kinda
ronaustin at alltel.net wrote:
>
>
>Thanks to Matt I saw the error of my way and now have a new simple
>program that does write records to the eusql database.
>
>include database.e
>include eusql.e
>
>sequence dbname,
> tname,
> ok,
> code, -- code
> descrip, -- descripton
> categ -- category
>
>
> dbname = open_db("TEST.EDB")
> tname = "DIAG"
> code = "V43.1"
> descrip = "Psudoaphakia"
> categ = "Surg"
>
> ok = insert_record(dbname,tname,blank_record(dbname,tname),
> {code,descrip,categ},{{1},{2},{3}})
>
> close_db (dbname)
>
>Before I started dancing around and throwing my hat in the air I thought
>I should try to read a record out of the database. Alas, this program
>don't work.
>
>include database.e
>include eusql.e
>
>
>sequence ok,
> dbname,
> tname,
> data
>
> integer key
> key = 1
>
> dbname = "TEST.EDB"
> tname = "DIAG"
>
> ok = open_db(dbname)
> ok = get_record(dbname,tname,"V43.1",data,key)
> puts(1,data)
>
> close_db (dbname)
>
>I get an error that says,"variable data not defined". Can someone tell
>me why?
>
>
In the code you posted, data has not been defined (or given a value)
when you first use it.
|
Not Categorized, Please Help
|
|