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.
I'm trying to send email via stored procedure and calling that stored proc from Webfocus. I created table file of the stored proc. Stored procedure works if i don't have code starting from "EXEC msdb..sp_send_dbmail". If I include SP_SEND_DBMAIL, Webfocus report doesn't return anything and keeps searching ( sometimes locks the database ).
Can some one tell me what is wrong in the query? Note: If I run this stored proc from sql query analyzer, it works fine and sends email.
Below is the Webfocus code - TABLE FILE SP_TEMP PRINT SP_MINAKSHI_TEMP.ANSWERSET1.PRODUCTNAME ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML
Stored Procedure -
ALTER PROCEDURE [dbo].[sp_temp] AS BEGIN
IF EXISTS ( SELECT * FROM db_travel_system_test.dbo.temp_trams_matchings2 ) BEGIN DELETE FROM db_travel_system_test.dbo.temp_trams_matchings2 END
insert into db_travel_system_test.dbo.temp_trams_matchings2 select trams.Confirmation_Number , trams.Passenger_First_Name + ' ' + trams.Passenger_last_Name as 'PassengerName' , trams.Agent_Name , trams.Cruise_Length , convert(varchar(10) , trams.Booked_Date,110) as 'BookedDate' , trams.ship_name , vign.Sail_Date__c from dbo.webfocus_data_TRAMS_bookings as trams right join ( select a.Number_of_Passengers__c,a.Cruise_Line__c, destination__C, Itinerary__c, a.Name as sailingsname, a.Vendor_Code__c, b.ship_code__c, CONVERT(varchar(10), Sail_Date__c,110) as sail_date__c from salesforcebackups.dbo.Sailings__c a, salesforcebackups.dbo.Ship__c b where a.Ship__c = b.Id and YEAR(sail_date__c) >= 2013 and RecordTypeId = '01280000000G5XbAAK' ) as vign on trams.SupplierID = vign.Vendor_Code__c and trams.ShipCode = vign.Ship_Code__c and trams.Cruise_Start_Date = vign.Sail_Date__c inner join webfocus_report_agency_data agencydata on trams.AgencyID = agencydata.AgencyID where vign.Ship_Code__c = 'SE' and sail_date__c = '01-04-2013' and SupplierID = 'CRYST' and trams.Confirmation_Number = '1224600'
As per IBI, Stored Procedures must adhere to the following rules:
A cursor must be defined with: 1) The TYPE statement in a PACKAGE or PROCEDURE.
2) An associated record layout of the answer set to be returned.
3) The cursor must be opened in the procedure.
4) No fetching is allowed in the stored procedure. The Adapter for Oracle fetches the answer set.
E.g.,
CREATE OR REPLACE PACKAGE pack1 AS TYPE nfrectype IS RECORD ( pename emp.ename%TYPE, pjob emp.job%TYPE, pMgr emp.mgr%TYPE); TYPE nfcurtype IS REF CURSOR RETURN nfrectype ; PROCEDURE proc1(v_empno IN NUMBER,c_saltable IN OUT nfcurtype); END pack1 ; / sho error
CREATE OR REPLACE PACKAGE BODY pack1 AS PROCEDURE proc1 (v_empno IN NUMBER,c_saltable IN OUT nfcurtype) IS BEGIN OPEN c_saltable FOR SELECT ename, job, mgr FROM scott.emp WHERE EMPNO = v_empno; END proc1 ; -- end of procedure END pack1; -- end of package body / sho error
Then call your SP from WebFOCUS using EX or CALL
Thanks, RifazThis message has been edited. Last edited by: Rifaz,
-Rifaz
WebFOCUS 7.7.x and 8.x
Posts: 406 | Location: India | Registered: June 13, 2013
While we wait to see if another customer can help with this issue, please keep us posted on the final solution from your case. Thank you in advance for sharing with all.
CREATE OR REPLACE PACKAGE svstst.pack1 AS TYPE nfrectype IS RECORD ( poperation plan_table.operation%TYPE, poptions plan_table.options%TYPE, pobject_name plan_table.object_name%TYPE); TYPE nfcurtype IS REF CURSOR RETURN nfrectype ; PROCEDURE proc1(var1 IN NUMBER,c_saltable IN OUT nfcurtype); END pack1 ; / sho error
CREATE OR REPLACE PACKAGE BODY svstst.pack1 AS PROCEDURE proc1 (var1 IN NUMBER,c_saltable IN OUT nfcurtype) IS BEGIN OPEN c_saltable FOR SELECT operation, options, object_name FROM svstst.plan_table WHERE object_instance = var1 ; END proc1 ; -- end of procedure END pack1; -- end of package body / sho error