Focal Point
Sybase Stored procecure problem with webFocus

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

December 28, 2007, 04:17 AM
Lalit Kumar
Sybase Stored procecure problem with webFocus
I am currently having problem while creating synonym for a stored procedure containgin ddl commands (CREATE TABLE)written in sybase.

Sybase allows the use of a few DDL commands in stored procedure by setting the value of a parameter called "ddl in trans" to true. Even after setting it to true, I am not able to create the synonym for it. It gives an error "Create Table not allowed in transaction".

Strangely this stored procedure is running fine in the sybase console and even through Crystal Reports. Is this a webFocus problem??


Version 7.1.4
Windows
December 28, 2007, 05:29 AM
FrankDutch
You want to create a master based upon the stored procedure, but that gives you the problem.
If you just execute the sql script and put the result in an hold file (SQLOUT) than this might work better. That's in fact what CR does.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 01, 2008, 11:59 PM
Lalit Kumar
Hi FrankDutch

Thanks for the reply. I however fail to understand what you mean when you say that CR uses SQLOUT and sql script instead of stored procedures. We are infact using the exact same stored procedure in CR which is giving us problems in webFocus. Does this mean that CR is internally converting the stored proc to SQL script???

Can you also provide pointer to some web resource/tutorial where this is done?


Version 7.1.4
Windows
January 02, 2008, 03:10 PM
Jason K.
Not to offend, but DDL a stored procedure is generally a bad idea. The only statement that should be necessary is a CREATE GLOBAL TEMP TABLE (oracle, postgres syntax), which is later dropped after the session is ended.

If you MUST use ddl within your stored procedure (such as a truncate table statement), I'd go with an Execute Immediate (again, not sybase syntax) and encapsulate your ddl within that. This usually bypasses the compile errors you get when you include DDL in your stored procedure.

If you'd like, send me the code behind your stored procedure and I may be able to help you eliminate a create table statement from your procedure.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.