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] trapping SQL errors in MAINTAIN

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] trapping SQL errors in MAINTAIN
 Login/Join
 
Gold member
posted
I have a maintain form thats writing to a SQL database. If I pass a variable with the incorrect format, I get a SQL error that displays in red on my form. I'd like to do something to replace this error with something a bit more "user friendly"- or even an alert type popup box. Does anyone have an example of how to do this?

Thanks,
Jen

This message has been edited. Last edited by: jjoyce,


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
 
Posts: 61 | Registered: April 16, 2009Report This Post
Expert
posted Hide Post
Its been 4 years since I worked with Maintain, but...

You need to check the return code from the insert/update/delete. Then if there is an error, show an appropriate form. I beleive the variable is FocError.

Mark, tell me if I'm wrong.
Smiler


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
If you want to turn off the SQL errors and issue your own, follow these steps.

First, in TOP case, turn off the errors that are returned to the screen:

SYS_MGR.FOCSET(“EMGSRV”, ”OFF”);

Just be careful with that as if there are other errors, you won't see them.

After you issue the update / include / delete command you can use the syntax:
Compute sqlErrorCode/i5 = SYS_MGR.dbms_errorcode;

That should return the SQL error code to your variable and you can decode and display what ever error message you would like.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Yes, I was "catching" the error with SYS_MGR.dbms_errorcode but it was still displaying because I didn't know how to turn it off.
Thanks!!


WebFOCUS 7.7.2
Win2003
Excel, HTML, PDF
 
Posts: 61 | Registered: April 16, 2009Report This Post
Platinum Member
posted Hide Post
Remember that dbms_errorcode is the error from the vendors DBMS. Document where you use it and comment what you are catching. If the app has to move to another DBMS those codes will be different.


Brian Suter
VP WebFOCUS Product Development
 
Posts: 200 | Location: NYC | Registered: January 02, 2007Report 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] trapping SQL errors in MAINTAIN

Copyright © 1996-2020 Information Builders