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.
The fex below only inserts a single row (first row) into the database table. There are 7200 or so rows in the ALPHA file that I want to insert. It seems like the REPEAT is working as the TYPE returns 10 rows as stated in the REPEAT.... but the INSERT only fires a single time?????
Any guidance would be greatly appreciated.
Thanks and Regards, John Anderson
APP HOLD etga TABLE FILE HOLD_EMVISION_APPS2
SUM APP_NO BY APP_NO NOPRINT HEADING "" FOOTING "" ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE HOLD AS SAMTEST_ALPH FORMAT ALPHA -*ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, $ ENDSTYLE END
-SET &&FILENAME='"/opt/webfocus/ibi/apps/etga' || '/samtest_alph.ftm"'; FILEDEF SAMTEST_ALPH DISK &&FILENAME -RUN
The first thing I would do is get rid of all the stuff you don't need. If I was doing this, my fex would look like this:
APP HOLD etga
TABLE FILE HOLD_EMVISION_APPS2
BY APP_NO
ON TABLE SET HOLDFORMAT ALPHA
ON TABLE SAVE
END
-RUN
-SET &LIMIT=&LINES;
-*
-REPEAT ENDLOOP &LIMIT TIMES;
-READ SAVE NOCLOSE &CODE.9.
-TYPE &CODE
ENGINE DB2 SET DEFAULT_CONNECTION DSN1
SQL DB2
INSERT INTO AUPPR001.TENVXRF values ('&CODE.EVAL');
SQL COMMIT;
END
-RUN
-ENDLOOP
Rule #1. &LINES contains a value until the next command is run. Therefore, in this case, there must be a -RUN immediately after the END statement associated with the TABLE command and the -SET &LIMIT should immediated follow that. The way your fex is coded, the you have a FILEDEF being executed before the -SET &LIMIT. The FILEDEF will set &LINES back to 0. I would also put the -RUN inside the -ENDLOOP. As Waz suggested, you need an END after the COMMIT.
The only other thing to worry about is trailing blanks in &CODE. If all the values have 9 characters then there is nothing to worry about. If not, then you may want to use the TRUNCATE function after the -READ for &CODE. Something like this.
-SET &CODE=TRUNCATE(&CODE);
Be sure to use -SET &ECHO=ALL; and -SET &STACK=OFF; while testing. This will let you see exactly what is being generated.
Hope this helps.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006
Just an FYI, I added the SQL SET LOADONLY and SQL SET INSERTSIZE 100 to a modify statement of mine and I was able to populate a table in Oracle with almost 2 Million records, 60 columns wide in less than 10 minutes, it used to take over night. Major improvement! Here's my code:
TABLE FILE MYFILE PRINT * ON TABLE HOLD AS MYHOLDFILE END -RUN
MODIFY FILE ORACLETABLE SQL SET LOADONLY SQL SET INSERTSIZE 100 FIXFORM FROM MYHOLDFILE DATA ON MYHOLDFILE END
Posts: 10 | Location: Johnston, IA | Registered: August 07, 2007