Created
August 24, 2023 23:07
-
-
Save jeremyyeo/a4bfcf1e2d1a0bf58c4422bfe038d426 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PROCEDURE dbt_jyeo.fake_sleep(seconds INT64) | |
BEGIN | |
DECLARE wait BOOL DEFAULT TRUE; | |
DECLARE delay_time DATETIME DEFAULT DATETIME_ADD(CURRENT_DATETIME, INTERVAL seconds SECOND); | |
WHILE wait DO | |
IF (delay_time < CURRENT_DATETIME) THEN | |
SET wait = FALSE; | |
END IF; | |
END WHILE; | |
SELECT 'Slept for ' || seconds || ' seconds'; | |
END; | |
call dbt_jyeo.fake_sleep(60); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment