If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > How can I call a Oracle SP with a recordset parameter ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-24-03, 08:24
dmsousa dmsousa is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
Exclamation How can I call a Oracle SP with a recordset parameter ?

I maked a store procedure at Oracle 8 that have a InputOutput object as parameter, I donīt know how the exact form to pass my recordset to this store procedure. I tried to use this VB code below.

I got the error "Runt-time error 3001 - Arguments are of the worng type, are out of acceptable range, or are in conflict with another." at line
"Set AdoParamRet = .CreatePar....."



`---------- conection -------

Public AdoConn As New ADODB.Connection
AdoConn .Provider = "OraOLEDB.Oracle.1"
AdoConn .ConnectionString = "Data Source=Oracle8;User ID=teste;Password=xxxx;"
AdoConn .Open

`--------------------------------

Private Sub Command1_Click()

Dim vlSql As String
Dim vfRsEmb As New ADODB.Recordset
Dim vfRsEmbRet As New ADODB.Recordset

Public AdoComm As New ADODB.Command
Dim AdoParamRet As ADODB.Parameter

' -----------------------------------------------------------------

vlSql = "select NR_EMB, NR_OPER_CAMBIO, DT_EMB, NR_NOSSA_REF, NM_IMPORTADOR, NR_ERRO, DS_ERRO "
vlSql = vlSql & " FROM PROEX.TPP_EMBARQUE_AUX"

vfRsEmb.Open vlSql, AdoConn, adOpenStatic, adLockOptimistic

' ------------------------------------------------------------------


With AdoComm
.CommandText = "{call PROEX.KPP_LFE.PPP_INSTPP_EMBARQUE_AUX(?)}"
.CommandType = adCmdStoredProc

Set AdoParamRet = .CreateParameter("Retorno", adBSTR, adParamInputOutput, , vfRsEmb)

Call .Parameters.Append(AdoParamRet)

.Properties("PLSQLRSet") = True

Set vfRsEmbRet = .Execute

End With

end sub

`--------------------------------------------------------

Do I need to put here the SP code ?

thanks ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On