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: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Wed, 24 Nov 2004 19:44:55 +0100
Message-ID: <co00g7$abr$1@news6.zwoll1.ov.home.nl>


Victor Engmark wrote:
> 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?
>

"Usually" there is no reason to create tables from within PL/SQL... Usually in quotes, as there may be reasons.
Usually SQL Server habits, I'm afraid; and even temporary tables can be created once.

As for your problem; why use a fixed table, and not a memory structure (e.g. PL/SQL table)?

-- 

Regards,
Frank van Bortel
Received on Wed Nov 24 2004 - 12:44:55 CST

Original text of this message

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