ESQL/C Program - Get First, Get Next Record in Table
Posted in 1992
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi Netters, I was wondering if anyone can help me out with what I think is a problem with using ESQL/C to perform a get first and get next operation from a C program. The program has two routines call Get_First and Get_Next which are used to retrieve records from a table based on a specified selection criteria. The Get_First and Get_Next routines are used in many other routines to retrieve records based on a specified selection criteria. The problem is if I have a parent function as such: FUNCTION A Begin table_name = 'FOOBAR' selection_criteria = 'A*' Get_First(table_name, selection_criteria, return_record) While ( return_record.field1 != xx) Do Begin Get_Next(table_name, selection_criteria, return_record) End End FUNCTION Get_First BEGIN Use Cursor to retrieve records which match selection_criteria Return First Record in cursor END FUNCTION Get_Next BEGIN Use Cursor to retrieve records which match selection_criteria Return Next record in cursor /* <=== PROBLEM */ END The PROBLEM is how do you know which is the next record, after the first record is retrieved, or for subsequent records for that matter? Any advice would be appreciated, Thanks, Bert Sandie MPR TELTECH LIMITED Burnaby, BC, Canada EMAIL: sandie@mprgate.mpr.ca