Using cx_Oracle, the following does the trick (note this is a
contrived example):

def test(orcl_conn):
  curs = orcl_conn.cursor()
  cursorToBind = orcl_conn.cursor()
  curs.execute("""begin
                     :cr1 := aaa_test(pWhen => :arg1);
                  end;""",  arg1 = None, cr1 =  cursorToBind)

  marketData = {}                        # dictionary to hold the
records
  i = 1
  for col in cursorToBind.fetchall():
    marketData[str(i)] = col
    i = i + 1
  return marketData

How can I have SA do this directly?  My backup plan was to drop into
the cx_Orcale layer and call the above function passing in a
raw_connection(); however, I get the following error:

NotSupportedError: Variable_TypeByValue(): unhandled data type
_CursorFairy


Thx,

Dan


On May 8, 9:26 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> whats the raw SQL which works ?
>
> On May 8, 2008, at 9:34 PM, Dan wrote:
>
>
>
> > I am trying to call an Oracle function (that does not take any
> > parameters) and returns a result set.  Here is the code I used:
>
> > s = select(["*"], from_obj=[func.aaa_test()], bind=engine)
>
> > However, when I issue this I get the following error:
>
> > DatabaseError:  (DatabaseError) ORA-04044: procedure, function,
> > package, or type is not allowed here
> > 'SELECT * FROM aaa_test' {}
>
> > How can I rework this?
>
> > Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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