472,993 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

Hello,
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()
conOP.Open()
Dim Tran As OracleTransaction = conOP.BeginTransaction
Dim cm As New OracleCommand
cm = conOP.CreateCommand()
cm.Transaction = Tran
cm.Parameters.Clear()
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
Try
cm.ExecuteNonQuery()
Tran.Commit()
Catch ex As Exception
Throw ex
End Try

cm.Dispose()
conOP.Close()
conOP.Dispose()
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 2303

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
3
by: Mo | last post by:
Hi, I have a webform which has vb.net code behind it and I would like it to submit the entries in the fields into a sql server db using a stored procedure. I have a central .vb file in my...
9
by: charliewest | last post by:
Hello - I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#) is there any way to temporarily save an image to a session object, and after running some other operations, later...
5
by: Řyvind Isaksen | last post by:
I have a page with an optional integer-field, and one asp:calendar control. I use a stored procedure to save the data in SQL Server. When all fields contains data, the code works great! But if the...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
5
by: natzol | last post by:
Is there a way to run query, make file out of query (txt,csv or xls - for example) and save it as a blob into the table column type Image/Text? Any thoughts would be greatly appreciated. ...
8
by: Ivan | last post by:
Hi I am new in DB2, and I have some problems when I try run stored procedures, and others statements. I made one stored procedure very simple, but this show different messages. I have followed...
0
by: Big George | last post by:
I'm developing with ASP.NET, VS.NET 2003. Using Crystal Report for VS.NET DataBase: Oracle 10g I store a BLOB field in a table. This field store images, like jpg files. The Stored Procedure...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.