A 4GL Question
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
You know how you can set up keys to do things like go forward one page: "options next key F35". Well, is there any way to set up a key that will skip you all the way to the last record queried? "On key" might work, but I'm unsure how to code it to move from one record to the next. Any help you can give would be greatly appreciated!
The 'Sql Power SniFFFer' product line for Informix was renamed the 'Zero Impact Sql Monitor' to more appropriately describe the product's non-intrusive, 24x7, zero impact -- SQL and service level monitoring facilities. Refer to www.sqlpower.com. Mary Owens Sql Power Tools www.sqlpower.com 201.825.9511
I'm not sure if you are working with an array, or with a cursor. Obnoxio has assumed an array, with multiple rows displayed in one form. Also I'm confused about the "all the way to the last record queried" since if it was the *last* record queried wouldn't to be the previous query made? If you are working with an array that has already been initialized using a cursor or some other method, then go with Obnoxio. If you are working with a cursor, and you want to resurrect the last query made by the user, do the following. Save the user's query criteria, which is the contents of the variable used in the construct statement: define p_qry char(1000), op_qry char(1000), sql_stmt char(1000) ... ... construct by name p_qry on emp.fname, emp.lname let op_qry = p_qry Then later get that row again by preparing a cursor and fetching:: ... sql_stmt = "select lname, fname from emp where ", op_qry clipped prepare p_1 from sql_stmt declare c_1 cursor for p_1 open c_1 fetch c_1 into last_name, first_name close c_1 -- now display it I use this to restore the most recent query after a user has aborted a new query, if in fact that is the behavior that the user wants. Hope this helps. Top Cat wrote: > You know how you can set up keys to do things like go forward one page: > "options next key F35". Well, is there any way to set up a key that will > skip you all the way to the last record queried? "On key" might work, but > I'm unsure how to code it to move from one record to the next. Any help you > can give would be greatly appreciated!