MySQL Forums
Forum List  »  Spanish

Re: stored procedure vs parámetro de salida
Posted by: Ruben BC
Date: July 10, 2008 12:50PM

Si tu generás un recordset en tu SP, lo recibís sin problemas en el visual.

Public Function MercaVendida(pDepo As Long, pDesde As Date, pHasta As Date) As Recordset

Set Qy = New Command
Set Qy.ActiveConnection = mCn
Qy.CommandType = adCmdStoredProc
Qy.Parameters.Append Qy.CreateParameter("pRemi", adNumeric, adParamInput, , pDepo)
Qy.Parameters.Append Qy.CreateParameter("pDesde", adDate, adParamInput, , pDesde)
Qy.Parameters.Append Qy.CreateParameter("pHasta", adDate, adParamInput, , pHasta)
Qy.CommandText = "MercaVendida"
Set MercaVendida = Qy.Execute
Set Qy = Nothing
End Function

Y en cuanto a la invocación de una function es así

Public Function SiguienteSF(pSubFa As Long) As Long
Set mRx = New Recordset
Set Qy = New Command
Set Qy.ActiveConnection = mCn
Qy.CommandType = adCmdUnknown
Qy.CommandText = "Select SigSubFa(" & pSubFa & ")"
Set mRx = Qy.Execute(Devu)
SiguienteSF = mRx.Fields(0)
mRx.Close
Set mRx = Nothing
End Function

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: stored procedure vs parámetro de salida
2988
July 10, 2008 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.