Oracle中游标2种
1
DECLARE
CURSOR c1 IS
SELECT empno, ename, job FROM emp WHERE ...;
2
select aaa into cursor from ...
你可以写触发器或是写个过程 每天调用就可以了
1
DECLARE
CURSOR c1 IS
SELECT empno, ename, job FROM emp WHERE ...;
2
select aaa into cursor from ...
你可以写触发器或是写个过程 每天调用就可以了
-->Easily open any Oracle PL/SQL book , you can find the way to declare it ,open it , fetch it etc.还有oracle中有没有调度的功能(象Sql Server中那样),因为我想在一天某个时间创建一个表,怎么创建?谢谢
--->DBMS_JOB will help you
cursor t_sor2 is
select * from table_name; --游标集
2、用dbms_job
create procedure pro
as
str varchar2(50);
begin
str:='create table table_name (a varchar2(10))';
execute immediate str;
commit;
end;
/declare
jobno number;
begin
dbms_job.submit(jobno,'pro;',sysdate,'sysdate+1/(24*60)');
commit;
end;
/
cursor cc is select * from tablea;
cstr cc%rowtype;
使用在begin end段中
open cc;
loop
fetch cc into cstr;
exit when cc%notfound;
各种操作;
end loop;
close cc;