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.
Can anyone give me a hand with this please. Im trying to pass a date variable into and sqlout query and it keeps giving me an ...RETRIEVAL KILLED 0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0 (FOC1400) SQLCODE IS -180 (HEX: FFFFFF4C) : [22007] [IBM][CLI Driver][DB2] SQL0180N The syntax of the string repres : entation of a datetime value is incorrect. SQLSTATE=22007 L (FOC1406) SQL OPEN CURSOR ERROR. : SQLOUT
error.
I am setting a varible in the fex up above as so. -SET &DATE_BEGIN_CURRENT_MONTH=DATECVT(&DATE1C, 'YYMD', 'I8YYMD'); -SET &DATE_PRIV_MTH_END=DATECVT(&DATE1, 'YYMD', 'I8YYMD');
and here is the part of the query im trying to pass it too.
AND DATE(P.PROCESS_DATE) BETWEEN DATE('&DATE_BEGIN_CURRENT_MONTH') AND DATE('&DATE_PRIV_MTH_END')
I must have this wrong somehow, any help woiuld be greatly appreciated.
SQL DB2 PREPARE SQLOUT FOR SELECT O.office_desc || ' - ' || O.office_Code as strOffice,O.OFFICE_ID, O.OFFICE_DESC as Office_desc, O.OFFICE_CODE,CY.County_Name,CY.County_code, SUM(P.PAYMENT_AMOUNT) AS COLLECTIONS FROM DB2ADMIN.TKPAYMT P INNER JOIN DB2ADMIN.TKCASE C ON C.CASE_ID = P.CASE_ID INNER JOIN DB2ADMIN.tkcnty CY on CY.County_Code = C.County_Code INNER JOIN DB2ADMIN.TKCAHIS CH ON CH.CASE_ID = C.CASE_ID INNER JOIN DB2ADMIN.TKHIST H ON H.HISTORY_ID = CH.HISTORY_ID INNER JOIN DB2ADMIN.TKSTAGE S ON S.STAGE_ID = H.STAGE_ID INNER JOIN DB2ADMIN.TKOFFIC O ON O.OFFICE_ID = H.OFFICE_ID WHERE o.OFFICE_ID <> 0 AND P.STATUS_ID = 25 and C.Case_type_id = 1 AND DATE(P.PROCESS_DATE) BETWEEN DATE('&DATE_BEGIN_CURRENT_MONTH') AND DATE('&DATE_PRIV_MTH_END')
(FOC1517) UNRECOGNIZED COMMAND WHERE (H.OFFICE_ID IS NULL OR H.OFFICE_ID = 0 ) (FOC1517) UNRECOGNIZED COMMAND AND DATE(P.PROCESS_DATE) BETWEEN '20080601' AND '20080623'
I do not think i can pass variables to an sqlout query. But anyway, the values came out as '20080601' and '20080623'
Well, you can pass variables in SQL. People do it all the time. I think your problem with the dates might be, since you are doing passthru, is that the date is not in the correct format. I'm not sure what DB2's is but it might need dashes, i.e. 2008-06-01, etc.
I am also concerned about your first FOC1517 in your most recent post. That suggests that you screwed up the SQL somehow as that error has nothing to do with dates.
Oh, im sorry, i made it error out like that so i could see the values being passed in the between. I pass values to db2's queries all the time but this is the first time i tried to do it while using the sqlout feature.
How is your date defined in the database? If it is DATE rather than TIMESTAMP it is a numeric field. Two things to try, #1 change DATE(P.PROCESS_DATE) BETWEEN DATE('&DATE_BEGIN_CURRENT_MONTH') AND DATE('&DATE_PRIV_MTH_END')
TO: to_date(P.PROCESS_DATE,'YYYYMMDD') BETWEEN TO_DATE('&DATE_BEGIN_CURRENT_MONTH','YYYYMMDD') AND TO_DATE('&DATE_PRIV_MTH_END','YYYYMMDD')
#2 take the quotes off of your between dates.
In the code you supplied, I don't see: WHERE (H.OFFICE_ID IS NULL OR H.OFFICE_ID = 0 )
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007