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: Oracle equalivent of a Sybase's ISQL for Select Into Trick

Re: Oracle equalivent of a Sybase's ISQL for Select Into Trick

From: sybrandb <sybrandb_at_gmail.com>
Date: 15 Dec 2006 07:09:13 -0800
Message-ID: <1166195353.133455.207600@80g2000cwy.googlegroups.com>

On Dec 15, 4:05 pm, Edmond <somewh..._at_yahoo.com> wrote:
> Hi,
>
> In Sybase,
>
> I can do select * into new_table from old_table where 1=0;
>
> This will create the empty new_table which the column name and data
> definition the same as the old_table.
>
> Is there a equivalent trick in Oracle to do so?
>
> Thanks,
>

create table foo
as select * from bar
where 0=1
/

Frankly the Sybase 'solution' is a kludge as it misuses SELECT to impost for CREATE TABLE.

-- 
Sybrand Bakker
Senior Oracle DBA


> Edmond
Received on Fri Dec 15 2006 - 09:09:13 CST

Original text of this message

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