Here's the problem. I need to do a fetch row on a cursor, however you can only do that with a result set cursor(also called scrollable cursor).
The help file says:
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>
Direct positioning requires the cursor used with the query to be set to result-set mode (also called scroll mode). You can declare a cursor for result set mode operation as follows:
result set c1;
This isn't working for me. I've tried declaring as a cursor then declaring as result set. I've tried just declaring it as a result set. I've tried declaring both ways in the function and globally. I've included DBAPI.bdh, ODBC.bdh, and both at the same time, for each of the different ways I was declaring the cursor.
compile error SYN 29: 'VAR', 'RESULT SET' or 'BEGIN' expected
I'm stumped, and segue support has nothing on the subject, thought I would try here first to see if anyone has experience with this.
I've been doing a lot of ODBC stuff recently but using the native calls rather than the high/medium level interface - hence for what you are achieving I would use the OdbcFetch function.
As far as I'm aware if you want to use this then you will need to convert all functions to the native methods, unfortunately I'm not familiar with the high/medium level interface as I require the flexibility of the native methods.
That worked, it was tough re-writing the code for the ODBC stuff, but once I figured it all out, everything ran fine. Here's what I did, just in case anyone else wants it. btw, I didn't need to use result set cursor!
What I am trying/accomplishing here is to load data from a database that feeds the front end. There are text boxes on the page that are used to search for, so instead of hard-coding values, I am building a file with valid data that I can search on. Because of the potential of millions of records being returned, I put logic in place to return a subset of the results. Since multiple users will be creating these files, the file names are already set up using the VU ID as part of the file name. This is done to aviod Runtime Error 93, which there appears no way of handling or avoiding. Anyway, multiple users will be creating these files so I need to limit the size and using a random starting point will give each user different data to search on. If there are no results returned, I delete the file.