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: comments on EXECUTE IMMEDIATE

RE: comments on EXECUTE IMMEDIATE

From: MaryAnn Atkinson <maryann_30_at_yahoo.com>
Date: Wed, 23 Jul 2003 12:16:43 -0700 (PDT)
Message-Id: <25998.339230@fatcity.com>

> declare
> v_count number;
> begin
> execute immediate 'select count(*) from dba_objects'
> into v_count;
> dbms_output.put_line ('Count:'||v_count);
> end;
> Count:3681

I wouldnt use an execute immediate statement on a case like that. I would just leave it as:

SELECT COUNT(*)
FROM DBA_OBJECTS
INTO v_Count;

I have a feeling Oracle wanted to provide different kind of functionality with the execute immediate.

I saw somewhere else a case like the following:

Sql_Stmt := 'UPDATE table

             SET    col1 = :parm1
             WHERE  col2 = :parm2';

EXECURE IMMEDIATE Sql_Stmt USING parm1, parm2;


which again I dont see any advantage. I would have just coded the UPDATE statement without any indirection. Both above examples give me indirection, thats all, which I dont really think I gain anything by incorporating, actually I feel I am losing...

thx
maa



Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software Received on Wed Jul 23 2003 - 14:16:43 CDT

Original text of this message

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