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 Update in loop

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SQL Update in loop
 Login/Join
 
Silver Member
posted
Hi,
In my fex file i use the output of a hold file to run a loop and within it i will perform some sequence of operation and at the final step i execute a DML (update) statement to a oracle DB. Even when i have commit after my DML, i see that the change is made to the DB only at the end of execution of entire loop (rather updating after each iteration of loop)... There is no issue by this way when i run the loop for limited values, however when the loop iterates for 1000 iteration, the DML is not getting executed atall (or it is not commited). My assumption is that Webfocus is pilling up all the update and executing at the end of loop, which might lock the oracle table. Can anyone help me understand how does Webfocus executes DML and Commit? Thanks much in advance.


Here is the code i am having problem with..


SQL SQLORA PREPARE SQLOUT FOR
SELECT DECODE(RN.BD,1,'FN',4,'MFS') AS BD, RN.REP_NUMBER AS REP_NUMBER, RN.SSN AS SSN, RN.MULT_HOUSEHOLD_IND AS MULT_HOUSEHOLD_IND
FROM AWSAPP.RPT_DRVR_TBL RN
WHERE ssn in ('160585617', '460966989' , '460966989');
END
TABLE FILE SQLOUT
PRINT
BD
REP_NUMBER
SSN
MULT_HOUSEHOLD_IND
ON TABLE HOLD AS REPLIST FORMAT ALPHA
END
-RUN
-top.loop
-READ REPLIST NOCLOSE &BD_NUM.A3. &REPNUM.A10. &REP_SSN.A9. &MULT_IND.A1.

-IF &IORETURN NE 0 GOTO end.loop;

SET SQLENGINE=SQLORA
ENGINE SQLORA SET DEFAULT_CONNECTION CT_ADWSAQ
SQL UPDATE AWSAPP.RPT_DRVR_TBL SET RPT_NAME='&OUTPUTFILE', RPT_STATUS = 'SUCCESS', NUM_OF_ROWS=TO_NUMBER('&LINENUM') , RPT_CREATION_TS = SYSDATE WHERE SSN='&REP_SSN' AND BD = DECODE('&BD_NUM','FN',1,'MFS',4);
SQL COMMIT;
END
-RUN

-GOTO top.loop;
-end.loop

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


Release : 7.7.02
OS : Linux
App Server : Tomcat
all output
 
Posts: 36 | Registered: February 03, 2011Report This Post
Expert
posted Hide Post
I would suggest separating the commit from the update command.

SET SQLENGINE=SQLORA
ENGINE SQLORA SET DEFAULT_CONNECTION CT_ADWSAQ
SQL UPDATE AWSAPP.RPT_DRVR_TBL SET RPT_NAME='&OUTPUTFILE', RPT_STATUS = 'SUCCESS', NUM_OF_ROWS=TO_NUMBER('&LINENUM') , RPT_CREATION_TS = SYSDATE WHERE SSN='&REP_SSN' AND BD = DECODE('&BD_NUM','FN',1,'MFS',4);
END

-RUN

SQL SQLORA
COMMIT;
END
-RUN


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Waz,
You are the man. Your code works perfect.Should i always have only one DML per SQLORA? Anyways, thanks a lot for the solution.


Release : 7.7.02
OS : Linux
App Server : Tomcat
all output
 
Posts: 36 | Registered: February 03, 2011Report This Post
Expert
posted Hide Post
quote:
Should i always have only one DML per SQLORA



Yes.

Check out the documentation on SQL support, it will help.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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 Update in loop

Copyright © 1996-2020 Information Builders