Oracle一些基本操作

查看表以及列: 

Select * From all_tables where  owner = 'userName'
---注意,这里需要区分大小写!

 

select * 
from user_tab_columns 
where Table_Name='表名注意大小写' 
order by column_name 
--查看当前用户下的某个表的列

select * 
from all_tab_columns 
where Table_Name='表名注意大小写' 
order by column_name 
--查看当前用户有权限看的所有的表的下的某个表的列

 打印Oracle中的数据

 

DECLARE maxvalue number DEFAULT 0;
BEGIN 
select max(C_TIMESTAMP)+2 into maxvalue from EMFUND.Tb_Queryinfo ;
dbms_output.put_line(maxvalue);
END;

 

declare
type my_emp is table of EMFUND.TB_QUERYINFO%rowtype  INDEX BY BINARY_INTEGER;
new_emp my_emp;
v_num number:=0;
cursor cur_emp is select * from EMFUND.TB_QUERYINFO Where Rownum <=10;
begin
for v_emp in cur_emp loop
v_num:=v_num+1;
select * into new_emp(v_num) from EMFUND.TB_QUERYINFO
where C_ID=v_emp.C_ID;
end loop;
for i in 1..new_emp.count loop
dbms_output.put_line(new_emp(i).C_ID);
end loop;
end; 

--bulk collect 

 

 

http://www.cnblogs.com/emanlee/archive/2011/12/02/2272629.html

posted on 2015-03-19 15:09  Anthony.Zhao  阅读(220)  评论(0编辑  收藏  举报