Add DateTime value to OracleParameter

  • Thread starter Thread starter =?iso-8859-1?Q?Norbert_P=FCrringer?=
  • Start date Start date
?

=?iso-8859-1?Q?Norbert_P=FCrringer?=

Hello there!

Why is the following use of an Oracle parameter not possible?

DateTime value = DateTime.Now;
((OracleParameterCollection)coll).AddWithValue(timestamp, value);

I get the error message "Invalid variable name!"

Regards,

Norbert
 
Hello there!

Why is the following use of an Oracle parameter not possible?

DateTime value = DateTime.Now;
((OracleParameterCollection)coll).AddWithValue(timestamp, value);

I get the error message "Invalid variable name!"

Regards,

Norbert

try this:

((OracleParameterCollection)coll).AddWithValue("timestamp", value);

This presupposes you have a procedure with a parameter called timestamp
 
Hi!
((OracleParameterCollection)coll).AddWithValue("timestamp", value);

Sorry, I forgot the quotes. I get the error message including the quotes
(without them I get of course a compiler error).

Norbert
 
Hi!


Sorry, I forgot the quotes. I get the error message including the quotes
(without them I get of course a compiler error).

Norbert

I don't have Oracle on my PC, so I can't say with certainity, but maybe the
database error is that timestamp could be a reserved word in oracle that
you need to delimit in some way. For instance in SQL server if you really
really want to call a table 'table' you'd delimit it as
 
Back
Top