Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> NEVER MIND !
Never mind- I figured it out. It takes two ' and I forgot a step-
dbms.execute.
Thanks anyway.
Alan Shein <alanshein_at_erols.com> wrote in message
news:82p4ll$jjt$1_at_autumn.news.rcn.net...
> I have the following procedure, which can truncate tables for me, but I
> would like to use it to do an insert every now and then as well. What am I
> doing wrong?
>
> CREATE OR REPLACE PROCEDURE special_sql (p_sql VARCHAR2)
> as
> ch INTEGER;
> begin
> ch := DBMS_SQL.OPEN_CURSOR;
> DBMS_SQL.PARSE(ch,p_sql,DBMS_SQL.NATIVE);
> DBMS_SQL.CLOSE_CURSOR(ch);
> commit work;
> end special_sql;
>
> So,
>
> execute special_sql ('truncate table test_table');
>
> works just fine, but
>
> execute special_sql('insert into test_table (col1) values ('a')');
>
> returns an error:
>
> ERROR at line 1:
> ORA-06550: line 1, column 59:
> PLS-00103: Encountered the symbol "A" when expecting one of the following:
> . ( ) , * @ % & | = - + < / > in mod not range rem => ..
> an exponent (**) <> or != or ~= >= <= <> and or like between
> is null is not ||
> The symbol ". was inserted before "A" to continue.
>
> I tried various permutations of single and double quotes (except the right
> one?), but nothing seemed to work.
>
>
Received on Fri Dec 10 1999 - 10:43:14 CST
![]() |
![]() |