sql - Selecting a column from table including the default value -


i wonder if can have query gives me values of column including default value column. doable?

i dont want use union or joins.

for example, have table emp

create table emp  (emp_name varchar2(20) default 'xxx'); 

and

insert emp(emp_name) values('a'); insert emp(emp_name) values('b'); 

and when query like

select emp_name emp; 

i want result

a b xxx 

business logic: table emp master table list of employees. in ui screen have oraganization task eg: org_task have ui screen 2 columns, task_name, assinged_employee , assined_employee column not nullable various other reasons.

so, when want create new task, enter task, description in column , need choose employee drop down in assined_employee column.

in case if task cannot assigned @ point of time of employees, want drop down have default value called tbd.

the source dropdown query selects employee names emp table. want append tbd values in dropdown

it's not possible using simple select statement. can take records exist in table.

you looking like:

select emp_name emp union select data_default all_tab_columns  table_name = 'emp' , column_name = 'emp_name'; 

but have find way convert long type varchar.

it's not i've thought. it's problem ask new question on think.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -