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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic sql failure

Re: Dynamic sql failure

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 29 Jul 2005 19:53:03 +0200
Message-ID: <p5rke1dp393581rs03asoqb3907fqf5lft@4ax.com>


On 29 Jul 2005 10:20:53 -0700, william_hulse_at_hotmail.com wrote:

>Hi all
>
>
>The following:
>
>
>begin
> execute immediate 'create table c (col1 number,col2 varchar2(30))';
> insert into c
> values (123,'data');
>end;
>
>
>fails with:
>
>
>ORA-06550: line 3, column 15:
>PL/SQL: ORA-00942: table or view does not exist
>ORA-06550: line 3, column 3:
>PL/SQL: SQL Statement ignored
>
>
>Even though commenting out the insert enables the table creation
>
>
>Any ideas would be great
>
>
>Cheers
>
>
>Will

1 has been discussed before
2 convert the code above into ordinary sql removing the begin end; pair and you will be ok
3 It is generally considered bad programming to create tables on the fly in pl/sql

--
Sybrand Bakker, Senior Oracle DBA
Received on Fri Jul 29 2005 - 12:53:03 CDT

Original text of this message

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