Re: HELP - Using a cursor in 4gl
Posted in 1996
In <54gdcp$neg@unica.udc.es> apardo@news.udc.es (Alberto Pardo Fernandez) writes: >I need to recover data from a table in a 4gl program. I dont know neither the >table name nor the table structure at compile time. Although I can find it out >at run time, I cant declare a record with DEFINE my_record RECORD LIKE tabname.* >(tabname is a variable that holds the name of my table). >How can I access to the data recovered by the cursor? Is there any way to access >the field values of the cursor? >DEFINE tablename CHAR(20) >DEFINE my_field CHAR(20) >. >. >. >LET sql = "select * from ", tablename >PREPARE query FROM sql >DECLARE my_cursor CURSOR FOR query >FOREACH my_cursor ># Here I want to access the values of the fields of my_cursor ># How can I access the field whose name is the value of my_field >END FOREACH What about LET sql = "select ", my_field clipped, " from ", tablename or is it the case that my_field is not known at this stage of the program? Bryan Tonnet batonnet@zeta.org.au