Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_sql problem
Look at your line 7, it should say dbms_sql.native not just dbms_sql
YOur parse statement.
In article <6ki7ls$sqq$1_at_nnrp1.dejanews.com>,
mkaushik_at_harvestinc.com wrote:
>
> 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;
> 15 /
> ---------------------------------------------------------------------------
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Thu May 28 1998 - 11:17:34 CDT
![]() |
![]() |