471,593 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,593 software developers and data experts.

Can't save BLOB field with Stored Procedure but with Command Text !

I'm trying to save a jpg file of 300KB as a BLOB field in an Oracle
10g Database.
If I try to call a Stored Procedure, it fails.
If I use CommandText with SQL sentence, it success.

I can't save the jpg file as a BLOB field using this Method (I'm
calling a Stored Procedure):

Private Sub save_BLOB(ByVal Photo As Byte())
Dim conOP As OracleConnection = ClasesOP.oraConexion()
Dim Tran As OracleTransaction = conOP.BeginTransaction
Dim cm As New OracleCommand
cm = conOP.CreateCommand()
cm.Transaction = Tran
cm.CommandText = "MyPkg.sp_Save_Blob"
cm.CommandType = CommandType.StoredProcedure

cm.Parameters.Add(New OracleParameter("i_MyID",
OracleType.Int32)).Value = Session("MyID")
cm.Parameters.Add(New OracleParameter("i_img_simbolo",
OracleType.Blob)).Value = Photo
Catch ex As Exception
Throw ex
End Try

End Sub

But if I use this CommandText instead of calling a Stored Procedure, I
can save the BLOB field :

cm.CommandText = "Update TBL_OP Set IMG_SIMBOLO_OP =
:i_img_simbolo WHERE Cod_OP = " + Session("MyID")
cm.CommandType = CommandType.Text

cm.Parameters.Add(New OracleParameter("i_img_simbolo",
OracleType.Blob)).Value = Photo

It is something to do with the size of the file. If the size of jpg
file is less than 30KB, it's OK. I can save it as a BLOB field using
Stored Procedure or CommandText using SQL sentence.
However, I need to call allways a Stored Procedure, not SQL sentences
from ASPX pages.
How could I accomplish that, please?

Nov 20 '06 #1
0 2210

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Chris Fink | last post: by
9 posts views Thread by charliewest | last post: by
5 posts views Thread by Øyvind Isaksen | last post: by
6 posts views Thread by scottyman | last post: by
3 posts views Thread by =?Utf-8?B?ZGF2aWQ=?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.