473,756 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 OracleConnectio n = ClasesOP.oraCon exion()
conOP.Open()
Dim Tran As OracleTransacti on = conOP.BeginTran saction
Dim cm As New OracleCommand
cm = conOP.CreateCom mand()
cm.Transaction = Tran
cm.Parameters.C lear()
cm.CommandText = "MyPkg.sp_Save_ Blob"
cm.CommandType = CommandType.Sto redProcedure

cm.Parameters.A dd(New OracleParameter ("i_MyID",
OracleType.Int3 2)).Value = Session("MyID")
cm.Parameters.A dd(New OracleParameter ("i_img_simbolo ",
OracleType.Blob )).Value = Photo
Try
cm.ExecuteNonQu ery()
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.Tex t

cm.Parameters.A dd(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 2412

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

Similar topics

11
23030
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
2281
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 application that has all the stored proc calls in it. in the Submit_Click Sub in my form.vb file, I reference the function in my central .vb file which calls the stored proc. The problem that I am having is that when I submit my form, it just...
9
9780
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 retrieve the image from the session object, convert it back to an image, and re-save it to the database? Thanks?
5
3051
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 user dont fill in the optional "price-field" (integer value), or if the user dont choose a date in the asp:calendar control, I get the message "Input string was not in a correct format". How do I save "Null" value if the price-field is blank,...
6
4896
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
5
2052
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. Thanks!
8
21086
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 the indications that have said me in answer to topics, but without positive results This is the stored procedure CREATE PROCEDURE TESTS ( )
0
5072
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 that I use to fill the report is: OPEN MyCursor FOR
3
2960
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 datatype for the file instead of using IMAGE datatype. I can not use SqlDataReader to read the data. I need your help, Thanks. -David (1) I have a table TestFile for testing: ID int FileName navrchar(255)
0
9431
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9255
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10014
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9844
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9819
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.