PC Review


Reply
Thread Tools Rate Thread

Stored Procedure Oracle + Clob + Vb.Net

 
 
jbolanos@co.soluziona.com
Guest
Posts: n/a
 
      29th Jul 2004
I want to call a stored procedure with input parameter of Clob type
from Vb.net, I have had many problems and looks for in google and
locate a solution that Tomas Westhed gave in 2002-05-28. I cosay that
it did was:

Dim tx As OracleTransaction
tx = cn.BeginTransaction()

Dim cmd As New OracleCommand()
cmd = cn.CreateCommand()

cmd.Transaction = tx

cmd.CommandText = "declare xx Clob; begin " & _
"dbms_lob.createtemporary(xx, false, 0); :tempClob := xx;
end;"
cmd.Parameters.Add(New OracleParameter("tempClob",
OracleType.Clob)).Direction = ParameterDirection.Output
Try
cmd.ExecuteNonQuery()

Dim tempLob As OracleLob
tempLob = cmd.Parameters(0).Value

clobstring = <Any XML String>

cmd.Parameters.Clear()
cmd.CommandText = "dbms_lob.write"
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OracleParameter("lob_loc",
OracleType.Clob)).Direction = ParameterDirection.Input
cmd.Parameters("lob_loc").Value = tempLob
cmd.Parameters.Add(New OracleParameter("amount",
OracleType.Byte)).Direction = ParameterDirection.Input
cmd.Parameters("amount").Value = clobstring.Length
cmd.Parameters.Add(New OracleParameter("offset",
OracleType.Number)).Direction = ParameterDirection.Input
cmd.Parameters("offset").Value = 1
cmd.Parameters.Add(New OracleParameter("buffer",
OracleType.VarChar)).Direction = ParameterDirection.Input
cmd.Parameters("buffer").Value = clobstring

We then use cmd.Parameters(0).Value as a in-parameter for our stored
procedure.

I have done the same but I do not understand like calling the stored
procedure that is like using cmd.Parameters(0).Value.

I thank for any aid
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ACCESS/ORACLE CLOB datatype-export ACCESS report to EXCEL CLOB tru Lynn Microsoft Access Form Coding 0 18th Jul 2008 04:01 PM
Oracle stored procedure vs. functions? is not a procedure or is undefined jobs Microsoft ADO .NET 1 10th Jan 2007 03:35 PM
Pass an array to an Oracle stored procedure using Microsoft's client for Oracle michelle.m.talt@gmail.com Microsoft ADO .NET 0 16th Jun 2006 04:34 PM
calling oracle stored function with CLOB parameter Jlorga Microsoft Excel Programming 0 3rd Mar 2006 12:58 PM
VB.NET passing CLOB input parameter to Oracle stored function A B Microsoft ADO .NET 0 19th Jul 2004 11:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 PM.