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

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL EXECUTE IMMEDIATE won't parse...help

PL/SQL EXECUTE IMMEDIATE won't parse...help

From: Mark Brunkhart <markhart_at_ricochet.net>
Date: Tue, 27 Jul 1999 13:42:18 -0700
Message-ID: <379E19A9.D8DB6DBF@ricochet.net>


I'm having trouble getting EXECUTE IMMEDIATE to parse in Oracle 8. The following shows a SQL*PLUS session and the resultant error. The command is straight out of the PL/SQL User's Guide and Reference. I'm guessing this may have to do with the fact that the EXECUTE command is getting converted into a BEGIN..END pair. Anyone know what's up?

SQL> CREATE FUNCTION row_count (tab_name CHAR) RETURN INT AS   2 rows INT;
  3 BEGIN
  4 EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || tab_name INTO rows;   5 RETURN rows;
  6 END;
  7 /

Warning: Function created with compilation errors.

SQL> show errors function row_count;
Errors for FUNCTION ROW_COUNT:

LINE/COL ERROR




4/11 PLS-00103: Encountered the symbol "IMMEDIATE" when expecting one
         of the following:
         := . ( @ % ;
Received on Tue Jul 27 1999 - 15:42:18 CDT

Original text of this message

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