Home » RDBMS Server » Server Administration » Re: DATE type and milliseconds
Re: DATE type and milliseconds [message #374298] Mon, 04 June 2001 19:27
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
No, the date datatype does not support anything less than seconds and the date&time format picture doesn't either. You need to append your own millisecond value to the end of the string representation. To store it in Oracle you need to keep it as a string. If you keep the format in descending order (yyyy mm dd hh24 mi ss ttt) then string comparisons and string sorts work correctly.

-- Hundredths of a second...
set serveroutput on
DECLARE
timing PLS_INTEGER;
x PLS_INTEGER;
BEGIN
timing := DBMS_UTILITY.get_time;

FOR i IN 1 .. 100000
LOOP
x := i;
END LOOP;

DBMS_OUTPUT.put_line ('hundredths of a sec = ' || TO_CHAR (DBMS_UTILITY.get_time - timing) );
END;
/

Milliseconds...
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:341817437103
Previous Topic: WHERE clause with multiple LIKE values
Next Topic: Using parameter variables in a "IN" statement
Goto Forum:
  


Current Time: Mon Dec 23 13:08:47 CST 2024