Wednesday, September 7, 2022

Query to get Date Difference in Seconds in Oracle

DECLARE
    l_start_time   date;
l_end_time     date;
        l_date_difference    NUMBER;
BEGIN
    SELECT SYSDATE 
  INTO l_start_time 
  FROM DUAL;
fnd_file.put_line(fnd_file.log,'Program Start Time  :'||  TO_CHAR(SYSDATE,'HH24:MI:SS'));
    dbms_output.put_line('Program Start Time  :'||  TO_CHAR(SYSDATE,'HH24:MI:SS'));
   
WHILE l_Start_time IS NOT NULL
LOOP
SELECT SYSDATE 
  INTO l_end_time 
  FROM DUAL;
                l_date_difference := l_end_time - l_start_time;
    EXIT WHEN (l_date_difference)*24*60*60 = 180;
END LOOP;
fnd_file.put_line(fnd_file.log,'Program End Time     :'||  TO_CHAR(SYSDATE,'HH24:MI:SS'));
dbms_output.put_line('Program End Time  :'||  TO_CHAR(SYSDATE,'HH24:MI:SS'));
END;



Here control will be released after 180 seconds.

No comments:

Post a Comment

SupplierAddressImportTemplate.xlsm South Africa Suburb Field mapping in POZ_SUPPLIER_ADDRESSES_INT

Suburb mpping in Supplier Address Import Template will be mapped to Address Element Attribute2 (HZ_LOCATIONS. ADDR_ELEMENT_ATTRIBUTE2)