June 19, 2006, 05:28 PM
Francis MarianiEmbedded SQL in WebFOCUS code
I have a fex that generates SQL passthru code that is executed to insert rows into a MS SQL Server 2000 database table.
In this code, I have a SQL variable declaration that's failing - I don't see anything wrong with the code. Any ideas? Can we not have a SQL variable declaration in SQL passthru?
The code that's failing:
-SET &ECHO=ON;
SET SQLENGINE=SQLMSS
-RUN
SQL
DECLARE @GUIDCol uniqueidentifier;
END
-RUN
The error:
(FOC1487) SQL SYNTAX ERROR
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
June 20, 2006, 06:30 AM
<JG>Francis
With my MSSQL code I would code it like this
SQL SQLMSS
DECLARE @GUIDCol uniqueidentifier
END
-RUN
Although the SET ENGINE should not require the SQLMSS to be used.
Also no semi-colon.
June 20, 2006, 12:49 PM
Francis MarianiJG, unfortunately, I still get the FOC1487 error.
I've dug around in the documentation, and there is no mention of SQL DECLARE statements not being allowed. Of course that doesn't mean that they are allowed.
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
June 22, 2006, 08:46 AM
<DocServices>Hi Francis,
I received this from one of our Product Managers:
"SQL Passthru is intended for the passing of SQL statements. Other vendor native commands, or scripts like T-SQL, are not always reliably handled by this interface. Some of these commands may clash with SQL Passthru reserved words as is the case with your use of DECLARE.
In order to better assist you we suggest you open a case with our customer support and explain with greater detail and provide the complete script for what you are trying to accomplish."
Hope this helps.
Regards,
Jenn