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     Capture Focus Error Number

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Capture Focus Error Number
 Login/Join
 
Silver Member
posted
Hi guys,

How to capture error message in SQL passthrough.
First piece of code is GOOD because DEV_TEST is created.
and Second piece of code NOT GOOD because DEV_TEST1 is not created.

Example:
DEV_TEST for Oracle Adapter

  
ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST
SQL SQLORA PREPARE SQLOUT FOR
-*
SELECT MAX(SALARY) HSALARY FROM EMPLOYEE ;
END
TABLE FILE SQLOUT PRINT * END
-TYPE &FOCERRNUM ;
-TYPE &RETCODE ; 


The above code works good and both variables (FOCERRNUM, RETCODE) returns zeros.

Question: In below code if DEV_TEST1 is used instead of DEV_TEST due to type error or what ever reason..
  
ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST1
SQL SQLORA PREPARE SQLOUT FOR
-*
SELECT MAX(SALARY) HSALARY FROM EMPLOYEE ; END
-TYPE &FOCERRNUM ;
-TYPE &RETCODE ; 

Above Variables still returns zero's. But FEX returns FOC1671.

Is there a way to capture this FOC1671 error number in Variable..?


I have looked in previous forums, but couldn't find any solution on how to capture SQL error messages..

Any suggestions will be helpful..

--------------
Dev: WF 7.1.7 with 7.1.7 WFRS; AIX 5.3;
MRE
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report This Post
Expert
posted Hide Post
I'm quite sure that a solution to this has been posed before.


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
Expert
posted Hide Post
Have you tried searching for "&FOCERRNUM"?


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
Expert
posted Hide Post
Think of it this way (simplistic) -

The code is parsed for undeclared variables.
Each line of code is read into a stack - up until a -RUN is encountered or EOF is reached, signifying the point at which to execute what is in the stack.
Dialogue manager code gets executed first.
Followed by other code.

So, taking your second process -

There are no undeclared variables in the code (only system variables).
All lines of code are read into the stack.
The -TYPE dialogue manager lines are executed.
Followed by the SQL statements.

Now that should answer your question.

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, 2004Report This Post
Expert
posted Hide Post
You could try this.
-*new file
SET EMGSRV = FILE
-RUN

ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST1
-RUN
SET EMGSRV=ON
-RUN

! type emgfile.ftm
-EXIT


or check out
http://forums.informationbuild...631095252#7631095252


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
Expert
posted Hide Post
Just to be clear and point out what Waz has added. In your second example -

ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST1
SQL SQLORA PREPARE SQLOUT FOR
-*
SELECT MAX(SALARY) HSALARY FROM EMPLOYEE ; END
-TYPE &FOCERRNUM ; <==== These two lines are executed first
-TYPE &RETCODE ; <==== before the previous lines of code

That is why the values are always zero.

If you want to trap the errors then ensure that you execute the stack, by issunging -RUN, before -TYPEing out the variables.

ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST1
SQL SQLORA PREPARE SQLOUT FOR
-*
SELECT MAX(SALARY) HSALARY FROM EMPLOYEE ; END
-RUN <==== This makes sure that the previous lines are executed before the variables are checked
-TYPE &FOCERRNUM ;
-TYPE &RETCODE ;

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, 2004Report This Post
Silver Member
posted Hide Post
Thank you for all replys.I guess my question is mis understood. I completly understand WF STACK theory.

DEV_TEST1 - Good.
DEV_XXX - BAD / Wrong.

Code: 1
ENGINE SQLORA SET DEFAULT_CONNECTION DEV_TEST1
-RUN
-TYPE &FOCERRNUM
-TYPE &RETCODE
Returns 0's for both system variables because this is good connection.

Code: 2
ENGINE SQLORA SET DEFAULT_CONNECTION DEV_XXX (DEV_TEST1 has been typed/misspelled as DEV_XXX)
-RUN
-TYPE &FOCERRNUM
-TYPE &RETCODE
Returns 0's for both system variables. - In Fact this should return some error Numbers..

Both code: 1, 2 returns same results, In FACT code:2 should through some error number.
Can somebody shed some light on this..
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report This Post
Expert
posted Hide Post
quote:
In Fact this should return some error Numbers
Not so, because you haven't actually sent anything to the SQLORA adapter at this point, all you have achieved is setting a default connection. This isn't a test to see if the values given are correct.

Once you actually send something to that connector then you should get error codes.

It's like putting an invalid postal code on a letter. The postal code isn't shown to be incorrect until it is interpretted in the mail sorting centre (when they're working Wink).

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, 2004Report This Post
Silver Member
posted Hide Post
Thanks TONY for clarification.
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report 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     Capture Focus Error Number

Copyright © 1996-2020 Information Builders