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 > ASP > OLEDB Calling Stored Procedure via DB Link

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-04, 17:26
stathamd stathamd is offline
Registered User
 
Join Date: May 2004
Posts: 2
Angry OLEDB Calling Stored Procedure via DB Link

Hello,

Using Oracle and OLEDB I am trying to execute a stored procedure (actually a function) via a database link. When I do this OLEDB throws an "Unspecified error". The SP is fine, I can exec it via sqlplus through the link as well as in some other java code. VB.NET code below that I can't get to work. Any insight would be helpfull (and no I can't change providers...). I think the error is due to the DB Link syntax (@SMSTRANSFER.WORLD), I actually put a local copy of the schema and sp to my connection and this also works fine.



Dim smscmd As New OleDb.OleDbCommand("SUBMIT_TRANSACTION@SMSTRANSFER .WORLD", Me.twrDB, Me.transaction)
smscmd.CommandType = CommandType.StoredProcedure

'Return Value
smscmd.Parameters.Add("RETURN_VALUE", OleDb.OleDbType.VarChar, 100).Direction = ParameterDirection.ReturnValue

'Input Parameters
smscmd.Parameters.Add("limsIds", OleDb.OleDbType.VarChar, 100).Value = inBarcodes
smscmd.Parameters.Add("parameterIds", OleDb.OleDbType.VarChar, 100).Value = "1"
smscmd.Parameters.Add("parameterValues", OleDb.OleDbType.VarChar, 100).Value = inSMSParentIDs
smscmd.Parameters.Add("applicationId", OleDb.OleDbType.VarChar, 100).Value = "3"
smscmd.Parameters.Add("userLoginId", OleDb.OleDbType.VarChar, 100).Value = inMpersonID

smscmd.ExecuteNonQuery()
Reply With Quote
  #2 (permalink)  
Old 05-12-04, 15:14
stathamd stathamd is offline
Registered User
 
Join Date: May 2004
Posts: 2
Talking Did it the "hard" way

Solved my own problem, but had to do as SQL, couldn't use the CommandType.StoredProcedure:

smscmd.CommandType = CommandType.Text
smscmd.CommandText = "BEGIN ? := SUBMIT_TRANSACTION@SMSTRANSFER.WORLD(?,?,?,?,?); END;"

'Return Value
smscmd.Parameters.Add("RETURN_VALUE", OleDb.OleDbType.VarChar, 100).Direction = ParameterDirection.Output

'Input(Parameters)
smscmd.Parameters.Add("limsIds", OleDb.OleDbType.VarChar, 100).Value = inBarcodes
smscmd.Parameters.Add("parameterIds", OleDb.OleDbType.VarChar, 100).Value = "1"
smscmd.Parameters.Add("parameterValues", OleDb.OleDbType.VarChar, 100).Value = inSMSParentIDs
smscmd.Parameters.Add("applicationId", OleDb.OleDbType.VarChar, 100).Value = "3"
smscmd.Parameters.Add("userLoginId", OleDb.OleDbType.VarChar, 100).Value = inMpersonID
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On