ns_db dml inside of ns_db getrow

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
Hi, I keep getting errors for a ns_db dml "insert bluh bluh" call
inside of a while { [ns_db getrow $db $selection] } loop. If I take
out the ns_db dml statement everything works fine and I can get the
variables and whatnot. But when I put in the dml statment, I keep
getting error ORA-24374: define not done before fetch"

What's going on?
Thanks
Shan SHan

-- Shan Shan Huang, March 1, 2000

Answers

I believe this is because you can't use the handle until you finish your select.

If you are using the ACS and have it properly setup this is a case where you would want to get a handle from the subquery pool.

Else you might need to define a new pool in your nsd.ini file and use that.

-- Steven Pulito, March 1, 2000


This sounds like one of those cases in which you are dragging things from Oracle to TCL and then stuffing back into Oracle, when in fact you can probably do the whole thing while inside of Oracle (the right way) using the right SQL.
INSERT INTO bonus 
    SELECT ename, job, sal, comm 
        FROM emp 
        WHERE comm > 0.25 * sal 
            OR job IN ('PRESIDENT', 'MANAGER'); 

... from the online Oracle SQL docs.
http://oradoc.photo.net/ora8doc/DOC/server803/A54647_01/ch4j.htm#5586


-- Bobby Prill, March 2, 2000

I've tried to do it all in one sql command. But I want to stuff the table with relative_id's selected from one table, and just an integer (photo_id). How do I do that?

-- Shan Shan Huang, March 2, 2000