♣
100 分。。错误的过程?谁帮我看看?
一个错误的过程?谁帮我看下?我怎么也调不对??要死了??
create or replace procedure showfetetime (tvids int,nextfetetime out date)
as
times date;
nowfetename varchar(50);
nexttime date;
nextfetename varchar(50);
todayminfetetime date;
todaymaxfetetime date;
startcount number;
endcount number;
begin
select min(starttime) into todayminfetetime from fete
where tvid = tvids and substr(starttime,1,4) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),1,4) and substr(starttime,6,2) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),6,2) and substr(starttime,9,2) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),9,2);
dbms_output.put_line(todayminfetetime);
select max(starttime) into todaymaxfetetime from fete
where tvid = tvids and substr(starttime,1,4) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),1,4) and substr(starttime,6,2) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),6,2) and substr(starttime,9,2) = substr(to_char(sysdate,yyyy-mm-dd hh24:mi:ss),9,2);
dbms_output.put_line(todaymaxfetetime);
select count(*) into startcount from fete --
where starttime=(select max(starttime) from fete where tvid = tvids and starttime<sysdate and starttime >=todayminfetetime );
dbms_output.put_line(startcount);
select count(*) into endcount from fete where starttime = (select min(starttime) from fete where tvid = tvids and starttime>sysdate and starttime <= todaymaxfetetime);
dbms_output.put_line(endcount);
if startcount = 0 and endcount = 0 then
update onlinefete
set nowfetetime = null, nowfete = null,
nexttime = null, nextfete = null
where tvid = tvids;
nextfetetime := null;
end if;
if startcount = 0 then--表示是今天的第一个节目
update onlinefete
set nowfetetime = 0, nowfete = 0
where tvid = tvids;
select starttime , contents into nexttime, nextfetename from fete
where tvid = tvids and starttime =
(
select min(starttime) from fete
where starttime>sysdate and tvid = tvids
);
update onlinefete
set nexttime = nexttime, nextfete = nextfetename
where tvid = tvids;
select min(starttime) into nextfetetime from fete where starttime>sysdate and tvid = tvids;
end if;
if endcount = 0 then
select starttime , contents into times,nowfetename from fete
where tvid = tvids and starttime =
(select max(starttime) from fete
where starttime<sysdate and tvid = tvids );
update onlinefete
set nowfetetime = times, nowfete = nowfetename
where tvid = tvids;
update onlinefete
set nexttime = 0, nextfete = 0
where tvid = tvids ;
select min(starttime) into from nextfetetime fete where starttime>sysdate and tvid = tvids;
end if;
if startcount != 0 and endcount != 0
select starttime ,contents into times , nowfetename from fete
where tvid = tvids and starttime =
(select max(starttime) from fete
where starttime<sysdate and tvid = tvids );
select starttime,contents into nexttime, nextfetename from fete
where tvid = tvids and starttime =
(
select min(starttime) from fete
where starttime>sysdate and tvid = tvids
);
update onlinefete
set nowfetetime = times, nowfete = nowfetename,
nexttime = nexttime, nextfete = nextfetename
where tvid = tvids;
select min(starttime) into nextfetetime from fete where starttime>sysdate and tvid = tvids;
end if;
end ;
谢谢?
· 网友精彩回答:
- 更多问题:
- · 急!!!有哪位大哥教我如何实现JPEG2000的ROI编码啊
- · 关于新闻搜索的网站,望大家多多指教
- · 怎么向oracle数据库中添加大于4000字节的数据?
- · 今天搭车回家,公车上碰到两个成熟美少妇一起,坐我旁边,有说有笑,好诱惑啊,身材真好,唉.....两个都167高的样子
- · 应用程序
- · 关于数据输入的问题~~~高手指点一下
- · access数据库批量放库只能写入13条?
- · 关于多线程的问题 急!在线等 !!
- · 比较难实现的SQL语句,高手帮忙啊!
- · 在web控件datagrid里面怎么样才能对表格进行编辑。加入文本框textbox控件如何加入!
- · 大家感到痛心的话就多转发几个地方,这在东莞白天发生的抢劫....
- · VB 中怎么把JPG文件转化成BMP文件
- · 想装一台电脑,5000块左右,谁能给个建议啊?谢谢
- · 做数据库管理员是否适合自学?
- · 小第有个问题要发问???
- · 郁闷,心烦,不能静心学习!求救!
- · ejb技术文档
- · struts技术文档 | struts
- · WebLogic专题
- · WebSphere专题
- · Eclipse函数 | Eclipse
- · 多媒体技术
- · ntfs文件
- · 入侵xp
- · 改mac
- · dns查询
- · ip mac
- · 打开pdf
- · borland 分家
- · 修改bios
- · 后门端口
- · 亿域
- · flash特效软件
- · flash.ocx删不了?
- · 如何制作flash
- · 在vc6.0 or .net里面使用ado功能
- · auto病毒
- · 如何升级瑞星病毒库
- · 卡巴斯基最新病毒库更新地址
- · 卡巴斯基病毒库更新

