function that return data type that can be used in SQL(oracle) -


for example using oracle sql:

select rpad(salary, 10 , '*') employees; 

at "10" part, wish can use function directly return byte of data type. tried

select rpad(salary, salary, '*') employees; 

and result scary.

is there way it, or have create function in plsql?

you can fill max length of data in column in whole table using below:

  select rpad( salary,         max(length(salary)) on (partition (select null dual)),         '*')      employees 

or full possible size using data_length in user_tab_columns table

select rpad( salary,        (select data_length user_tab_columns          table_name = 'employees' ,          column_name = 'salary' ),       '*')  employees 

Comments