Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_sql problem
Malini:
In line 7 where you have dbms_sql it should be something like DBMS_SQL.V8 or
DBMS_SQL.NATIVE
Venkat
>This is actually straight out of Oracle 8 documentation for
>Dynamic SQL, but I am unable to load it. I have all resource
>and connect permissions and there does not seem to be any
>syntax errors. What am I missing ?
>
>Thanks,
>Malini
>
>
>The error I get is
>-----------------------------------------------------------------------
>Line/Col Error
>7/5 P/L SQL : Statement ignored
>7/67 PLS-00226: package 'DBMS_SQL' used as variable reference
>----------------------------------------------------------------------
>
>Procedure text with line numbers
>---------------------------------------------------------------------
>
>1 CREATE OR REPLACE PROCEDURE demo(salary IN NUMBER) AS
>2 cursor_name INTEGER;
>3 rows_processed INTEGER;
>4 BEGIN
>5
>6 cursor_name := dbms_sql.open_cursor;
>7 dbms_sql.parse(cursor_name, 'DELETE FROM emp WHERE sal > :x', dbms_sql);
>8 dbms_sql.bind_variable(cursor_name, ':x', salary);
>9 rows_processed := dbms_sql.execute(cursor_name);
>10 dbms_sql.close_cursor(cursor_name);
>11
>12 EXCEPTION WHEN OTHERS THEN
>13 dbms_sql.close_cursor(cursor_name);
>14 END;
Received on Wed May 27 1998 - 20:07:02 CDT