Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create cursor - can READWRITE be used with this?

Status
Not open for further replies.

kenndot

Programmer
May 15, 2001
316
US
I have the awful task of rewriting code to use cursors instead of tables, now I know I can SELECT blah into cursor readwrite to allow for updates and multiple indexes, but can I do the same using create cursor? From what I see in the docs I would say no, but sometimes the right info isn't in the docs and other people know better, so I thought I would ask.

If you had to switch a table to a cursor that currently looks like this...

*DCK* CREATE TABLE termreenr (MEMBERID C(15), ;
*DCK* SSN C(11), ;
*DCK* GROUPNO C(10), ;
*DCK* SITE C(3), ;
*DCK* EDATE D, ;
*DCK* TDATE D, ;
*DCK* TermRsn C(5), ;
*DCK* TrnCode C(2), ;
*DCK* ReEnroll L, ;
*DCK* BUCKET C(3) )

yes, it's commented

to use a cursor, but I need to have multiple indexes and it has to be updateable, how would you do this? Perhaps I'm just looking the long way around and I'm not seeing an easy solution?

Thanks
 
Just do it:

CREATE CURSOR myCursor ( Field1 C(10), Field2 C(10) )
INDEX ON Field1 TAG Field1
INDEX ON Field2 TAG Field2
INDEX ON Upper(Field1+field2) TAG Both

APPEND BLANK
REPLACE Field1 with "one"
etc...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top