oracle动态存储过程错误100不够++急等
发布网友
发布时间:2023-03-17 05:03
我来回答
共3个回答
热心网友
时间:2023-04-21 18:40
declare
userid number;
str varchar2(50);
begin
select t2.hot_ntid hot_ntid
,t2.hot_ntseq hot_ntseq
,t2.hot_nttitle hot_nttitle
,t2.hot_crtuser hot_crtuser
,t2.hot_startdate hot_startdate
,t1.hot_rdid hot_rdid
,t2.hot_urlevel hot_urlevel
from hot_notice2users t1
,hot_notices t2
where t1.hot_ntid =t2.hot_ntid
and t1.hot_status = 0
and t2.hot_orgid = 0
and t2.HOT_URLEVEL = str
and t1.hot_readerid = userid;
end ;
语法上是这样的
但是你这样没有什么意义吧,没有输出呀,也没操作数据库,只是把数据查出来还没有显示呢
下面这样可以有输出,结果会显示在output页
declare
userid number;
str varchar2(50);
cursor c_cur is
select t2.hot_ntid hot_ntid
,t2.hot_ntseq hot_ntseq
,t2.hot_nttitle hot_nttitle
,t2.hot_crtuser hot_crtuser
,t2.hot_startdate hot_startdate
,t1.hot_rdid hot_rdid
,t2.hot_urlevel hot_urlevel
from hot_notice2users t1
,hot_notices t2
where t1.hot_ntid =t2.hot_ntid
and t1.hot_status = 0
and t2.hot_orgid = 0
and t2.HOT_URLEVEL = str
and t1.hot_readerid = userid;
begin
FOR c1 IN c_cur
LOOP
dbms_output.put_line(c1.hot_ntid);
dbms_output.put_line(c1.hot_ntseq);
dbms_output.put_line(c1.hot_nttitle);
dbms_output.put_line(c1.hot_crtuser);
dbms_output.put_line(c1.hot_startdate);
dbms_output.put_line(c1.hot_rdid);
dbms_output.put_line(c1.hot_urlevel);
end loop;
end ;
热心网友
时间:2023-04-21 18:40
很多错误,这个是sql server 弄过来的吧
热心网友
时间:2023-04-21 18:41
这是MS SQL的语法,需要转换为Oracle的语法。