to create a table structure from an existing structure [message #35976] |
Sun, 28 October 2001 01:00 |
sini
Messages: 10 Registered: October 2001
|
Junior Member |
|
|
hi
consider i have a table 'item' with
the following structure
item_code varchar2(4),qty number(2)
with say around 3 records
now i want to create another table 'item_temp'
which has the SAME STRUCTURE as the above table
but i DO NOT WANT THE DATA FROM THE TABLE 'item'.
if i give the statement
CREATE TABLE item_temp
AS (SELECT * FROM item),
the structure and the contents of the table 'item'
is adopted for table 'item_temp'.
I DON'T WANT THAT.I just want the structure
of the table 'item' to the table 'item_temp'.
Eventually i want to have 'item' with 3 records and 'item_temp' with the same structure as 'item'
but with no records.
what is the sql statement for that?
YA...I COULD USE THE CREATE STATEMENT AS ABOVE
AND THEN DELETE THE RECORDS FROM 'item_temp'.
BUT I DON'T PREFER THAT.IS THERE ANY OTHER SQL
STATEMENT THAT CAN BE USED FOR THIS???
THANX IN ADVANCE
SINI
----------------------------------------------------------------------
|
|
|
|