PROCEDURE Sp_auto_hour
Is
V_time VARCHAR2 (10);
V_time1 VARCHAR2 (10);
Begin
Select To_char (sysdate-1/24, ' yyyymmddhh24 ') into the v_time from dual;
Select To_char (sysdate, ' yyyymmddhh24 ') into the v_time1 from dual;
INSERT INTO Test select * from Test1 where to_char (time, ' yyyymmddhh24 ') between V_time and v_time1;
Commit
End
You do not have to consider the 0 point of the problem, has been counted, you can try it, you can manually execute
Ask:
This is my SQL statement according to your written change, you see where is not good to help me change
SELECT * FROM table where time between To_date (To_char (sysdate-1/24, ' yyyymmddhh24 '), ' yyyymmddhh24 ') and to_date (to _char (sysdate, ' yyyymmddhh24 '), ' yyyymmddhh24 ');
Chase Answer:
Grammar should not be wrong, do not change, you perform a check the data on the line
Oracle Acquisition Timing time period