Re: Updating within a scrolling cursor
Posted in 1993
>Quoting Reg Foulkes... > > I would like to access the temporary file created by the a scrolling > cursor. Anyone know how to do this (i.e. what is the mystery table name)? > > Here is what I would like to do > > Declare scrolling cursor sel_stmt > Open sel_stmt > RUN "insert into mystery_table VAULES (....) | isql database - -" > ^^^^^^^^^^^^^ > FETCH next sel_stmt >Quoting Dave Snyder... > >Won't happen. First of all, I don't think you can access a cursor's tmp >table... well, he COULD if he knew its name, but you're right because the name formation rule isn't documented. So even if you figure out what the name is for any case, you can't rely on it. > Second, even if you were using a real tmp table, when you execute >the RUN command to do the INSERT, a new database process is started. The >tmp table from your first database process is not available to any other >database processes. Very true. But the basic question -- can I open a cursor and then use INSERT to stick more rows in the selection set? -- is interesting. Answer: you probably could if you knew the table name, but you don't, and won't. For Reg Foulkes: why do you want to do this? Perhaps if you explain what you are trying to accomplish, somebody would have another suggestion.