| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DBMS_SQL for a select statement?
> But I also want the database link to be dynamic. Someone suggested using
> DBMS_SQL package to do it. But DBMS_SQL does not allow 'select ...
> into...', so I removed the 'into...' portion and DBMS_SQL runs fine without
> error/exception.
>
> But now my problem is: how do I get the values returned from this select
> statement????
tradename varchar2(200);
sic varchar2(5);
BEGIN
-- Define columns
DBMS_SQL.DEFINE_COLUMN(q_cursor,1,c_tradename,200);
DBMS_SQL.DEFINE_COLUMN(q_cursor,2,c_sic,5);
-- This is how you get the column values, once you have the data in
them you can use them in your procedure
DBMS_SQL.COLUMN_VALUE(q_cursor, 1, tradename);
DBMS_SQL.COLUMN_VALUE(q_cursor, 2, sic);
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Fri Jun 05 1998 - 00:00:00 CDT
![]() |
![]() |