--用户信息set serveroutput on;declare
count_var number(10,0);beginselectcount(*)into count_var from tb_user t where input_date=to_char(sysdate,'yyyymmdd');if count_var <=0theninsertinto tb_user
(select to_char(sysdate,'yyyymmdd') input_date,
user_code,
user_name
from tb_user a
where a.input_date ='20220807');insertinto tb_user_detail
(select to_char(sysdate,'yyyymmdd') input_date,
user_code,
user_desc
from tb_user_detail a
where a.input_date ='20220807');commit;else
dbms_output.put_line(chr(10)||'==>> :'||count_var);endif;end;/
quit;
::@echo off
cls
cd /d "D:\workspace\bat_script
SET today=%date:~0,10%
CALL:main >> D:\workspace\bat_script\logs\%today%.log
:main
SET right_now=%today%_%time:~0,2%:%time:~3,2%:%time:~6,2%
SET right_now=%right_now: =0%
echo============================[%right_now%]===========================
sqlplus root/123456@127.0.0.1:1521/orcl @D:\workspace\bat_script\insert_new_user.sql
echo.
echo============================# end [%right_now%] end #===========================
echo.
:end