**
Are you wanting to read and write to an (external to Remedy) Oracle table?  Here are 2 Oracle functions to convert between the Epoch number and Oracle's date (Requires Oracle database to be v9 or higher).  These can be used inside Remedy's direct SQL actions.
CREATE OR REPLACE FUNCTION From_Epoch(secs IN NUMBER)
  RETURN DATE
IS
  lDate DATE;
BEGIN
  lDate := (From_TZ((TO_DATE('01/01/1970', 'dd/mm/yyyy')+(secs/86400)),'GMT') AT TIME ZONE 'US/Central');
  RETURN lDate;
END From_Epoch;
/
 
CREATE OR REPLACE FUNCTION To_Epoch(lDate IN DATE)
   RETURN NUMBER
IS
   Seconds NUMBER;
   dte1 TIMESTAMP;
   dte2 TIMESTAMP;
BEGIN
   dte1 := new_time(lDate, to_char( from_tz(cast (lDate as timestamp), 'US/Central'),'TZD'),'GMT');
   dte2 := TO_TIMESTAMP_TZ('01/01/1970 '|| TZ_Offset('Greenwich'), 'MM/DD/YYYY TZH:TZM');
   Seconds := (((dte1-0) - (dte2-0)) * 86400);
   RETURN Seconds;
END To_Epoch;
/
NOTE:  My timezone is US/Central, please adjust for your own timezone.
 
Fred
 
 


From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Nicoll, Alan
Sent: Wednesday, July 12, 2006 6:21 PM
To: [email protected]
Subject: Is it possible to create and write an Oracle DATE type field from Remedy?

**

If so, how is it done?

 

Alan E (Nick) Nicoll

DocuSP Problem System Administrator

Xerox Corporation

Xerox Centre Drive, MS: ESC1-615

El Segundo, CA 90245

Phone 310 333-5081  Internal 8*823-5081

Fax 310 333-6898

[EMAIL PROTECTED]

 

XEROX

Technology   Document Management   Consulting Services

 

www.xerox.com

 

  

__20060125_______________________This posting was submitted with HTML in it___

Reply via email to