Re: How to convert a stored-proc with one result-set into a table udf Norm wrote:
> fetch_loop:
> REPEAT
> FETCH rsCur INTO
> TABLE_SCHEMA
> ,TABLE_NAME
> ,CARD
> ,OVERFLOW
> ,NPAGES
> ,FPAGES
> ,ACTIVE_BLOCKS
> ,TSIZE
> ,F1
> ,F2
> ,F3
> ,REORG;
>
> INSERT INTO SESSION.TB_REORGCHK VALUES (
> TABLE_SCHEMA
> ,TABLE_NAME
> ,CARD
> ,OVERFLOW
> ,NPAGES
> ,FPAGES
> ,ACTIVE_BLOCKS
> ,TSIZE
> ,F1
> ,F2
> ,F3
> ,REORG)
> UNTIL at_end > 0
> END REPEAT fetch_loop;
>
Doesn't the last row in the cursor get inserted twice in this fetch
loop? |