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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: newbie: dynamic SQL again

RE: newbie: dynamic SQL again

From: Gogala, Mladen <MGogala_at_oxhp.com>
Date: Wed, 31 Jan 2001 14:48:55 -0800
Message-ID: <F001.002A6825.20010131135546@fatcity.com>

Shooting the application designer, on the other hand, is an ancient procedure.

-----Original Message-----
Sent: Wednesday, January 31, 2001 4:16 PM To: Multiple recipients of list ORACLE-L

Yes! you do, EXECUTE IMMEDIATE is new feature in 8i.

gregory.t.norris_at_mail.sprint.com wrote:

> Doesn't EXECUTE IMMEDIATE require 8i?
>
> -----Original Message-----
> Sent: Wednesday, January 31, 2001 1:37 PM
> To: ORACLE-L
> Cc: MGogala
>
> a) Try execute immediate instead of DBMS_SQL.
> b) Shoot the application designer.
>
> -----Original Message-----
> Sent: Wednesday, January 31, 2001 12:11 PM
> To: Multiple recipients of list ORACLE-L
>
> Hi,
> I have to dynamically create a table and then
> dynamically get the count
> of the rows in a variable. i'm using Oracle 7.3.4.
> i have written the following code...but its not
> working.
> please help me out.
> thanx in advance.
>
> CREATE OR REPLACE PROCEDURE CR_TABLE AS
> A NUMBER;
> QUERY1 VARCHAR2(200);
> QUERY2 VARCHAR2(200);
> CUR1 INTEGER;
> CUR2 INTEGER;
> RET1 INTEGER;
> RET2 INTEGER;
> BEGIN
> CURSOR1:=DBMS_SQL.OPEN_CURSOR;
> QUERY1:='CREATE TABLE CR AS SELECT * FROM INS';
> DBMS_SQL.PARSE(CUR1,QUERY1,DBMS_SQL.V7);
> RET1:=DBMS_SQL.EXECUTE(CUR1);
> DBMS_SQL.CLOSE_CURSOR(CUR1);
> DBMS_OUTPUT.PUT_LINE('TABLE CREATED');
> CUR2:=DBMS_SQL.OPEN_CURSOR;
> QUERY2:='SELECT COUNT(*) FROM CR';
> DBMS_SQL.PARSE(CUR2,QUERY2,DBMS_SQL.V7);
> RET2:=DBMS_SQL.EXECUTE_AND_FETCH(CUR2);
> A:=DBMS_SQL.LAST_ROW_COUNT;
> DBMS_SQL.CLOSE_CURSOR(CUR2);
> DBMS_OUTPUT.PUT_LINE('ROWS COUNTED');
> END;
>
> -anurag
>
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: =?iso-8859-1?q?anurag=20dewan?=
> INET: anu_dewan_at_yahoo.co.uk
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Gogala, Mladen
> INET: MGogala_at_oxhp.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Veera Prasad
  INET: vprasad_at_olf.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Gogala, Mladen
  INET: MGogala_at_oxhp.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jan 31 2001 - 16:48:55 CST

Original text of this message

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