Focal Point
[CLOSED] Current Timestamp in Oracle format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3967052886

November 07, 2017, 02:23 AM
Aster
[CLOSED] Current Timestamp in Oracle format
Hi,
I want to set the value of &NOW to the current time stamp in Oracle format
(like 17-MAY-13 10.03.05.000000000 PM).
Please help.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 7.7.03/05
Windows, All Outputs
November 07, 2017, 05:05 AM
Wep5622
That strongly depends on your NLS settings in Oracle. The most reliable method of obtaining that information is querying it from Oracle.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
November 07, 2017, 02:25 PM
BabakNYC
How do you plan to use &NOW? Is this for a WHERE test?

If you're trying to format a date/time there are a lot of ways to mask them for display. Here's an example in DEFINE and TABLE.
 DEFINE FILE CAR
ORAC_NOW/HYYMD-sB WITH COUNTRY = DT_CURRENT_DATETIME(MICROSECOND);
END
TABLE FILE CAR
PRINT CAR ORAC_NOW
BY COUNTRY
END 

This message has been edited. Last edited by: BabakNYC,


WebFOCUS 8206, Unix, Windows
November 09, 2017, 11:30 AM
FP Mod Chuck
Hi Aster

Welcome to Focal Point. This is a great resource for getting answers to your development questions.

I agree with Web5622 that getting this info directly from Oracle would be the easiest because the internal data functions with WebFOCUS do not format them to be Oracle specific. I found this link that tells how to do this with Oracle. https://docs.oracle.com/cd/B19...200/functions037.htm Once you have this value you can set &NOW to that value. I am assuming you want to use SQL passthru for a query back to Oracle after you have it..


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats