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've got some data in hold file and I want to delete corresponding rows from mysql table where entry_no is the same, but mysql just throws syntax error. I can't make this to work. The same problem exists if i try to delete rows from MSSQL table.
I connect through ODBC.
Please help. Any suggestions appreciated.
Code:
TABLE FILE SOME_DATA_HOLD
PRINT ENTRY_NO
ON TABLE HOLD AS HOLD_TO_DELETE FORMAT ALPHA
END
MODIFY FILE MYSQL_TABLE1
FIXFORM FROM HOLD_TO_DELETE
MATCH ENTRY_NO
ON MATCH DELETE
ON NOMATCH REJECT
LOG DUPL MSG OFF
DATA ON HOLD_TO_DELETE
END
-RUN
Result:
(FOC1400) SQLCODE IS 1064 (HEX: 00000428) XOPEN: 42000 : [37000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.51a-community-nt]You have a : n error in your SQL syntax; check the manual that corresponds to your My : SQL server version for the right syntax to use near '"Entry_No",T1."time : stamp",T1."Customer_No",T1."Contract_No", L (FOC1406) SQL OPEN CURSOR ERROR. : MYSQL_TABLE1This message has been edited. Last edited by: array,
WF 7.6.4/Win/HTML
Posts: 12 | Location: Lithuania | Registered: January 30, 2008
Please also post your master and access file for the mysql table. I have been playing around with mysql a little bit, and found the odbc driver to be very very strict. And by the look of it, the problem is not with the modify code, so the other thing to look at are the master/access files.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Hmm, What bugs me here is that the sql error speaks of at least 4 fields, while you only reference the first field. Also the access file only indicates 1 key field. You sure that the number of keys correspond with the real data? Could you capture the generated sql from the modify and see if you can pinpoint some syntax error there? What happens if you take the generated code and run it in mysql native? Same error?
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Some topics ago Francis M gave his version of setting up traces. The below code is repeated from that thread.
-*-- Set up SQL tracing --------------------------------------------------------
-*-- Deactivate SQL tracing --------------------------------
SET TRACEOFF = ALL
-*-- Show Commands and data exchange between the -----------
-*-- physical and the logical layers of the data adapter
-*SET TRACEON = SQLCALL
-*-- Enable Trace for the SQL Translator -------------------
SET TRACEON = SQLTRANS
-*-- Show SQL statements -----------------------------------
SET TRACEON = STMTRACE//CLIENT
-*-- Show Optimization information -------------------------
SET TRACEON = SQLAGGR//CLIENT
-*-- Show SQL generated statement trace --------------------
-*SET TRACEON = STMTRACE/1/CLIENT
-*-- Show SQL generated sub-statement trace ----------------
-*SET TRACEON = STMTRACE/2/CLIENT
-*-- Disable the trace stamp (Date/Time etc) ---------------
SET TRACESTAMP = OFF
-*-- Set trace line wrapping - # of characters -------------
SET TRACEWRAP = 78
-*-- Activate SQL tracing ----------------------------------
SET TRACEUSER = ON
Put this code in front of your modify code and run the procedure. You should get the sql statement that is being used to delete the record. Hope this helps in locating the source of the problem.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Try regenerating your master using the native SQL Server adapter as opposed to ODBC. Your suffix in the master would then be SQLMSS. This is a much smarter adapter and will generate better SQL for you.
I just got back to work and i tried to add sql traces to my code, just like GamP suggested, but unfortunately there is no sql output... Just theese lines :
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0
0 TRANSACTIONS: TOTAL = 0 ACCEPTED= 0 REJECTED= 0
SEGMENTS: INPUT = 0 UPDATED = 0 DELETED = 0
what i'm trying to do is to take some data from MSSQL and put it into Mysql, and vice versa.
Someone said that ODBC adapter has problems when you need to send delete statement, but I'm not sure about this.
I think I'll just rewrite everything in Java.
Thank you.This message has been edited. Last edited by: array,
WF 7.6.4/Win/HTML
Posts: 12 | Location: Lithuania | Registered: January 30, 2008
Use this code to trace if still probs cos I just test it with a modify
-* File sqltrace.fex
-* check on includes translation
SET TRACEUSER=ON
SET TRACEOFF=ALL
SET TRACEON=STMTRACE/1/CLIENT
SET TRACEON=SQLAGGR/1/CLIENT
-*SET TRACEON=WHOPT/1/CLIENT
SET TRACEON=SQLTRANS/3/CLIENT
SET TRACEON=?
SET XRETRIEVAL=OFF
SET EMPTYREPORT=OFF
As this code shows...
SET TRACEUSER=ON
SET TRACEOFF=ALL
SET TRACEON=STMTRACE/1/CLIENT
SET TRACEON=SQLAGGR/1/CLIENT
-*SET TRACEON=WHOPT/1/CLIENT
SET TRACEON=SQLTRANS/3/CLIENT
SET TRACEON=?
SET XRETRIEVAL=OFF
SET EMPTYREPORT=OFF
MODIFY FILE R1241CRX
FIXFORM FROM R1241_CR_LOAD
MATCH CR
ON NOMATCH INCLUDE
ON MATCH IF D.LOCKED EQ 'Y' THEN GOTO TOP ;
ON MATCH UPDATE LABHRS LABCOST SUBCOST MATCOST DATE_PRINTED
DATA ON R1241_CR_LOAD
END
-RUN
Use SET TRACEON=<name>/<lvl>/CLIENT to send traces to the client
Name Level Description Set Comp.ID
STMTRACE 1 SQL/MDX Generated Statement Trace Y AE
SQLTRANS 3 SQLTRANS Memory Dump Y BL
SQLAGGR 1 SQL Aggregation Trace Y BR
13.26.43 AE SELECT T1."CR",T1."DATE_PRINTED",T1."LOCKED",T1."CUST_REF",
13.26.43 AE T1."CHARGEABLE",T1."PROGRESS",T1."LABHRS",T1."LABCOST",
13.26.43 AE T1."SUBCOST",T1."MATCOST",T1."AGREED_PRICE",T1."DATE_SENT_CUST",
13.26.43 AE T1."DATE_RETURNED_CUST",T1."COMMENTS",T1."AT_RISK",T1."TF_NO",
13.26.43 AE T1."EMAILED",T1."FIVE_CARD_TRICK" FROM R1241CRX T1 WHERE
13.26.43 AE (T1."CR" = ?);
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006