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: Execute Immediate and bind variables

Re: Execute Immediate and bind variables

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Wed, 10 Aug 2005 18:29:53 -0700
Message-ID: <9eOdnVyx1OtXNGffRVn-3w@comcast.com>

"brightspot" <brightspot5_at_hotmail.com> wrote in message news:1123711296.563366.284890_at_g47g2000cwa.googlegroups.com...
> Thanks Matthias, I see what you are saying. So I can just use the
> parameter as it comes into the stored procedure:
>
> Execute Immediate 'SELECT ' || SCHEMA_NAME || '.theTableName.theField
> > AS THE_FIELD, ' || ... etc
>
> I'm still getting an error testing the SP from SQLPlus:
> BEGIN MY_QRY (schemaName); END;
>
> *
> ERROR at line 1:
> ORA-06550: line 1, column 27:
> PLS-00201: identifier 'schemaName' must be declared
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
> Permissions problem, maybe??
>
> Thanks
>

This is usually a bad idea. direct ports of SQL Server practices to Oracle usually turn out to be a big mistake.
SQL Server != Oracle
Jim Received on Wed Aug 10 2005 - 20:29:53 CDT

Original text of this message

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