john wrote:
>
> I get the following traceback:
>
>>>> conn.execute(sqlalchemy.func.myfunc('1', '2'))
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in <module>
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 824, in execute
>     return Connection.executors[c](self, object, multiparams, params)
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 858, in _execute_function
>     return self._execute_clauseelement(func.select(), multiparams,
> params)
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 874, in _execute_clauseelement
>     return self.__execute_context(context)
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 896, in __execute_context
>     self._cursor_execute(context.cursor, context.statement,
> context.parameters[0], context=context)
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 950, in _cursor_execute
>     self._handle_dbapi_exception(e, statement, parameters, cursor,
> context)
>   File "C:\Python25\lib\site-packages\sqlalchemy-0.5.6-py2.5.egg
> \sqlalchemy\engine\base.py", line 931, in _handle_dbapi_exception
>     raise exc.DBAPIError.instance(statement, parameters, e,
> connection_invalidated=is_disconnect)
> DatabaseError: (DatabaseError) ORA-14551: cannot perform a DML
> operation inside a query
>
>  'SELECT myfunc(:myfunc_2, :myfunc_3) AS myfunc_1 FROM
> DUAL' {'myfunc_2': '1', 'myfunc_2': '2'}
>
>  The select is the problem. Leaving aside the issue of whether its a
> good idea to modify data inside a function, is there a way to do this
> using sqlalchemy? And if so, what is the preferred syntax/style?

here's what google has to say:

http://www.dba-oracle.com/t_ora_14551_cannot_perform_a_dml_operation_inside_a_query.htm

so you need to execute from a string or text() construct on this one with
the syntax oracle is looking for.



>
> cheers
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to