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.
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, 2006
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, 2004
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, 2004
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, 2006
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 ).
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, 2004