begin atomic
if (DAYOFWEEK (Current Timestamp)=2) then
insert into HELLO values ('Hello Monday');
elseif (DAYOFWEEK (Current Timestamp)=6) then
insert into HELLO values ('Hello Friday');
else
SIGNAL SQLSTATE '80000'
SET MESSAGE_TEXT='Script is for MON & FRI only!';
end if;
end@
!echo Retrieving from HELLO table..@
SELECT * FROM HELLO@
!echo Cleaning up...@
DROP TABLE HELLO@
!echo This message will get written to screen, but not to the log file@
VALUES ' This message will get written to the screen AND log file'@
添加新评论0 条评论