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 hold the file in the FEX and then I want to insert the hold file content to table in SQL server. How can I do that ?This message has been edited. Last edited by: Kerry,
Ringo, If you are licensed to update database with WebFOCUS you can do what was suggested. Here's a more detail example using the famous car file and lets say that car2 is a SQL table that has the same fields and formats that I am printing and holding as HOLDCAR.
TABLE FILE CAR PRINT DCOST RCOST BY COUNTRY BY CAR BY MODEL BY BODYTYPE -*DEFAULT HOLD NAME IS HOLD WHEN AS IS NOT USED ON TABLE HOLD AS HOLDCAR END -RUN MODIFY FILE CAR2 FIXFORM FROM HOLDCAR MATCH COUNTRY CAR MODEL BODYTYPE ON MATCH UPDATE * ON NOMATCH INCLUDE DATA ON HOLDCAR END
The absolutely easiest way to put a HOLD file into a relational database is to do it directly. eg TABLE FILE CAR stuff ON TABLE HOLD FORMAT ORACLE AS tabname END or whatever database you have (the keywords are in the doc). Remember that your id is probably going to be the first part of the table name in the rdbms when you look for it.
GeraldCohen wrote: [qb] The absolutely easiest way to put a HOLD file into a relational database is to do it directly. [/qb]
...but note that, at least with earlier releases (4.x) of WF, the column names for the resulting table will be the standard HOLD MFD aliases: E01, E02,....
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Ringo, I need to do the same thing. But, I don't see in this code anywhere where it actually writes it to the database? Where do you actually write the contents of the hold file to the database/table?
This code creates a HOLD file and then uses MODIFY to update a table based on the data in the HOLD file:
-SET &ECHO=ON;
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
PRINT
COMPUTE DEALER_COST1/D7 = DEALER_COST * 1.001; AS DEALER_COST
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE HOLD AS H001
END
-RUN
MODIFY FILE CAR
FIXFORM FROM H001
MATCH COUNTRY CAR MODEL BODYTYPE
ON MATCH UPDATE DEALER_COST
ON NOMATCH INCLUDE
DATA ON H001
END
-RUN
This message has been edited. Last edited by: Francis Mariani,
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
This example creates a HOLD file containing SQL UPDATE commands:
-SET &ECHO=ON;
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
PRINT
COMPUTE DEALER_COST1/D7 = DEALER_COST * 1.001; NOPRINT
COMPUTE DEALER_COST2/A10 = FTOA(DEALER_COST1, '(D7c)', 'A10'); NOPRINT
COMPUTE SQLUPDATE/A200 = 'UPDATE CAR ' |
'SET DEALER_COST = ' | DEALER_COST2 |
' WHERE COUNTRY = ''' | COUNTRY || '''' |
' AND CAR = ''' | CAR || '''' |
' AND MODEL = ''' | MODEL || '''' |
' AND BODYTYPE = ''' | BODYTYPE || ''';';
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
BY BODYTYPE NOPRINT
ON TABLE HOLD AS H001
END
-RUN
SQL
-INCLUDE H001
END
-RUN
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
Don't you feel we've provided enough information to enable you to try different methods. You're now asking us to solve your particular business problem.
"Both tables have different keys" - you haven't told us what the keys are in BOTH tables, just one.
This might get you closer:
-SET &ECHO=ON;
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE TABLE1
PRINT
COMPUTE COLUMN4/D15 = TABLE1.COLUMN1 + TABLE1.COLUMN2;
BY TABLE1.COLUMN??? AS COLUMN1
BY TABLE1.COLUMN??? AS COLUMN2
BY TABLE1.COLUMN??? AS COLUMN3
ON TABLE HOLD AS H001
END
-RUN
MODIFY FILE TABLE2
FIXFORM FROM H001
MATCH COLUMN1 COLUMN2 COLUMN3
ON MATCH UPDATE COLUMN4
ON NOMATCH INCLUDE
DATA ON H001
END
-RUN
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