473,471 Members | 4,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to save null values to blob field in database

6 New Member
Hello friends,

I am having a table Personal_Detail, and in that table i am having some fields like name, id, phone_number etc... and also with two blob fields photo1, photo2(allow null).

my condition is to save two photos, one(photo1) is must and another one(photo2) is optional...
when i am passing null value to the optional field i got the exception
ORA-01008: not all variables bound

I am using C# window application and
database - oracle

I cannot rectify the problem, could any one tell how to insert null values to bolb field in database.

thanks in advance
regards
anand
Oct 18 '08 #1
3 5772
SvenV
50 New Member
What does your query look like?
Oct 18 '08 #2
anandmms
6 New Member
What does your query look like?

Expand|Select|Wrap|Line Numbers
  1. OracleCommand cmd  = new OracleCommand("insert into personal(idno, firstphoto, secondphoto) values (:id, :first, :second)", con);
  2.             cmd.Parameters.Add(":id", OracleType.VarChar);
  3.             cmd.Parameters.Add(":first", OracleType.Blob);
  4.             cmd.Parameters.Add(":second", OracleType.Blob);
  5.             cmd.Parameters[0].Value=txt_Idno.Text;
  6.             cmd.Parameters[1].Value=photo1;
  7.             cmd.Parameters[1].Value = photo2;
//Already having one image in byte array photo1;
//photo2 is null;


when i execute this querry i got the exception
so how to insert the field photo2 with null value;
Oct 20 '08 #3
viknesh
1 New Member
To insert null value into blob field using bind variable,
say my oracleparameter is blobparam,
set null value by

blobparam=DBNull.Value
Apr 5 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Joshua Ruppert | last post by:
A section of the documentation for the isSet() function states: Also note that a NULL byte ("\0") is not equivalent to the PHP NULL constant. Where would you encounter a NULL byte? Is a null...
7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
4
by: Luis | last post by:
Hi, I can a big problem... because I have a byte data = new byte, and I need to save this to a field on my MySQL database (here I have a BLOB field) but ¿can I save it? because if I put: Insert...
4
by: dale zhang | last post by:
Hi, I have a C# web application in ASP.Net, which has a user contact info DB in MS Access. Can I add a column to each user to save pdf attachments for each user if needed? If so, how do we do...
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...
0
by: Big George | last post by:
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...
4
by: kev | last post by:
Hi folks, I have created a database to store information on equipments. During the first level of registration, there is a form that i need the user to fill up details on the equipment testing....
2
by: simonyong | last post by:
Hello, anyone I had search for few days with how to save file when user choose a file name from listbox and i will search the file from database and user can save it into their desktop what I had...
2
by: wizardry | last post by:
hello - i'm trying to insert a blob into my table, it will insert but the string that i insert when i query the inserted data returns null with 0 bytes in the column. I have other tables set...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
1
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...
0
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
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.