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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
I am trying to use a SQL passthru in my webfocus report . It seems that the SQL statement is working because it displays the results in my output but does not go on with the rest of the code to create the report.
Could some please help me with this problem. I'm wanting to put the results in a hold file to be used in my report.
. . . SQL SELECT NBRJOBS_PIDM, NBRJOBS_POSN, NBRJOBS_SUFF, NBRJOBS_STATUS, NBRJOBS_ECLS_CODE, NBRJOBS_REG_RATE, NBRJOBS_PER_PAY_SALARY, NBRJOBS_EFFECTIVE_DATE FROM NBRBJOB, NBRJOBS X WHERE NBRBJOB_PIDM = NBRJOBS_PIDM AND NBRBJOB_POSN = NBRJOBS_POSN AND NBRBJOB_SUFF = NBRJOBS_SUFF AND NBRJOBS_ECLS_CODE IN ('40','42'); AND (nbrjobs_status IN ('A','L','B','F','P') OR (nbrjobs_status IN ('T','I') AND nbrjobs_effective_date BETWEEN TO_DATE(TO_NUMBER( &PAYROLLBEGIN),'J') AND TO_DATE(TO_NUMBER(&PAYROLLEND),'J'))) AND nbrbjob_begin_date <= TO_DATE[TO_NUMBER[&PAYROLLEND),'J') AND (nbrbjob_end_date >= TO_DATE(TO_NUMBER(&PAYROLLBEGIN),'J') OR nbrbjob_end_date IS NULL) AND (nbrjobs_effective_date = (SELECT MAX(nbrjobs_effective_date) FROM nbrjobs WHERE nbrjobs_pidm = X.nbrjobs_pidm AND nbrjobs_posn = X.nbrjobs_posn AND nbrjobs_suff = X.nbrjobs_suff AND nbrjobs_effective_date <= TO_DATE[TO_NUMBER[&PAYROLLBEGIN),'J')) OR (nbrjobs_effective_date > TO_DATE(TO_NUMBER(&PAYROLLBEGIN),'J' ) AND nbrjobs_effective_date <= TO_DATE[TO_NUMBER[&PAYROLLEND),'J') ) );
TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS EFFJOBS1 END
TABLE FILE EFFJOBS1 PRINT NBRJOBS_PIDM.........This message has been edited. Last edited by: Kerry,
Unless you use SQL sqlenginename, (like SQL SQLMSS or SQL SQLDB2) it is not doing SQL passthru. It is just processing an SQL statement against the FOCUS Master files.
At the end of your SQL try
TABLE ON TABLE HOLD AS EFFJOBS1 END
TABLE FILE EFFJOBS1 PRINT NBRJOBS_PIDM........
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
Here's a valid SQL passthru statement. Does yours look like this?
MIN(BASEL.TIME_D.TIME_DIM_KEY) AS TIME_DIM_KEY,
COUNT(*) AS COUNT
GROUP BY BASEL.TIME_D.CALENDAR_YEAR
ORDER BY BASEL.TIME_D.CALENDAR_YEAR
TABLE ON TABLE HOLD AS H001
TABLE FILE H001
BY CALENDAR_YEAR PAGE-BREAK
You need the SQL ENGINE statement before the SQL SELECT statement or specify the type of DBMS in the SQL SELECT statement (SQL DB2 SELECT...).
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server