Try!
create or replace procedure P_test_t(v_day in char, v_time in char)
authid current_user
is
vn_cnt number(10);
begin
select count(*)
into vn_cnt
from user_all_tables a
where a.table_name like upper('ydzs_5min');
if vn_cnt > 0 then
execute immediate 'truncate table ydzs_5min';
end if;
execute immediate
'insert into YDZS_5MIN
(id,
vehiclenum0,
longitude,
latitude,
direction0,
speed0,
locationtime0)
select rownum,
vp_vehiclenum,
round(vp_longitude - 0.002472, 6),
round(vp_latitude + 0.002476, 6),
round(vp_direction),
round(vp_speed, 1),
vp_locationtime
from system.vehicle_position partition (to_date(' || v_day || ', ''yyyymmdd'')),
(select *
from system.wk_operationincome partition (to_date(' || v_day || ', ''yyyymmdd''))
where getofftime > getontime)
where vp_longitude != 0
and vp_latitude != 0
and vp_direction != 0
and vp_direction >= 0
and vp_direction <= 360
and vp_vehiclenum = vehiclenum
and vp_locationtime between getontime and getofftime
and vp_locationtime >= to_date(' || v_day || ' ' || v_time || ', ''yyyymmdd hh24:mi:ss'') - 2 / 1440
and vp_locationtime <= to_date(' || v_day || ' ' || v_time || ', ''yyyymmdd hh24:mi:ss'') - 1 / 1440';
commit;
end;