(no subject)
Posted in 1991
In response to tokarski@nms.gdc.portal.com: What we have been using is Initialization phase: declare x cursor for select .. [for update]; Work phase open x; for (;;) { fetch x; if (sqlca.sqlcode == SQLNOTFOUND) break; [update table .. where current of x;] } Every time x is opened, the variables ($y, $z) used in the declare stmt are instantiated in the cursor after any older open is closed. You can also close the cursor explicitly. Remember to check sqlca.sqlcode sqlca/sqlerrd[1] after each open and each fetch and each update. The 'prepare' route seemed more complicated than this one, so I didn't use it & can't comment. One frustration is that you can't use an 'order by' stmt in your select when you want to update, at least in our version. Bill Ross