Focal Point
[CLOSED] SQL common table expression "With"

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1417045526

October 26, 2012, 11:29 AM
roy
[CLOSED] SQL common table expression "With"
I have a problem where on one computer I can run a procedure in DevStudio that beings like

ENGINE SQLMSS SET CURSORS CLIENT
SQL SQLMSS PREPARE SQLOUT FOR
-DEFAULTH &te = '&te='
WITH CTE(AC, INTER, FEEDDIRECTION, FEEDFREQUENCY, etc etc etc

It runs beautifully

BUT THE Same procedure on my laptop will not run but both are using the same version of dev studio error is

FOC1400) SQLCODE IS 156 (HEX: 0000009C) XOPEN: 42000
: Microsoft OLE DB Provider for SQL Server: [42000] Incorrect syntax near
: the keyword 'WITH'. [42000] Incorrect syntax near the keyword 'with'. If
: this statement is a common table expression or an xmlnamespaces clause,
: the previous statement must be terminated with a semicolon. [42000] Sta
: tement(s) could not be prepared. [] Deferred prepare could not be comple
: ted.


Any Ideas? Must be something very subtle

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


WebFOCUS 7.6
Windows, All Outputs
October 26, 2012, 02:09 PM
rfbowley
Well, since I for one avoid using SQL in a WebFOCUS application like the plague for just this kind of problem(s), I would look at the versioning of the SQL Server data sources, the SQL Server Clients running on the two machines and last but not least the configuraton of the iWay connectors to make sure all of those match.

You might have to dig down as far as the SQL Server User Permissions for the User ID associated with the Data Server.

And before I get pilloried for my SQL statement above, if you think Roy is having fun, try working for an Oracle based client one month, a DB2 the next, take 3 months off and then help a client with both SQL Server and AS400. Trust me, "ANSI Standard SQL" is NOT standard :-)


Robert F. Bowley Jr.
Owner
TaRa Solutions, LLC

In WebFOCUS since 2001