Maaf pak yulius,
untuk select dbms_metadata.get_ddl('TABLE','NAMA_TABLE') from dual;
('TABEL,'NAMA_tabel) pengertiannya gimana, mohon penjelsannya...
Trimakasih
kang_toyib

2010/5/19 yulius_wibowo <[email protected]>

>
>
> Sekedar nambahin,
> Selain pakai CTAS (Create Table As Select) menggunakan WHERE 1=2,
> bisa juga diambil perintah DDL-nya (CREATE TABLE ...) menggunakan
> DBMS_METADATA.GET_DDL.
>
> Kalau pakai CTAS, constraint-nya tidak ikut dicopy (kecuali NOT NULL).
> Sedangkan kalau pakai DBMS_METADATA.GET_DDL info constraints (PK,FK,NN,U,C)
> akan digenerate juga.
>
> Contoh:
> SQL> set long 2000
> SQL> set pages 1000
> SQL> select dbms_metadata.get_ddl('TABLE','NAMA_TABLE') from dual;
> ...
>
> Bw
>
>
> --- In [email protected] <indo-oracle%40yahoogroups.com>,
> Antonius Bayu <bayu_9...@...> wrote:
> >
> > Sorry command createnya kelupaan
> > create table copy_barang as select * from barang where 1 = -1;
> >
> >
> >
> >
> >
> >
> > ________________________________
> > From: Antonius Bayu <bayu_9...@...>
>
> > To: [email protected] <indo-oracle%40yahoogroups.com>
> > Sent: Wed, May 19, 2010 8:04:05 AM
> > Subject: Re: [indo-oracle] membuat table dari tabel lain tanpa mengcopy
> datanya.
> >
> >
> > Select * from barang
> > where 1 = -1
> >
> > ________________________________
> > From: Aim <freak.luk...@...>
>
> > To: [email protected] <indo-oracle%40yahoogroups.com>
> > Sent: Tue, May 18, 2010 12:01:21 PM
> > Subject: [indo-oracle] membuat table dari tabel lain tanpa mengcopy
> datanya.
> >
> > Dear masters oracle.
> > saya mau tanya tentang oracle, maklum saya masih newbie.
> >
> > bagaimana membuat table yang merupakan copyan dari table lain tapi tidak
> mengambil data dari tabel yang dicopy.
> >
> > misal:
> >
> > SQL> select * from barang;
> >
> > KODE_BAR NAMA HARGA STOCK
> > -------- --------------- ---------- ----------
> > A-112 kaos 150000 15
> > A-113 baju 200000 15
> > A-114 tas 16000 15
> > A-115 sepatu 430000 15
> > A-116 kemeja 970000 15
> >
> > SQL> create table copy_barang as select * from barang;
> >
> > Table created.
> >
> > MAKA HASILNYA :
> >
> > SQL> select * from copy_barang;
> >
> > KODE_BAR NAMA HARGA STOCK
> > -------- --------------- ---------- ----------
> > A-112 kaos 150000 15
> > A-113 baju 200000 15
> > A-114 tas 16000 15
> > A-115 sepatu 430000 15
> > A-116 kemeja 970000 15
> >
> > yang saya ingin tanyakan, saya ingin membuat table baru yang dicopy dari
> tabel lain tetapi hanya columnnya saja TIDAK TERMASUK DML-NYA.
> > misAL:
> >
> > KODE_BAR NAMA HARGA STOCK
> > -------- --------------- ---------- ----------
> >
> > terima kasih
> > lukman
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>  
>


[Non-text portions of this message have been removed]



------------------------------------

--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [email protected]
Website: http://indooracle.wordpress.com
http://www.facebook.com/group.php?gid=51973053515
-----------------------------------------------

Bergabung dengan Indonesia Thin Client User Groups, 
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.blogspot.comYahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/indo-oracle/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/indo-oracle/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Kirim email ke