How can I read a variable runtime in a stored proc? [message #650818] |
Wed, 04 May 2016 07:46 |
|
gouravhere
Messages: 1 Registered: May 2016
|
Junior Member |
|
|
CREATE OR REPLACE PROCEDURE SLEEPTEST3
IS
start_dts DATE := SYSDATE;
curr_dts DATE;
I NUMBER := 0;
VAL CHAR(1);
BEGIN
LOOP I := I + 1;
curr_dts := sysdate;
DBMS_OUTPUT.PUT_LINE('PLEASE TYPE Y TO EXIT');
VAL := &VAL; #this particular line is throwing an error [Error] PLS-00103 (13: 15): PLS-00103: Encountered the symbol ";" when expecting one #of the following: ( - + case mod new not null <an identifier>
# <a double-quoted delimited-identifier> <a bind variable>
# continue avg c
EXIT WHEN curr_dts > start_dts + 0.25/(24*60) AND VAL = 'Y';
END LOOP;
DBMS_OUTPUT.PUT_LINE('start '||start_dts||', '||curr_dts
||' cnt='||to_char(I,'999,999,999'));
END;
END;
/
Here I am trying to sleep for 15 seconds and asking for an input. It sleeps until it gets 'Y' as an input.
[mod-edit: code tags added by bb; next time please add them yourself]
[Updated on: Wed, 04 May 2016 14:37] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|