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 have SQL 2005 table with DateTime field Data Type. Table name is TALERTS_SENT. Field name is DATE_SENT. This field is DateTime Data Type. I need to be able to insert records to this table from WebFocus procedure (*.fex). If I do this SQL INSERT INTO TALERTS_SENT (ALERT_NAME, JOB_ID, DATE_SENT, SENT_TO) VALUES ('AN2', 1, 9/26/2007, 'test2@aol.com'); END or this SQL INSERT INTO TALERTS_SENT (ALERT_NAME, JOB_ID, DATE_SENT, SENT_TO) VALUES ('AN2', 1, &DATEMDYY, 'test2@aol.com'); END then I get error (FOC14069) SYNTAX ERROR ON LINE 2 AT '/' -- Expected ')' So it doesn't like forward slash inside date value. How can I insert date value in DateTime field? Note - I was able to prove that this problem is related to DateTime field. I created new table tAlerts_Test1 in SQL 2005 with the same field names, but I did change Data Type for Date_Sent field from datetime to nvarchar(30). I was able to run the code below from WebFocus and it successfully inserted row in tAlerts_Test1 table. SQL INSERT INTO DW.TALERTS_TEST1 (Alert_Name, Job_ID, Date_Sent, Sent_To) VALUES ('AN4', 4, '09/26/2007', 'test4@aol.com'); END
WF 7.6.4, Win XP, SQL 2005
Posts: 42 | Location: California | Registered: August 17, 2007
It works if I do just 1 line insert using 'Values' syntax like this:
-SET &TIME = EDIT(&TOD,'99:$99:$99')||'.000';
-SET &DAY = EDIT(&YYMD,'9999/99/999');
-SET &TS = &DAY||&TIME;
-TYPE "TS is " &TS
SQL
INSERT INTO DW.TALERTS_SENT (ALERT_NAME, JOB_NUMBER, DATE_SENT, SENT_TO)
VALUES ('Buyout-PM','987','&TS','test987@aol.com');
END
If I try to insert multiple lines like this:
ENGINE SQLMSS SET DEFAULT_CONNECTION DW_DEV_SV
SQL SQLMSS PREPARE SQLOUT FOR
SELECT 'Buyout-PM' AS ALRTNM, RTRIM(F2.[JOB NUMBER]) AS JOBNUM, GETDATE() AS CURDATE, F1.[PROJECT MANAGER EMAIL] AS PMEMAIL
FROM ...
WHERE ...
END
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS #HLIST1 FORMAT SQLMSS
END
-RUN
-*-- Insert all the rows from the temporary table ----------
SQL
INSERT INTO DW.TALERTS_SENT (ALERT_NAME, JOB_NUMBER, DATE_SENT, SENT_TO)
SELECT ALRTNM, JOBNUM, CURDATE, PMEMAIL FROM #HLIST1
;
END
-RUN
then it fails with errors like
(FOC428)TRANS 1 REJECTED FORMAT COL 43 FLD DATE_SENTBuyout-PM6 20071008115040807test123@aol.com
Any ideas?
WF 7.6.4, Win XP, SQL 2005
Posts: 42 | Location: California | Registered: August 17, 2007
Mark, looks like I do have to have timestamp because if I do
-SET &TIME = EDIT(&TOD,'99:$99:$99')||'.000';
-SET &DAY = EDIT(&YYMD,'9999/99/999');
-SET &TS = &DAY||&TIME;
-TYPE "TS is " &TS
-*-- Insert all the rows from the temporary table ----------
SQL
INSERT INTO DW.TALERTS_SENT (ALERT_NAME, JOB_NUMBER, DATE_SENT, SENT_TO)
SELECT ALRTNM, JOBNUM, '&DAY', PMEMAIL FROM #HLIST1
;
END
-RUN
then error says
(FOC14091) INSERT VALUE FOR 'DATE_SENT' IS NOT COMPATIBLE WITH COLUMN FORMAT
However, if I do
-*-- Insert all the rows from the temporary table ----------
SQL
INSERT INTO DW.TALERTS_SENT (ALERT_NAME, JOB_NUMBER, DATE_SENT, SENT_TO)
SELECT ALRTNM, JOBNUM, '&TS', PMEMAIL FROM #HLIST1
;
END
-RUN
then error says
(FOC428)TRANS 1 REJECTED FORMAT COL 43 FLD DATE_SENT
. As you see, I included this field in single quotes. So, based on the 1st example I do need timestamp and format should be like '2007/10/08 13:07:48.000'. Any ideas how to fix error in the 2nd example? Thanks
WF 7.6.4, Win XP, SQL 2005
Posts: 42 | Location: California | Registered: August 17, 2007
Try it in one process rather than hold it temporarily first -
ENGINE SQLMSS SET DEFAULT_CONNECTION DW_DEV_SV
SQL SQLMSS
INSERT INTO DW.TALERTS_SENT (ALERT_NAME, JOB_NUMBER, DATE_SENT, SENT_TO)
SELECT 'Buyout-PM' AS ALRTNM, RTRIM(F2.[JOB NUMBER]) AS JOBNUM,
GETDATE() AS CURDATE, F1.[PROJECT MANAGER EMAIL] AS PMEMAIL
FROM ...
WHERE ...
END
TABLE FILE SQLOUT
PRINT *
END
-RUN
Unless there's a reason that you're holding it?
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004