| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: "No size set for variable length data" Oracle update error with empty string in .NET
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
arvee wrote:
> Hi - I'm updating an Oracle table with an empty string and getting the
> error:
>
> An unhandled exception of type 'System.Exception' occurred in
> system.data.dll
> Additional information: Parameter 'p1': No size set for variable length data
> type: String.
>
> The column is nullable and of type varchar2(50). I'm aware that I can store
> DBNull.Value instead and Oracle won't complain, but, I was hoping to avoid
> testing and converting for that condition. It seems the .NET class lib
> should handle empty strings, no? There are times I'd like to throw the
> dataset into a datagrid control and have the user have there way with it,
> therefore, its not ideal to have to validate each string value on the
> update.
>
> Question 1: Is this a bug or am I doing something wrong?
> Question 2: If its a bug, is there an elegant workaround?
>
[snip!]
Why don't you store a NULL? Oracle will treat '' (empty string) as
NULL, and store as NULL anyway - better be prepared for it, and
treat it as such.
Oh yes - it will work when you let Oracle do the conversion(s), but some understanding of the product you are working with will only help you in creating a better product.
All documentation is on docs.oracle.com - free! Start with Concepts.
iD8DBQFCVm8QfyJ9XXMPY5URArK8AKCRsSGLCWO9VYv3YnUqLcX2rYE1DACfTcCO
f8j04ChsvUGatK4rAjP0wzY=
=nBQ1
-----END PGP SIGNATURE-----
Received on Fri Apr 08 2005 - 06:46:24 CDT
![]() |
![]() |