473,385 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

passing Oracle Nulls in ADO.NET

how do you pass a null into an oracle parameter?

i am doing the following which works fine when there is data to be passed in
but when the string is blank it wont accept "" or even as a system.dbnull

'Parameter for Address1

Dim parAddress1 As OracleClient.OracleParameter

parAddress1 = cmdInsert.Parameters.Add("strAddress1",
OracleClient.OracleType.VarChar)

parAddress1.Direction = ParameterDirection.Input

parAddress1.Value = Strings.UCase(strAddress1)

if have tried doing something like this

If strAddress1 = "" Then

parAddress1.Value = myDBNull (which is simply a variable as type
system.dbnull)

end if

but still no joy

Cheers,
Craig
Nov 19 '05 #1
1 1149
sorry guys wrong forum!!!
"Craig G" <craig.gamble@y_arrasoftware.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
how do you pass a null into an oracle parameter?

i am doing the following which works fine when there is data to be passed in but when the string is blank it wont accept "" or even as a system.dbnull

'Parameter for Address1

Dim parAddress1 As OracleClient.OracleParameter

parAddress1 = cmdInsert.Parameters.Add("strAddress1",
OracleClient.OracleType.VarChar)

parAddress1.Direction = ParameterDirection.Input

parAddress1.Value = Strings.UCase(strAddress1)

if have tried doing something like this

If strAddress1 = "" Then

parAddress1.Value = myDBNull (which is simply a variable as type
system.dbnull)

end if

but still no joy

Cheers,
Craig

Nov 19 '05 #2

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

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
3
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where...
8
by: Tavish Muldoon | last post by:
At a high level - what would be involved in switching from Oracle to DB2? Pretty vague, I know - but anyone have experience with this kind of migration? Pointers? Things to look for? Tmuld
2
by: Simon Harvey | last post by:
Hi everyone, I'm having a really simple problem - I can't seem to insert a null value into the database. When I do it tells me that the procedure expects the parameter and that I'm not providing...
61
by: academic | last post by:
When I declare a reference variable I initialize it to Nothing. Now I'm wondering if that best for String variables - is "" better? With Nothing I assume no memory is set aside nor GC'ed But...
6
by: Paul M | last post by:
Hi All, I'm currently writing a z/OS DB2 Stored Proc in C, using an example from the IBM Stored Procedure guide (SG24-7083-00). The database calls to read and update the database work...
1
by: chintannshah | last post by:
I have an access front end with an Oracle backend. The problem I have run into is that there are static lookups in textboxes all over the app. In these lookups it has static criteria (i.e....
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
0
debasisdas
by: debasisdas | last post by:
RESTRICTIONS ON CURSOR VARIABLES ================================= Currently, cursor variables are subject to the following restrictions: Cannot declare cursor variables in a package spec. ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.