Use char function to build default column value : Column Default Value « Table « Oracle PL / SQL






Use char function to build default column value

    

SQL>
SQL> create table t
  2  ( a int,
  3    b varchar2(4000) default rpad('*',4000,'*'),
  4    c varchar2(3000) default rpad('*',3000,'*')
  5  )
  6  /

Table created.

SQL> insert into t (a) values ( 1);

1 row created.

SQL> insert into t (a) values ( 2);

1 row created.

SQL> insert into t (a) values ( 3);

1 row created.

SQL>
SQL> delete from t where a = 2 ;

1 row deleted.

SQL>
SQL> insert into t (a) values ( 4);

1 row created.


SQL> drop table t;

Table dropped.

SQL>

   
    
    
    
  








Related examples in the same category

1.Override the defaults by specifying a value for the columns
2.Create table with column having the default value
3.column with default as sysdate
4.Use rpad to fill default value to a column
5.null with default value column
6.Default char value
7.Default varchar value