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]Need help in inserting record into DB2 table through SQl Pass-through

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Need help in inserting record into DB2 table through SQl Pass-through
 Login/Join
 
Member
posted
Hi,

I have a table in DB2 with the following structure.

FIELDNAME ALIAS FORMAT
--------- ----- ------
RPT_TYPE_C E01 A10
PRCS_TS E02 HYYMDm
RPT_DESC_T E03 A200
RPT_REC_CT_Q E04 I11
RPT_URL_T E05 A255
UPDT_TS E06 HYYMDm
UPDT_USER_I E07 A8

I have to insert records into this table; where i am using SQL pass-through in the fex file. I have to run this fex file using Report Caster; but the Report Caster job is getting executed with errors/warnings.

please find below the code i am using in SQL pass-through:

ENGINE DB2 SET DEFAULT_CONNECTION DB21
SQL DB2 PREPARE SQLOUT FOR
INSERT INTO DB2PROD.DC_EXCP_RPT_S (RPT_TYPE_C,PRCS_TS,RPT_DESC_T,RPT_REC_CT_Q,RPT_URL_T,UPDT_TS,UPDT_USER_I) VALUES
('DFDLCR04','2008-12-08 00:26:04.781000','For a specified Food RDC displays FDC Vendors which are not set up as SDA Vendors',130,'\\nicsrv10\devsuply\DFD_REPORTS_INTG\DFD_ROLLOUT\WFReports\DFDLCR04.XLS','2008-12-08 00:26:04.781000','JDBCWEBF');
END

Any kind of help in acheiving this code getting executed successfully is very much appreciated.

Thanks in Advance,

This message has been edited. Last edited by: Narayana,


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
 
Posts: 15 | Registered: September 18, 2008Report This Post
Member
posted Hide Post
Can you paste the error message?


Version: WebFOCUS 7.6.6
O.S. WebFOCUS is mounted on Unix
Output Report: HTML, Excel, CSV, PDF and TXT
 
Posts: 14 | Registered: November 24, 2008Report This Post
Member
posted Hide Post
Please find the message below given by Report Caster:

BTP1010 Starting worker thread
BTP1020 Starting task: insert_summ
BTP1020 Task type: EDA RPC
BTP1020 Procedure name: dfdlakecity/rpt_summ1
BTP1020 Connecting to server BIMCT01V with static execution id
BTP1020 Executing focexec.
BTP1020 ENGINE DB2 SET DEFAULT_CONNECTION DB21
BTP1020 SQL DB2 PREPARE SQLOUT FOR
BTP1020 -*SELECT * FROM DB2PROD.DC_EXCP_RPT_S
BTP1020 -* INSERT INTO DB2PROD.DC_EXCP_RPT_S (RPT_TYPE_C,PRCS_TS,RPT_DESC_T,RPT_REC_CT_Q,RPT_URL_T,UPDT_TS,UPDT_USER_I) VALUES
BTP1020 INSERT INTO DB2PROD.DC_EXCP_RPT_S VALUES ( DFDLCR04 , 2008-12-08 00:26:04.781000 , Vendors ,130, \\nicsrv10\devsuply\DFD_REPORTS_INTG\DFD_ROLLOUT
BTP1020 -* INSERT INTO DB2PROD.DC_EXCP_RPT_S (RPT_REC_CT_Q) VALUES (121)
BTP1020 -*COMMIT;
BTP1020 END
BTP1020 SET DISTRIBUTE=OFF
BTP1020 Task finished.
BTP1010 No report to distribute.


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
 
Posts: 15 | Registered: September 18, 2008Report This Post
Expert
posted Hide Post
I don't see an error. No report to distribute makes sense in this context.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
No record is being inserted into the table.

The other notification mail says as below:

Schedule ID: S13o0ptor513, Job Description: insert_summ Completed with errors/warnings No report to distribute.

There was no report to distribute; i want to insert the record into the DB2 table, which is not happening.


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
 
Posts: 15 | Registered: September 18, 2008Report This Post
Expert
posted Hide Post
If you run the focexec outside of RC, does it insert a record?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
quote:

ENGINE DB2 SET DEFAULT_CONNECTION DB21
SQL DB2 PREPARE SQLOUT FOR
INSERT INTO DB2PROD.DC_EXCP_RPT_S (RPT_TYPE_C,PRCS_TS,RPT_DESC_T,RPT_REC_CT_Q,RPT_URL_T,UPDT_TS,UPDT_USER_I) VALUES
('DFDLCR04','2008-12-08 00:26:04.781000','For a specified Food RDC displays FDC Vendors which are not set up as SDA Vendors',130,'\\nicsrv10\devsuply\DFD_REPORTS_INTG\DFD_ROLLOUT\WFReports\DFDLCR04.XLS','2008-12-08 00:26:04.781000','JDBCWEBF');
END


Why are you using PREPARE SQLOUT FOR ???

See if this works:

ENGINE DB2 SET DEFAULT_CONNECTION DB21
SQL DB2
INSERT INTO DB2PROD.DC_EXCP_RPT_S (RPT_TYPE_C,PRCS_TS,RPT_DESC_T,RPT_REC_CT_Q,RPT_URL_T,UPDT_TS,UPDT_USER_I) VALUES
('DFDLCR04','2008-12-08 00:26:04.781000','For a specified Food RDC displays FDC Vendors which are not set up as SDA Vendors',130,'\\nicsrv10\devsuply\DFD_REPORTS_INTG\DFD_ROLLOUT\WFReports\DFDLCR04.XLS','2008-12-08 00:26:04.781000','JDBCWEBF');
END

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Tom is right. I do not exactly know the internals of using the "PREPARE SQLOUT FOR" phrase, but it limits the SQL to a Fetch only.

The Insert should work just fine in this format -
SQL DB2
INSERT INTO TBL1
VALUES (A,B,C)
;
TABLE
END

Sandeep Mamidenna

This message has been edited. Last edited by: BlueZone,


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Another consideration - when you execute outside of RC, it is using your current credentials. When it is run in RC, it appears that you are using a static execution ID which may or may not have write access to your database.

In any case, there is no resulting report for an SQL INSERT (number of rows updated is not a report) so you will get the "No report to distribute" message. That is not an error. If you are not getting db stats returned try setting PASSRECS=ON in your server profile for the DB2 adapter.


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
Thanks to everyone!

Removing PREPARE SQLOUT FOR worked out perfectly.


Prod: WebFOCUS v7.1.4 OS: Windows Outputs: Excel, HTML, Pdf
 
Posts: 15 | Registered: September 18, 2008Report 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]Need help in inserting record into DB2 table through SQl Pass-through

Copyright © 1996-2020 Information Builders