Vijay,
From 815 and up try this...
1. write a java class.
2. write a fxn in oracle
here's the code...
It's also possible to do in 8.0.Code:SQL*Plus: Release 8.1.6.0.0 - Production on Mon Aug 26 16:20:09 2002 (c) Copyright 1999 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production [email protected]>create or replace JAVA SOURCE 2 NAMED "MyTimeStamp" 3 AS 4 import java.lang.String; 5 import java.sql.Timestamp; 6 7 8 public class MyTimeStamp 9 { 10 public static String getTimestamp() 11 { 12 return (new Timestamp(System.currentTimeMillis())).toString(); 13 } 14 }; 15 / Java created. [email protected]>create or replace function my_timestamp return varchar2 2 AS LANGUAGE JAVA 3 NAME 'MyTimeStamp.getTimestamp() return java.lang.String'; 4 / Function created. [email protected]>col my_timestamp format a25 [email protected]>col normal format a25 [email protected]>select my_timestamp, to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') normal 2 from dual; MY_TIMESTAMP NORMAL ------------------------- ------------------------- 2002-08-26 16:42:37.226 2002-08-26 16:42:37
Cheers!!!
Tarry





Reply With Quote