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.
I am attempting to call an Oracle procedure with multiple paramters, including 2 dates. The purpose of this procedure is to load a table from which I will produce a report. Before anyone asks, the proc is very complicated and already existed prior to my having to go this route. To redevelop in WebFOCUS would take a lot of cycles.
Anyway, I am using the following to connect:
ENGINE ORACLE SET CONNECTION_ATTRIBUTES ...
ENGINE ORACLE SET SERVER ...
ENGINE SQLORA
EX DBO.PROC_NAME '&FR_DATE', '&TO_DATE', 'Q2_2007'
;
END
where ... is the appropriate settings.
&FR_DATE and &TO_DATE are the date fields.
If the proc is run from within Oracle, the values of the two dates will look something like this:
01/01/2007 12:00:00 AM
....AND the proc works.
When attempting to run the proc from within WebFOCUS, my dates give me an error if I supply them with values OTHER THAN:
"01-01-2007"
The error I'm receiving is :
(FOC1400) SQLCODE IS 1843 (HEX: 00000733) : ORA-01843: not a valid month : ORA-06512: at line 1 L (FOC1405) SQL PREPARE ERROR.
The reason I ask this is that if I use the date format of 01-01-2007 the proc does functionally run. However, it doesn't do what it's supposed to do.
Has anyone encountered any trouble with issuing calls to Oracle procs using dates and have experienced any trouble similar to this?
Ken
Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE Databases: Oracle 10g, SQL Server 2000, DB2.
It sounds like you have a formatting problem. Is there some reason why you use '/' in one date and '-' in the other?
When you are passing date strings like '01/01/2007 12:00:00 AM' or '01-01-2007', they are not dates. To compare them with a date, the Oracle proc has to convert them using the TO_DATE function. Part of the function is format. It looks to me that your proc wants date and time (all Oracle dates are date and time, if no time is stored, the time is midnight, 00:00:00.000 or as you have 12:00:00 AM)
You need to examine the Oracle proc and insure the your parameters are in the correct format, that includes the '/' and '-'.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006
jg is right your problem is with Oracle not accepting the dates as dates. If you can't change the Oracle proc try passing the values as an alpha string. I think the syntax would be:
Oracle is like wf in that it will allow date string assignment/comparison provided the string is in the accepted form for the site default eg MM/DD/YYYY HH:MM:SS am in the US.
As others correctly point out if not in the accepted form then TO_DATE must be used.
Hence your behaviour.
I am guessing your behaviour is because you have
WHERE FR_DATE <= arg_fr_date in your proc
instead of
WHERE FR_DATE <= TO_DATE[arg_fr_date,'MM/DD/YYYY'); in your proc
The solutions are
1. Pass the date in the expected format. Use dm to manipulate the date into the sites format.
2. Pass the conversion as well as PBrightwell's quite ingenious solution is doing. I don't know if this will work because it depends on how the compile of the stored proc is carried out but it is worth a try.
Otherwise reformat the datestring you pass to your Oracle sites default.
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006