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 -> Re: How to create table by store procedure in Oracle9i

Re: How to create table by store procedure in Oracle9i

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Tue, 08 Jul 2003 09:18:57 -0700
Message-ID: <3F0AEEF1.F35447F1@exxesolutions.com>


SouthVN wrote:

> Hi All !
>
> How to create table by store procedure in Oracle9i ?
>
> Please help me !
>
> CREATE OR REPLACE procedure New_myproc IS
>
> VT_Statement varchar2(1000):='CREATE TABLE ATest (USERID NUMBER
> (14),MAKH VARCHAR2 (15),SOMAY VARCHAR2 (9),DVUID VARCHAR2 (15),TIEN
> NUMBER (14,2),KYHIEUDVU VARCHAR2 (15))';
>
> VT_cursor integer;
> VT_exe integer;
>
> begin
>
> VT_cursor:= dbms_sql.OPEN_CURSOR;
> dbms_sql.PARSE(VT_cursor,VT_Statement,2);
> VT_exe:= dbms_sql.EXECUTE(VT_cursor);
> dbms_sql.CLOSE_CURSOR(VT_cursor);
>
> END;
>
> This store had one error, but I can't find it.
> Please help me !
> Thanks you very much

Others have told you how using native dynamic SQL.

What I would like to emphasize is that if your rationale for doing this is that it is what you did in SQL Server, or Sybase, or some other RDBMS ... don't. There is no reason to ever do this in Oracle ... even if you can.

Better to learn how to use Oracle as Oracle rather than kluge it into being something it isn't and killing performance and scalability in the process.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Jul 08 2003 - 11:18:57 CDT

Original text of this message

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