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.
Here is simple code that captures the execution of a program and records it in a file or database table. This can be used for usage analysis - a poor man's Resource Analyzer.
I include these three fexes in the program I want to track. One include at the beginning to capture the start time. One include at the end to capture the stop time and calculate the elapsed time. The third include is to write the info into a file or table.
I'm sure someone knows how to trigger execution of these from some kins of server or user profile, but to keep it simple, I just include these programs...
These are simplified versions of the code I use.
wftime1.fex
-*-- Capture Program Start Date and Time
-SET &P_ST_DATE = &YYMD;
-SET &P_ST_TIME = EDIT(HHMMSS('A8'),'99$99$99');
-TYPE
-TYPE ++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPE Program Start Time: &P_ST_TIME
-TYPE ++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPE
Don't forget that if using a FOCUS db, you should be using the SU access for updates. Otherwise, and speaking from experience, you will get a corrupt file.
Also don't forget the AUTODATE feature on FOCUS db, automatic date/timestamp so you don't have to.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Converting "wftime3" to Oracle, I was working with this simple example:
SET SQLENGINE=SQLORA
ENGINE SQLORA SET DEFAULT_CONNECTION ODS
SQL SQLORA INSERT INTO ODSMGR.WFTIMESTAMP (ROW_ID, FOCEXEC, USER_ID,
DIMENSION, TIME_DIMENSION, MEASURE, INFO_TEXT, ST_DTTM, EN_DTTM,
ROW_COUNT) VALUES (ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL, 'WFTIME3',
'USER1', 'DIMENSION', 'TIME_DIMENSION', 'MEASURE',
'INFO_TEXT',NULL,NULL, 1);
END
-RUN
SQL SQLORA
COMMIT;
END
-RUN
EXIT
In TOAD, under our WebFOCUS Data Adapter user, I can successfully run the Insert statement. However, in this simple FEX, nothing will write. Am I missing something?
8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
thanks for sharing this Francis we use the Resource Analyzer, but this might be a good thing to keep in mind since RA has a big overhead in resource use
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Originally posted by Francis Mariani: "nothing will write" - do you get an error message? Also, I'm not sure about "ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL"... I've not used this syntax before.
No error message - that:
ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL
is how Oracle uses sequences since there is no "auto-increment" datatype. The sequence was defined as:
Originally posted by FrankDutch: thanks for sharing this Francis we use the Resource Analyzer, but this might be a good thing to keep in mind since RA has a big overhead in resource use
Indeed! I think this is a great example and thank you again for sharing it with us.
8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
It looks like WebFOCUS 8 is doing something weird to your SQL - The word FOCEXEC shouldn't have "IBFS:/WFC/ USER_ID" next to it. It looks like it assumes FOCEXEC is a reserved word and is automagically substituting the string...
Try changing the column name in the table and SQL INSERT statement.
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
That looks like it was causing that error. I changed the code and now when I run:
-SET &ECHO=ALL;
ENGINE SQLORA SET DEFAULT_CONNECTION ODS
SQL
INSERT INTO WFTIMESTAMP (ROW_ID, FOCNAME, USER_ID, DIMENSION, TIME_DIMENSION,
MEASURE, INFO_TEXT, ST_DTTM, EN_DTTM,
ROW_COUNT)
VALUES (ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL,
'WFTIME3.FEX', 'WFUSER', 'DIMENSION',
'TIME_DIMENSION', 'MEASURE',
'INFO_TEXT',NULL,NULL, 1);
END
-RUN
SQL
COMMIT;
END
-RUN
EXIT
I get this error:
ENGINE SQLORA SET DEFAULT_CONNECTION ODS
SQL
INSERT INTO WFTIMESTAMP (ROW_ID, FOCNAME,
USER_ID, DIMENSION, TIME_DIMENSION, MEASURE,
INFO_TEXT, ST_DTTM, EN_DTTM, ROW_COUNT) VALUES
(ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL, 'WFTIME3.FEX',
'WFUSER', 'DIMENSION', 'TIME_DIMENSION',
'MEASURE', 'INFO_TEXT',NULL,NULL, 1);
END
-RUN
0 ERROR AT OR NEAR LINE 5 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: WFTIMESTAMP
SQL
COMMIT;
END
-RUN
EXIT
(FOC1517) UNRECOGNIZED COMMAND EXIT
8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
ALTER TABLE ODSMGR.WFTIMEST
DROP PRIMARY KEY CASCADE;
DROP TABLE ODSMGR.WFTIMEST CASCADE CONSTRAINTS;
CREATE TABLE ODSMGR.WFTIMEST
(
ROW_ID INTEGER NOT NULL,
ROW_TIMESTAMP TIMESTAMP(9) WITH TIME ZONE,
FOCNAME VARCHAR2(66 CHAR),
USER_ID VARCHAR2(50 CHAR),
DIMENSION VARCHAR2(256 CHAR),
TIME_DIMENSION VARCHAR2(256 CHAR),
MEASURE VARCHAR2(256 CHAR),
INFO_TEXT VARCHAR2(256 CHAR),
ST_DTTM DATE,
EN_DTTM DATE,
ROW_COUNT INTEGER
)
TABLESPACE ODSMGR_DATA
RESULT_CACHE (MODE DEFAULT)
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 160K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
COMMENT ON TABLE ODSMGR.WFTIMEST IS 'WebFOCUS program elapsed time capture db';
CREATE UNIQUE INDEX ODSMGR.WFTIMESTAMP_PK ON ODSMGR.WFTIMEST
(ROW_ID)
LOGGING
TABLESPACE ODSMGR_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 160K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
)
NOPARALLEL;
ALTER TABLE ODSMGR.WFTIMEST ADD (
CONSTRAINT WFTIMESTAMP_PK
PRIMARY KEY
(ROW_ID)
USING INDEX ODSMGR.WFTIMESTAMP_PK
ENABLE VALIDATE);
GRANT INSERT, SELECT, UPDATE ON ODSMGR.WFTIMEST TO WEBFOCUS;
Sequence:
DROP SEQUENCE ODSMGR.WFTIMESTAMP_SEQ;
CREATE SEQUENCE ODSMGR.WFTIMESTAMP_SEQ
START WITH 1
MAXVALUE 9999999999999999999999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER;
GRANT ALTER, SELECT ON ODSMGR.WFTIMESTAMP_SEQ TO WEBFOCUS;
8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
Glad it works for you. Thanks for discovering the FOCEXEC issue in WF8 - I'll change the column names in my real-world table and program before we upgrade.
For Oracle, if I need a unique key, instead of using the technique you use, I use SYS_GUID, as in the following:
SQL
SELECT SYS_GUID() AS ROW_ID FROM DUAL;
TABLE ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN
-IF &FOCERRNUM NE 0 GOTO FOC_ERROR;
-READFILE H001
One could probably add this as a sub-select to determine the row id.
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
CREATE TABLE ODSMGR.WFTIMEST
(
ROW_ID INTEGER NOT NULL,
You can use that sequence in a default value so you don't need to specify the ROWID/NEXTVAL combination in your INSERT statements. It will be used automatically.
I'm not sure about Oracle's syntax for nextval, but I'm used to calling that as a function and not as some kind of pseudo-column. You may need to use NEXTVAL() instead of bare NEXTVAL.
CREATE TABLE ODSMGR.WFTIMEST
(
ROW_ID INTEGER NOT NULL DEFAULT ODSMGR.WFTIMESTAMP_SEQ.NEXTVAL,
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :