Error while using xdofx calculations in xdoxslt function

Advertisement
Hi All,
I have a requirement to subtract two dates in the rtf and display the difference in years and months. Among the two dates, one is in Date datatype and the other one is in varchar2(dff attribute).Following are the details:
1.Start_date(Date data type) - appears as YYYY-MM-DD in the XML when the tag is printed as it is without any manipulations.
2.End_Date(Varchar2 - dff attribute) - appears as YYYY/MM/DD HH:MI:SS in the XML whent the tag is printed as it is wihtout doing any manipulation.
As the first step am trying to convert the varchar2 to canonical date format and then converting it to required format compatible for using date_diff function. But am facing issues. Please help me with this. The following is the code am trying to use.
To convert end date to date format of our choice : <?xdofx:to_date(replace(substr(EndDate,1,10),’/’,’-’)||’T00:00:00.000+05:30’,'YYYY-MM-DD')?>
To subtract end date and start date to fetch difference in years: <?xdoxslt:date_diff('y',StartDate,xdofx:to_date(replace(substr(EndDate,1,10),’/’,’-’)||’T00:00:00.000+05:30’,'YYYY-MM-DD'),$_XDOLOCALE, $_XDOTIMEZONE)?>
Am getting an error which says xdofx used bot not declared. If I remove it, I get an error saying to_Date function not found. I belive we're not supposed to mix xdofx and xdoxslt together. Please let me know how this can be achieved.
Am using 10.1.3.4.2 version of BIP.
Regards,
Divya
Advertisement

Replay

according to Extended Function Support in RTF Templates - 11g Release 1 (11.1.1)
<?xdoxslt:date_diff('y', 'YYYY-MM-DD', 'YYYY-MM-DD', $_XDOLOCALE, $_XDOTIMEZONE)?>
This function provides a method to get the difference between two dates in the given locale. The dates must be in "yyyy-MM-dd" format. This function supports only the Gregorian calendar. The syntax is as follows: <?xdoxslt:date_diff('format', 'YYYY-MM-DD', 'YYYY-MM-DD', $_XDOLOCALE, $_XDOTIMEZONE)?> where format is the time value for which the difference is to be calculated. Valid values are:
y - for year
m - for month
w - for week
d - for day
h - for hour
mi - for minute
s - for seconds
ms - for milliseconds
very strange for hour, minute .... and "The dates must be in "yyyy-MM-dd" format."
but for your case
display the difference in years and months.
it's ok
so
1.Start_date(Date data type) - appears as YYYY-MM-DD in the XML when the tag is printed as it is without any manipulations.
2.End_Date(Varchar2 - dff attribute) - appears as YYYY/MM/DD HH:MI:SS in the XML whent the tag is printed as it is wihtout doing any manipulation.
Start_Date and End_Date must be in "yyyy-MM-dd"
for "Start_date" - that's ok
for End_Date we must reformat as
concat(substring(//End_Date,1,4),'-', substring(//End_Date,6,2),'-', substring(//End_Date,9,2))
so as result:
- for months:
Diff is <?xdoxslt:date_diff('m', //Start_Date, concat(substring(//End_Date,1,4),'-', substring(//End_Date,6,2),'-', substring(//End_Date,9,2)), $_XDOLOCALE, $_XDOTIMEZONE)?>
which gives output as
Diff is 1
for test case
<Start_Date>2013-01-11</Start_Date>
<End_Date>2013/02/11 11:00:00</End_Date>
- for years:
Diff is <?xdoxslt:date_diff('y', //Start_Date, concat(substring(//End_Date,1,4),'-', substring(//End_Date,6,2),'-', substring(//End_Date,9,2)), $_XDOLOCALE, $_XDOTIMEZONE)?>
which gives output as
Diff is 3
for test case
<Start_Date>2013-01-11</Start_Date>
<End_Date>2016/02/11 11:00:00</End_Date>

Related Topics

  • ORA-00902: invalid datatype comile error while using CAST function

    Hi everyone, I'm getting ORA-00902: invalid datatype compilation error while using CAST function. open ref_cursor_list for select empName from TABLE(CAST(part_t AS partnumberlist)); The partnumberlist and ref_cursor_list is declared in the Package sp

  • Inconsistent FOTY0001: type error while  using translateFromNative

    I am getting FOTY0001: type error while using translateFromNative function in assign activity. This error happens only in the below scenarios: 1. Create a BPEL process with file input adapter that accepts simple xml string as input and accepts files

  • Error while using JARToolkit3D

    Hello All, I am getting the following error while using JARToolkit for a tracking application......In fact I am trying out the DemoJava3D example given by the JARToolkit itself, but still I am not able to run the program.....The error is as follows:

  • Error while using DB Adapter in BPEL process

    Hi All, I am getting error while using DB Adapter in BPEL process java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Bin

  • Error while using pt:standard.choose tag

    Hi, I am getting error while using the ALUI 6.5 Adaptive tags. The details are given below. Can anyone help? The code I am using is <pt:standard.choose>                <pt:standard.when pt:test="stringToACLGroup('user=13009;').isMember($curr

  • Error while using the export utility

    Dear all of I am getting the following error while using the export utility in the Oracle database 9i I have run the catexp.sql and catrm.sql suggested by the experts in this forum. But it did not help me. Kindly help me in solving this issue. FOLLOW

  • OSB: Cannot acquire data source error while using JCA DBAdapter in OSB

    Hi All, I've entered 'Cannot acquire data source' error while using JCA DBAdapter in OSB. Error infor are as follows: The invocation resulted in an error: Invoke JCA outbound service failed with application error, exception: com.bea.wli.sb.transports

  • Error while using wbutil Client_OLE2.create_obj('Excel...ora-06508

    I am facing ora-06508 error while using webutil. Have done all setup as per "How to Configure Webutil in Forms 11g ". Error on following statement "Client_OLE2.create_obj('Excel.Application')" FRM-40375, ORA-06508. Waiting for Help. Th

  • Error while using LabVIEW 8.2.1 Dll from Visual C++ 6.0

    I am getting an error while using a LabVIEW 8.2.1 dll from Visual C++ 6.0 application. This is what I am doing: 1) Created a dll using LabVIEW 8.2.1 (I used a tutorial from NI knowledge base: "Creating DLLs from 6.0i". It is a temperature conver

  • How to resolve the error while using user defined function.

    EPN Assembly file <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springfr

  • Error while using row_num function in forms6i

    Oracle forms6i Hai While using row num function in my forms i had a error. My coding is declare pin_no varchar2(16); pin_date date; pin_time varchar2(25); mstr varchar2(200); m_file TEXT_IO.FILE_TYPE; m_file_path varchar2(100) := :global.filename; li

  • Error while using threads in proc program

    Hi, I am getting the error fetched column value NULL (-1405) in proc program while using the threads. The execution of the program is as follows. Tot_Threads = 5 (Total threads, totally 5 records with value instance names) No_Of_threads = 1 (No Of th

  • Error while using Oracle Table as source file :- ODQ for ODI

    Hi All, I am getting some errors while working on ODQ with Oracle Tables as source file. If I am trying with text files (*.txt) as source and output it works fine. Please let me know how we can connect to an oracle table which is my source file. In t

  • Error while using DataGrid

    Hi All, Am new to flex and learning and doing the examples of flex applications. while using the data grid in my application am getting an error like this ===== Multiple markers at this line --Access of undefined property RenderDGHeader and Definitio

  • Error while using Import Manager in MDM 7.1 SP7

    Hi, We are using MDM 7.1 SP7. I am trying to import a Tab delimited flat file through import manager. When I try to connect the source file, I get the following error * Logon Error: Found non-complaint CSV format in input stream [Encoding:UTF16].96*

  • Error while using Extractors in BODS

    Hi All, 1.Our version is BODS 4.0  & ECC 6.0 EHP5. 2. We can able to import extractor from SAP system. 3.Error while running the extractor job in BODS, Please see the error below. Extractor returned error: <E: MESSAGE - Job ODQR_20140806_121712_000

  • Getting an ntvdm error while using single sign-on

    HI! When I run GssExample from the tutorial, I get an ntvdm error in a requester, saying "Error while setting up environment for the application. Choose 'Close' to terminate the application.". Then I can klick on "Close" or "Ignor

  • Getting a fatal relocation error while using a sudo command.

    I am getting the following error while trying to execute a sudo command: ld.so.1: sudo: fatal: relocation error: file /usr/local/bin/sudo: symbol closefrom: referenced symbol not found the sudo version I use is: 1.6.8p9 the SUNWcsu package that conta

  • Getting error while using TRIM method in collections

    Hi Experts, While using TRIM method I am getting below error. Am I doing any mistake here ? DB : Oracle 11g SQL> declare   2   3    type emp_tab is table of employees%rowtype index by binary_integer;   4    l_emp_tab emp_tab;   5   6  begin   7   8