(WHERE ARE GURUS?)Inserting Null in Oracle databs, using UpdateDat

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

<this is a repost as i did not get an answer from the ado.net group>
I want to use UpdateDataset method to update more than 1 rows at any time.
The database is Oracle 9x
Namespace/provider is System.Data.OracleClient;

The problem is there are times that a string or a numberic column in the
dataset has null values. So when such scenario arises, i get an error like
below...
{"ORA-06550: line 1, column 7:\nPLS-00703: multiple instances of named
argument in list\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored\n" }

Does any one know how can this situation be resolved? Can this error be due
to the dact that i am inserting null values in oracle.. or because of some
other thing?

yes i want to store Null values in the db. I have modified the default XSD
to change the values for DBNull, but even then i am getting this error. I
heard from some one that in oracle i have to specifically give the parameter
type as dbnull if it is a
null value in the row-colum, but since i want to use the UpdateDataset method
for bulk updates, i can not check this condition before hand.

Let me know if anyone has any options.
I read up an article at http://support.microsoft.com/?kbid=837816 which is
close to this problem of mine and i beleive that the error is because of null
values (though i may be wrong).

Best Regards,
Hitesh
 
Don"t know about Oralce but a good starting point wiould likely to be able
to trace the statement sent to Oracle to see why the SQL statement is not
correct (multiple times the same argument name , once again I'ont know much
about Oracle).

Patrice
 
Hi BEamer,

Ofcourse, I know about the stored proc options, and the parameter options..
to teh command object.

but there are certain cases when i am getting the below error.. mostly when
null is being passed. and since i am not updating each row wise i am unable
to dynamically determine if it is a null and change the paramater type to
DBType.DBNull instead of DTType.String.
 
Take control of your data operations. Just because you are using the
DataAdapter.Update() automagic method does not mean you cannot control the
way it is handled. The data adapter allows you to use a stored proc (good)
and specify parameters (also good), so you are not stuck with the
CommandBuilder Frankenstein.

Now, depending on the version of Oracle you are on, you may still have
issues. ODP.NET, from Oracle (free download) is a better option than
OracleClient in these cases.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top