Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Call To Oracle Get a Date and pass in a YYYYMMDD format to do comparisons

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Call To Oracle Get a Date and pass in a YYYYMMDD format to do comparisons
 Login/Join
 
Gold member
posted
Hi,
We have a WebFocus procedure that is called by a Java app so the procedure resides on the data server and is not executed from Managed Reporting Environment.
I want to make a call to Oracle and get the date back. Then I want to convert it to a YYYYMMDD format so that I can compare another date with it e.g. IF database_date GT 20160501 THEN ...
What is it in my code that I need to fix to do that?
Thanks in advance.

SET SQLENGINE=SQLORA
SQL SET SERVER RUS_SIMSREAD
SQL
Select to_number(to_char(item_date_value, 'yyyymmdd')) AS TMPDATE from business_reference_item where reference_subtype = 'BILL_31_SIMS_PROCLAMATION_DATE';
;
TABLE ON TABLE HOLD AS PROCDATE FORMAT ALPHA
END
-RUN
-*
TABLE FILE PROCDATE
PRINT TMPDATE
TABLE ON TABLE HOLD AS SAVEDATE
END
-RUN
-*
-READ SAVEDATE NOCLOSE &TMPDATE.A13.
-SET &VAR_DATE_CHAR = &TMPDATE;
-TYPE &VAR_DATE_CHAR;
-RUN
-EXIT

This message has been edited. Last edited by: <Emily McAllister>,


WF V7.7.03
Platform: AIX 6.1 64-bit, WinXP, IE 8.0
Output Formats: Html, Pdf, Excel
 
Posts: 71 | Registered: October 16, 2006Report This Post
Master
posted Hide Post
Adrian,

For starters I would use the to_date function instead of to_number.

 
Select to_date(item_date_value, 'yyyymmdd')) AS TMPDATE from business_reference_item where reference_subtype = 'BILL_31_SIMS_PROCLAMATION_DATE'; 


This is assuming that it isn't already a date to begin with. I see that you are reading it to an amper variable. What value are you getting for the amper variable now? Maybe all you need is to do an EDIT('some value','9999$99$99') on your output?


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Master
posted Hide Post
Are you trying to do something like this?

 

ENGINE SQLORA SET DEFAULT_CONNECTION [Your Connection]
SQL SQLORA PREPARE SQLOUT FOR
select to_date('20160826','yyyymmdd') AS MY_DATE from DUAL
END

TABLE FILE SQLOUT
PRINT MY_DATE
ON TABLE SAVE AS DATETESTING
END
-RUN 

-READ DATETESTING &MYDT.A13
-SET &MYDT = EDIT('&MYDT.EVAL','99999999');
-TYPE &MYDT
-EXIT
 


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Virtuoso
posted Hide Post
At the very least, you have a typo here:
quote:
TABLE FILE PROCDATE
PRINT TMPDATE
TABLE ON TABLE HOLD AS SAVEDATE
^^^^^
END


Another issue is that the date gets returned from oracle as a float: 20160501.00

What works here is:
SQL SQLORA PREPARE PROCDATE FOR
Select to_number(to_char(CURRENT_DATE, 'yyyymmdd')) AS TMPDATE from dual
;
END
-RUN

SET HOLDLIST = PRINTONLY

TABLE FILE PROCDATE
PRINT COMPUTE TMPDATE1/I8 = TMPDATE;
ON TABLE HOLD AS SAVEDATE FORMAT ALPHA
END
-RUN

-SET &TMPDATE = '';
-READ SAVEDATE &TMPDATE.A8.
-SET &VAR_DATE_CHAR = &TMPDATE;
-TYPE &VAR_DATE_CHAR;
-RUN
-EXIT


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Call To Oracle Get a Date and pass in a YYYYMMDD format to do comparisons

Copyright © 1996-2020 Information Builders