[SOLVED] Getting error "COMMAND FOR SQLMSS INTERFACE OUT OF SEQUENCE"
I'm getting the following error message when trying to put the results of a stored procedure into a hold file. For one database the hold statement works fine, but for the other database I get the error. My only assumption is that the database2 connection setting is different somehow. Any ideas?
So for database1 the hold works the way it should....
SET SQLENGINE = SQLMSS SQL SQLMSS SET DEFAULT_CONNECTION DATABASE1 SQL SQLMSS EX DATABASE1.dbo.db1StoredProcedure;
TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS DB1SP END
but for database2 the hold throws error "SET SERVER DATABASE2 COMMAND FOR SQLMSS INTERFACE OUT OF SEQUENCE", and this error appears twice.
SET SQLENGINE = SQLMSS SQL SQLMSS SET DEFAULT_CONNECTION DATABASE2 SQL SQLMSS EX DATABASE2.dbo.db2StoredProcedure;
TABLE FILE SQLOUT PRINT * ON TABLE HOLD AS DB2SP END
If I remove the hold statement for DATABASE2, then the statement runs fine.This message has been edited. Last edited by: Web Guy,
WebFOCUS 8 Windows, All Outputs
March 09, 2017, 10:02 AM
Francis Mariani
I think you need a -RUN after the first END statement.
I've also cleaned up your code, though I can't test the updated code. You can set the SQL engine once. Then, since you've set the SQL engine, you don't need to specify it in subsequent SQL pass-through calls. And (I think) since you specify the database name in the procedure call, you don't need to set the default connection, though I haven't tested this...
SET SQLENGINE = SQLMSS
-RUN
SQL EX DATABASE1.dbo.db1StoredProcedure;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS DB1SP
END
-RUN
SQL EX DATABASE2.dbo.db2StoredProcedure;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS DB2SP
END
-RUN
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
March 09, 2017, 01:41 PM
Web Guy
Sure enough the missing "-RUN" did it. It works now. Thanks for your help.
WebFOCUS 8 Windows, All Outputs
March 09, 2017, 03:27 PM
Waz
quote:
Sure enough the missing "-RUN" did it.
It is interesting that a -RUN here will fix it, as its FOCUS code and should execute in sequence.