列出指定表的所有字段
2012-06-07 17:31:06 来源:WEB开发网核心提示:/* 列出指定表的所有字段, 使用时将 SYS_TABLE 换成具体表名即可*/declare cursor c is select a.COLUMN_NAME||' ' from user_tab_columns a where a.TABLE_NAME = 'SYS_TABLE
/*
列出指定表的所有字段, 使用时将 SYS_TABLE 换成具体表名即可
*/
declare
cursor c is
select a.COLUMN_NAME||' ' from user_tab_columns a
where a.TABLE_NAME = 'SYS_TABLE';
col user_tab_columns.COLUMN_NAME%type;
cols varchar2(4000);
begin
open c;
loop
fetch c into col;
exit when c%notfound;
cols := cols || col;
end loop;
close c;
dbms_output.put_line(cols);
end;
更多精彩
赞助商链接
