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

Home -> Community -> Usenet -> c.d.o.misc -> Re: DBMS_SQL for a select statement?

Re: DBMS_SQL for a select statement?

From: <bonanos_at_yahoo.com>
Date: 1998/06/05
Message-ID: <6l8e4a$7qi$1@nnrp1.dejanews.com>#1/1

> 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????



Define the variables to put the data into and then use them as follows: BTW This is not a complete example.
           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

Original text of this message

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