Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Question with INTO clause of SQLPLUS
I want to read sysdate into a bind variable.
First since I want the time in minutes I
alter session set nls_date_format ='mi'; Second set bind variable
variable time number;
There isn't a date variable. I also tried varchar2
Third
select sysdate into :time from dual;
OUTPUT
SYSDATE --------- 10-APR-99
When I execute print time I get.
OUTPUT
TIME ----------
select sysdate into time: from dual;
Produces
select sysdate into time: from dual * ERROR at line 1: ORA-00905: missing keyword
I am thinking because there isn't a date bind variable, I must have to convert the date to number. If that is true then I will have to have a start date and end date both in minutes then subtract the two.
My goal is to use the time variable as a start time and then at some
later time
execute
select sysdate-time into elapsed_time: from dual. If the elapsed_time is greater than five minutes then I want to send mail to the DBA's warning ofa possible process that needs tuning.
--
Joseph P. Condle Jr.
Senior Systems Engineer
condle_at_mars-systems.com
Medical ARchival Systems, Inc. (MARS)
3500 Victoria Street Pgh. Pa. 15261 USA
Office 412-383-1379
Fax 412-647-9661
Received on Sat Apr 10 1999 - 08:38:27 CDT