Re: SQL for retrieving default value of a table
From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: 2000/02/16
Message-ID: <88d671$g8s$1_at_nnrp1.deja.com>#1/1
| cost_code VARCHAR2 10 N
| cost_desc VARCHAR2 50 Y
| created_by VARCHAR2 30 Y USER
| creation_date DATE 7 Y SYSDATE
| modified_by VARCHAR2 30 Y USER
| modification_date DATE 7 Y SYSDATE
| times_modified NUMBER 9 0 Y 0
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
Date: 2000/02/16
Message-ID: <88d671$g8s$1_at_nnrp1.deja.com>#1/1
Default values for columns are stored in the DATA_DEFAULT column of USER_TAB_COLUMNS (and dba_tab_columns, all_tab_columns).
My freeware utility SQL PlusPlus contains a LSTTCL command which is basically a replacement for SQL*Plus DESCRIBE command. It not only lists data default values, it also shows table and column comments. For example:
SQL> exec s.lsttcl('gl_costs')
|
| TABLE: gl_costs
| COMM:
|
| COLUMN NAME TYPE SIZE DEC N DEFAULT
COMMENT
| ------------------------------ ---------- ---- --- - --------------- -
| cost_code VARCHAR2 10 N
| cost_desc VARCHAR2 50 Y
| created_by VARCHAR2 30 Y USER
| creation_date DATE 7 Y SYSDATE
| modified_by VARCHAR2 30 Y USER
| modification_date DATE 7 Y SYSDATE
| times_modified NUMBER 9 0 Y 0
regards,
M. Armaghan Saqib
+---------------------------------------------------------------| 2. SQL Link for XL => Integrate Oracle with XL
| 1. SQL PlusPlus => Add power to SQL Plus command line
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
+---------------------------------------------------------------Harmony Wong <harmony_wong_at_hongkong.com> wrote in message news:88bpk6 $epf$1_at_news.hk.linkage.net...
> Hi, > > Does anyone know the sql of this? > > Regards, > Harmony
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Feb 16 2000 - 00:00:00 CET