Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] SQL return code

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SQL return code
 Login/Join
 
Member
posted
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.
thx

This message has been edited. Last edited by: Kerry,
 
Posts: 18 | Location: Rockville, MD | Registered: September 20, 2005Report This Post
Guru
posted Hide Post
-IF &RECORDS EQ 0 GOTO SORRYCHARLY;

-SORRYCHARLY
-EXIT


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
 
Posts: 238 | Location: Atlanta, GA/Rehovot, Israel | Registered: May 06, 2003Report This Post
Expert
posted Hide Post
The SQL error is in the system variable &RETCODE.

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
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.
 
Posts: 18 | Location: Rockville, MD | Registered: September 20, 2005Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] SQL return code

Copyright © 1996-2020 Information Builders