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     [SOLVED] SQL Passthru

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SQL Passthru
 Login/Join
 
Member
posted
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.

Thanks!!!!!

.
.
.
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,


WF 8.1.04
 
Posts: 26 | Registered: February 25, 2005Report This Post
Virtuoso
posted Hide Post
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........


Regards,

Darin



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, 2007Report This Post
Member
posted Hide Post
Darin, that didn't work either. Any other suggestions?


WF 8.1.04
 
Posts: 26 | Registered: February 25, 2005Report This Post
Expert
posted Hide Post
Here's a valid SQL passthru statement. Does yours look like this?

SQL DB2
SELECT 
MIN(BASEL.TIME_D.TIME_DIM_KEY) AS TIME_DIM_KEY,
BASEL.TIME_D.CALENDAR_YEAR,
COUNT(*) AS COUNT
FROM BASEL.TIME_D
GROUP BY BASEL.TIME_D.CALENDAR_YEAR
ORDER BY BASEL.TIME_D.CALENDAR_YEAR
;
TABLE ON TABLE HOLD AS H001
END

TABLE FILE H001
PRINT TIME_DIM_KEY
BY CALENDAR_YEAR PAGE-BREAK
HEADING
"COUNT: <COUNT"
END

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...).


Francis


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
I figured it out. I had a ; out of place.

Thanks for you help!!!


WF 8.1.04
 
Posts: 26 | Registered: February 25, 2005Report 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     [SOLVED] SQL Passthru

Copyright © 1996-2020 Information Builders