Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Execute Immediate : Can't run ...Please help
Hi Chet:
I have pasted your code and tried to run but the same error message....:
Line # = 51 Column # = 20 Error Text = PLS-00103: Encountered the symbol "=" when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like between using || multiset member SUBMULTISET_ The symbol ". was inserted before "=" to continue.
Thanks in advance
Zahir
"Chet Justice" <chet.justice_at_pfsf.org> wrote in message news:<1114190946.707715.148420_at_l41g2000cwc.googlegroups.com>...
> Error message would certainly help.
>
> First thing I would guess is that you need double quotes around your
> variables like this:
>
> strSql := strSql || ' WHERE SLOOKUP_GROUP = '''|| pSLOOKUP_GROUP ||'';
> strSql := strSql || ' AND ILOOKUP_LANGUAGECODE = ''' ||
> pILOOKUP_LANGUAGECODE || '';
>
> Second, why do you even need the EXECUTE IMMEDIATE? OPEN io_cursor FOR
> strSql will work just fine.
>
> your reworked code:
> AS
> PROCEDURE GET_LOOKUP
> (pILOOKUP_LANGUAGECODE IN NUMBER,
> pSLOOKUP_GROUP IN VARCHAR2,
> IO_CURSOR IN OUT T_CURSOR)
> IS
> strSql VARCHAR2(1000);
> BEGIN
>
> strSql := 'SELECT
> DISTINCT LOOKUP.SLOOKUP_VALUE,
> LOOKUP.SLOOKUP_LABEL
> FROM SFIS.LOOKUP';
>
> strSql := strSql || ' WHERE SLOOKUP_GROUP = ''' || pSLOOKUP_GROUP
> || '';
> strSql := strSql || ' AND ILOOKUP_LANGUAGECODE = ''' ||
> pILOOKUP_LANGUAGECODE || '';
>
> IF (pSLOOKUP_GROUP='FacStatusEntryType') OR
> (pSLOOKUP_GROUP='FacOwner') THEN
> OPEN IO_CURSOR FOR
> strSql := strSql || ' ORDER BY LOOKUP.SLOOKUP_VALUE';
> ELSE
> OPEN IO_CURSOR FOR
> strSql;
> END IF;
> END GET_LOOKUP_VALUE_LABEL;
> END PAC_LOOKUP;
>
>
> hope this helps. if not, post the error message.
>
> chet
Received on Mon Apr 25 2005 - 08:10:28 CDT