Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

AmZone

A m Z o n e


char(0) and varchar2(0)

Can a table or a view be created with a column as varchar2(0) or char(0)?



Not possible in a table, afaik. Possible in a view. check the following:


create or replace view amvariable_vw as select col1, col2, decode(col1, 1, '', 2, '') col3 from am01; -- col3 is created as varchar2(0)! create or replace view amvariable1_vw as select col1, col2, '' col3 from am01; -- col3 is created as char(0)!

You may use other functions also to create zero data length columns. There are some dictionary views with columns as Varchar2(0) or char(0). So don't get baffled.
E.g.: TABLE_PRIVILEGES, COLUMN_PRIVILEGES


Press the Back button of you Browser to go to previous page
Home