Oracle中begin end问题

岁岁年年 2012-04-27 12:18:52
Oracle中执行一个dbms_job包,以下四个写法:
begin
dbms_job.run(44);
end; ----这样正常运行

dbms_job.run(44); ----这样会报错

begin
execute dbms_job.run(44);
end; ----这样会报错

execute dbms_job.run(44); ----这样正常运行


综上所述,请问,begin ....end在Oracle中除了区分程序块,是否还有其他功能,可替代execute?
...全文
1317 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ssqtjffcu 2012-04-27
  • 打赏
  • 举报
回复
and t2.gidl_doc_numb like % '414%'改成and t2.gidl_doc_numb like '%414%'
这么明显的错误,相信整条语句不可能上你写了来的。。
d604060189 2012-04-27
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

select count(1) as totalrow
from (select t2.onenum,
t2.allnum,
t2.printstatus,
t.apfd_code,
t2.gidl_doc_numb,
t2.orgid,
t.bdgt_subj,
t3.subjectcode,
t3.subjectname……
[/Quote]
倒数第二行的 % '414%' 修改为
’%414%‘
wxdfire 2012-04-27
  • 打赏
  • 举报
回复
select count(1) as totalrow
from (select t2.onenum,
t2.allnum,
t2.printstatus,
t.apfd_code,
t2.gidl_doc_numb,
t2.orgid,
t.bdgt_subj,
t3.subjectcode,
t3.subjectname,
case
when t.acst_id not in
(887209, 2001, 3001, 4001, 5001, 7001, 8001, 6066768) then
decode(t2.fund_char,
'0',
'预算内',
'1',
'其他财政性资金',
'2',
'其他',
'3',
'预算内(往年)',
'4',
'其他财政性资金(往年)',
'5',
'其他(往年)')
else
'其他'
end as fund_char,
t2.pay_amnt,
t2.dtal_id,
t2.item,
t4.name,
t.gath_org_name,
t2.smry smry,
t.acst_id
from ga_t_apfd_bill t,
sysmgr_org t1,
ga_t_apfd_bill_dtal t2,
busmgr_funnew t3,
sysmgr_user t4
where 1 = 1
and t.gath_org_id = t1.orgid(+)
and t.bdgt_subj = t3.subjectcode(+)
and t.apfd_user_id = t4.userid(+)
and t2.apfd_bill_id = t.apfd_bill_id
and t.year = 2012
and t3.year = 2012
and t.ACST_ID = 1001
and t.is_Del = 0
and t.status in ('4', '5')
and t2.gidl_doc_numb like % '414%'
order by t1.orgcode, t.bdgt_subj, to_number(t.APFD_CODE))

这段哪儿错了??
SignLCF 2012-04-27
  • 打赏
  • 举报
回复
execute 是调用oracle的系统包,过程或函数等,在执行时就是以begin..end开始和结束的。
Oracle的pl/sql块都至少有一个begin...end来表示完整块,在begin...end中可以自定义一些函数,存储过程和包等,这些自定义代码由begin开始执行,其所对应的end结束。
forgetsam 2012-04-27
  • 打赏
  • 举报
回复
begin end;是匿名块 是在 PL-SQL环境中运行的

execute是命令 可以被外界调用。

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧