Created
January 5, 2016 13:24
-
-
Save Jviejo/8aa24050aabdfcdd84b9 to your computer and use it in GitHub Desktop.
genera type from user_tables oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'type ' || table_name || '_T is | |
record (' || chr(13) || listagg(column_name || ' ' || | |
table_name ||'.'||column_name || '%type',','||chr(13)) | |
within group (order by column_id) | |
|| '); ' || CHR(13) || | |
'type '||TABLE_NAME||'_T_C is table of '||TABLE_NAME||'_T;' || CHR(13) || | |
'T '||TABLE_NAME|| '_T_C;' | |
from user_tab_columns | |
where table_name = '<PONER EL NOMBRE DE LA TABLA>' | |
group by table_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment