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: Create table using %TYPE in dynamic SQL

Re: Create table using %TYPE in dynamic SQL

From: Jan <janik_at_pobox.sk>
Date: 23 Nov 2004 23:39:05 -0800
Message-ID: <81511301.0411232339.4417e867@posting.google.com>


EXECUTE IMMEDIATE
 'CREATE TABLE t_result_r35 AS SELECT eqp_code FROM mtf_equipment WHERE 1=0';

but you would never want to create tables/indexes/etc.. on runtime (e.g. in PL/SQL).

Jan

Victor Engmark <victor.engmark_at_cern.ch> wrote in message news:<cnvkd2$j1o$1_at_sunnews.cern.ch>...
> Hi all,
>
> It seems I've run into a problem of lack of flexibility in SQL itself.
> I'm no whiz, but I'd like to retain the flexibility that comes from
> using %TYPE where appropriate.
>
> However, it seems I cannot use this in "create table" statements.
> "CREATE TABLE t_result_r35 (eqp_code mtf_equipment.eqp_code%TYPE)" just
> results in an "invalid character" error.
>
> I'm executing this "immediately" in PL/SQL. In case there is no way to
> solve this in SQL directly, is there any way I can get the data type as
> a string value?
Received on Wed Nov 24 2004 - 01:39:05 CST

Original text of this message

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