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 help

Re: dbms_sql help

From: Eitan <no_spam_please_at_nospam_please.com>
Date: Mon, 13 Mar 2006 11:06:39 +0200
Message-ID: <dv3cgf$t99$1@news2.netvision.net.il>


Hello,

In Oracle 8i ...
Oracle8 Enterprise Edition Release 8.0.6.2.0 - Production.

I have tried the following in the package-function : execute immediate ('select * from emp'); ...
but, compiler shouts :
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one of the following:

   := . ( @ % ;
The symbol ":=" was substituted for "IMMEDIATE" to continue.

Besides,
execute immediate ('select * from emp') - to what variable (I need to keep it somehow).

I can be specific, and do select from a specific table, but I need to build a generic function for any table, that can be used in SQL statement - cann't I ?

Thanks :)

<frank.van.bortel_at_gmail.com> wrote in message news:1141917506.858084.99260_at_z34g2000cwc.googlegroups.com...
> Ehm... why do you wrap it in a function to begin with?
> I mean, you can just as well do
> select * from emp;
>
> instead of :
> select my_pack.my_func from dual;
> and have a function defined that will do the select * from emp.
>
> Why all the hassle?
> And with execute immediate (9i and up, not 8i), it would be:
> execute immediate ('select * from emp');
> No cursor prepare, execute, bind, etc, you would use with dbms_sql.
>
> In the link provided, execute immediate has examples, too.
> But usually this approach leads to non-scalable applications.
>
Received on Mon Mar 13 2006 - 03:06:39 CST

Original text of this message

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