在plsql过程中声明日期并获取错误

时间:2017-05-22 08:23:08

标签: oracle plsql

我不知道select语句中的错误是什么....

create or replace procedure sampl_proc 
is
startdate DATE;
begin
select tick_date into startdate from utv.tick where tick_date= ('16/05/2017 09:00:09' , 'yyyy/mm/dd hh24:mi:ss');
dbms_output.put_line(startdate);
end;

,错误是:[Error] ORA-01797 (5: 62): PL/SQL: ORA-01797: this operator must be followed by ANY or ALL

1 个答案:

答案 0 :(得分:2)

试试这个(to_date func)

 create or replace procedure sampl_proc 
is
startdate DATE;
begin
select tick_date into startdate from utv.tick where tick_date= to_date('16/05/2017 09:00:09' , 'yyyy/mm/dd hh24:mi:ss');
dbms_output.put_line(startdate);
end;