Skip to content

Instantly share code, notes, and snippets.

@tinwritescode
Last active March 7, 2022 04:26
Show Gist options
  • Select an option

  • Save tinwritescode/6b289918965957abff31cbf5950f9b8a to your computer and use it in GitHub Desktop.

Select an option

Save tinwritescode/6b289918965957abff31cbf5950f9b8a to your computer and use it in GitHub Desktop.
create procedure sp_cautrucbangemp_19127582 is
-- data types
cursor c_emp is
select column_name, data_type from ALL_TAB_COLS where table_name = 'EMP_19127582';
type ROW_TYPE is record(column_name ALL_TAB_COLS.column_name%type, data_type ALL_TAB_COLS.data_type%type);
-- declare variables
result ROW_TYPE;
begin
dbms_output.put_line('Table: EMP_19127582');
open c_emp;
loop
fetch c_emp into result;
dbms_output.put_line(result.column_name || ' ' || result.data_type);
exit when c_emp%notfound;
end loop;
close c_emp;
end;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment