What's the best way to get the SQL RC into a dialog var? e.g.- SET SQLENGINE=SQLMSS SQL INSERT INTO mytable VALUES ('one','two','three') ; TABLE FILE SQLOUT1 PRINT * ON TABLE HOLD AS SQLOUT1 END -RUN
at this point I'd like to say -IF (sqlRC) NE 0 THEN ... ELSE ...
&LINES isn't doing it for me. thxThis message has been edited. Last edited by: Kerry,
TABLE FILE BSLC_TIME_D
PRINT
TIME_DIM_KEY
WHERE READLIMIT EQ 1
END
-RUN
-SET &SQL_ERROR = &RETCODE;
-TYPE SQL ERROR: &SQL_ERROR
I tested this code by not passing a User ID/Password and got the following SQL error:
(FOC1394) CONNECT FAILURE
(FOC1400) SQLCODE IS -30082 (HEX: FFFF8A7E)
: [08001] [IBM][CLI Driver] SQL30082N Attempt to establish connection fai
: led with security reason "19" ("USERID DISABLED or RESTRICTED"). SQLSTA
: TE=08001
L (FOC1406) SQL OPEN CURSOR ERROR.
SQL ERROR: -30082
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
February 01, 2007, 08:12 PM
Alan Main
OK, another question. Here's what I'm running:
SET SQLENGINE=SQLMSS SQL SELECT something FROM mytable WHERE .... ; END -SET &R1 = &RECORDS; -SET &R2 = &RETCODE;
-HTMLFORM BEGIN <script> alert("records= &R1 retcode= &R2");
-HTMLFORM END -RUN
The alert box is popping up with the expected values. But the output of the query is also being displayed as a small report in standard webfocus html format. How can I dump this output so that only the alert box is displayed? I thought adding:
TABLE FILE SQLOUT1 PRINT ON TABLE HOLD AS SQLOUT1 END
might do it but it didn't.
February 17, 2009, 10:17 AM
Francis Mariani
While looking for a solution for something else, I came across this. The answer here is to add
TABLE ON TABLE HOLD
to the select statement - the output will be put into a temporary WebFOCUS file and not displayed on the HTML page.
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