john wrote:
>
> Thanks, but when I try that I get:
>
>>>> s = sqlalchemy.sql.text("DECLARE   RetVal VARCHAR2(200);  p1
>>>> VARCHAR2(200);  p2 NUMBER; BEGIN   p1 := '1';  P2 := 2;  RetVal :=
>>>> myfunc ( p1, p2 ); END; ")
>>>> print conn.execute(s).fetchall()
> 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 1642, in fetchall
>     self.connection._handle_dbapi_exception(e, None, None,
> self.cursor, self.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)
> InterfaceError: (InterfaceError) not open None None
>
> My obtuseness makes it hard to see the connection between executing
> the statement and retrieving the results.

thats a strange error there and not sure if that's cx_oracle being weird,
or some doubling of errors is occurring when the text() statement fails.  
I don't know how to declare variables and then execute SQL against them in
a single DBAPI execute() call.

we do have an "out param" test which doesn't go through any of that
trouble, it looks like:

        result = testing.db.execute(text("begin foo(:x_in, :x_out, :y_out,
:z_out); end;",
                bindparams=[bindparam('x_in', Numeric), outparam('x_out',
Integer), outparam('y_out', Numeric), outparam('z_out',
String)]), x_in=5)
        assert result.out_parameters == {'x_out':10, 'y_out':75,
'z_out':None}, result.out_parameters
        assert isinstance(result.out_parameters['x_out'], int)

thats one thing to try, otherwise your next stop would be the cx_oracle
mailing list.


>
> >
>


--~--~---------~--~----~------------~-------~--~----~
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