简单使用 oracle定义变量

DECLARE
startTime Date;
entTime Date;
countN number(8);
BEGIN

startTime := to_Date('2012-4-1 00-00-00','yyyy-MM-dd hh24:mi:ss');
entTime := to_Date('2013-4-2 23-59-59','yyyy-MM-dd hh24:mi:ss');

Select count(*) into countN
from  JOB
where updatetime > startTime
and updatetime < entTime;

dbms_output.put_line(countN);
END;

必须使用into 把值赋给游标,countN

posted on 2013-04-02 11:35  宋时明月  阅读(191)  评论(0编辑  收藏  举报

导航