[egenix-users] Calling Stored Procedures
Fabio Rizzo Matos
fabiorizzo at gmail.com
Wed Mar 7 17:37:57 CET 2007
Hi all,
It's correct to call stored procedures:
def geranavtreepai(self, idseq, dsn, user, password):
conn = mxODBC.connect(dsn=dsn,user=user,password=password)
cur = conn.cursor()
try:
cur.callproc('PROC_GERANAVTREE_PAI',(idseq,))
cur.execute("""SELECT caso,
codsolicitacaopai,
nrdocumentopai,
nrgrupai,
codsituacaoworkflowpai AS situacaopai,
codsolicitacaofilho,
nrdocumentofilho,
nrgrufilho,
codsituacaoworkflowfilho AS situacaofilho,
codsolicitacaoneto,
nrdocumentoneto,
nrgruneto,
codsituacaoworkflowneto AS situacaoneto,
codanexo,
descricaoanexo,
abreviacao,
assuntopai,
indicativoresultado,
r.descricao
FROM TEMP_NAVTREE t,
solicitacao s,
tipoobjeto o,
ramificacao r
WHERE s.codtipoobjeto = o.codtipoobjeto
AND s.datainiciovigencia = o.datainiciovigencia
AND o.codramificacao = r.codramificacao
AND o.codassuntoprincipal = r.codassuntoprincipal
AND o.codassunto = r.codassunto
AND s.codsolicitacao = t.codsolicitacaopai
ORDER BY 3, 2, 6, 10""")
rs = cur.fetchall()
conn.commit()
conn.close()
except:
return None
return rs
My awnsers is too slow.... This maybe caused for my way to call the
procedure?
Thanks in advance!
--
Fabio Rizzo
ThreePointsWeb
fabiorizzo at threepointsweb.com
----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman-archives/egenix-users/attachments/20070307/ca39e7f9/attachment.htm
More information about the egenix-users
mailing list