select * from dba_tables where table_name=upper('your_table_name');
老大`不是查询语句```是一个存储过程 比如SQL的是 create proc pro_show as select * from titles go 换成oracle怎么写啊?
create or replace procedure select_table is cursor select_table_cur is select table_name,owner,tablespace_name from all_tables where table_name=upper('your_table_name'); v_tablename varchar2(20); v_owner varchar2(20); v_tablespacename varchar2(20); begin open select_table_cur; loop fetch select_table_cur into v_tablename,v_owner,v_tablespacename; exit when select_table_cur%NOTFOUND; dbms_output.put_line('The tables info :'''||v_tablename||','||v_owner||','||v_tablespacename||''''); end loop; close select_table_cur; return; end select_table; 替换你的表名字即可,需要所有的,可以把where条件去掉
SQL> set serveroutput on SQL> execute select_table; 即可有结果了___________________ The tables info :'TAB$,SYS,SYSTEM' The tables info :'USER$,SYS,SYSTEM' The tables info :'BOOTSTRAP$,SYS,SYSTEM' The tables info :'UNDO$,SYS,SYSTEM'按照 表名,owner,表空间 列出
比如SQL的是
create proc pro_show
as
select * from titles
go
换成oracle怎么写啊?
cursor select_table_cur is
select table_name,owner,tablespace_name from all_tables where table_name=upper('your_table_name');
v_tablename varchar2(20);
v_owner varchar2(20);
v_tablespacename varchar2(20);
begin
open select_table_cur;
loop
fetch select_table_cur into v_tablename,v_owner,v_tablespacename;
exit when select_table_cur%NOTFOUND;
dbms_output.put_line('The tables info :'''||v_tablename||','||v_owner||','||v_tablespacename||'''');
end loop;
close select_table_cur;
return;
end select_table;
替换你的表名字即可,需要所有的,可以把where条件去掉
SQL> execute select_table;
即可有结果了___________________
The tables info :'TAB$,SYS,SYSTEM'
The tables info :'USER$,SYS,SYSTEM'
The tables info :'BOOTSTRAP$,SYS,SYSTEM'
The tables info :'UNDO$,SYS,SYSTEM'按照 表名,owner,表空间 列出