From: Stephen M. <mo...@gm...> - 2008-06-18 18:20:41
|
I recently upgraded to version .039 from .037 and am having a problem with some basic sql. It should create a temp table on the fly for me to select from, but i get an error caused by the "select ... into" statement. It works perfectly fine with the older version. Here's the code: >>> import apresdb >>> c2 = apresdb.instance.cursor() >>> c2.execute("select iv0.ProdId, iv0.Account, iv0.StartPos, iv0.CurrPos, sum(iv1.StartPos) 'SumStartPos', sum(iv1.CurrPos) 'SumCurrPos' into tempdb..a_sum from PortfolioInv iv0, PortfolioInv iv1 where iv1.ProdId = iv0.ProdId") Traceback (most recent call last): File "<stdin>", line 1, in ? File "/apps/python/lib/python2.4/site-packages/Sybase.py", line 546, in execute self._set_state(_LAZY_END_RESULT) File "/apps/python/lib/python2.4/site-packages/Sybase.py", line 695, in _start if self._closed: File "/apps/python/lib/python2.4/site-packages/Sybase.py", line 709, in _mainloop # Send parameters. File "/apps/python/lib/python2.4/site-packages/Sybase.py", line 753, in _raise_error raise ProgrammingError('cursor is closed') Sybase.DatabaseError: Msg 3803, Level 16, State 1, Line 1 The statement used to define the cursor 'ctmp2a956073b0' is neither a SELECT nor an EXECUTE. >>> Any help would be greatly appreciated. |