Declare works for me in SQL Server but not Informix
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration
I declare scrollable cursors in SQL server 7.0 without a problem With Informix I get a syntax error, it does not make allot of sense to me, all the documentation leads me to believe that this is supported. My syntax looks like this declare curtemp scroll cursor for select * from customer Is any of these a possibility , I have no access to the administration side of the server are there Permissions issues? Must allocate Memory ODBC limitations Any help or ideas would be greatly appreciated. Chris Folkes
Chris Folkes wrote: > I declare scrollable cursors in SQL server 7.0 without a problem > > With Informix I get a syntax error, it does not make allot of sense to me, > all the documentation leads me to believe that this is supported. > > My syntax looks like this > > declare curtemp scroll cursor for select * from customer If preceded by a dollar symbol or EXEC SQL and if terminated by a semi-colon, that would make perfectly good sense in Informix ESQL/C. However, you cannot do that with ODBC to the best of my knowledge -- you use an ODBC function to achieve the same effect, but not that syntax. Without having any ODBC manual at hand, you should probably look up a function such as SQLPrepare or SQLDeclare -- I think it is more likely to be prepare than declare, based on what DBI does, and DBI is based on what ODBC does... -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN #include <disclaimer.h>