Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: dynamic SQL with dbms_sql, example?

Re: dynamic SQL with dbms_sql, example?

From: Thomas Bierhance <Bierhance_at_orbital-computer.de>
Date: 15 May 1999 14:06:09 GMT
Message-ID: <373D7FD9.BBBC3DE3@orbital-computer.de>


sorry,
actually these two should be reversed

> DBMS_SQL.COLUMN_VALUE(vCursorID, 1, [var]);
> IF DBMS_SQL.FETCH_ROWS(vCursorID) = 0 THEN
> EXIT;
> END IF;
...

 IF DBMS_SQL.FETCH_ROWS(vCursorID) = 0 THEN

    EXIT;
 END IF;
 DBMS_SQL.COLUMN_VALUE(vCursorID, 1, [var]);

second, I had a closer look at your problem and found that it can't be that easily solved. As the number and type of columns the select statement retrieves are unknown at compilation-time it is difficult to involve a correct DBMS_SQL.DEFINE_COLUMN. A solution could be to use DBMS_SQL.DESCRIBE_COLUMNS. Though this would still mean to handle an unknown number and type of variables... I used Dynamic SQL often to include a 3rd GL generated where-clause in PL/SQL in which case you know your columns...

Regards,

Thomas

PS: Matthias, bei weiteren Fragen kannst Du mich natürlich gerne per Email kontakten Received on Sat May 15 1999 - 09:06:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US