null fields in oracle
Posted: Tue 14 Aug 2012 02:26
I am using both SQL Server and Oracle in an application. The user chooses which one on login, and they are connected to their database.
We have the same virtually identical tables and fields in both sql server and oracle. Many fields are set to NOT NULL. I store a ' ', blank space to the fields that are empty, to make them not null. If I do so with an insert statement, it works fine in both products. If I do so with a TUniQuery, and set the field (qry.FieldByName('myfield').asString := ' ') the field get's trimmed anyway.
This happens in both sql server and Oracle. Sql Server considers the field not null, but Oracle doesn't and throws up an error ora-01400 cannot insert NULL into ... basically the same field I just tried to set to ' ' a blank space.
Is there a setting I need to set some where to keep the blank space?
Thanks!
We have the same virtually identical tables and fields in both sql server and oracle. Many fields are set to NOT NULL. I store a ' ', blank space to the fields that are empty, to make them not null. If I do so with an insert statement, it works fine in both products. If I do so with a TUniQuery, and set the field (qry.FieldByName('myfield').asString := ' ') the field get's trimmed anyway.
This happens in both sql server and Oracle. Sql Server considers the field not null, but Oracle doesn't and throws up an error ora-01400 cannot insert NULL into ... basically the same field I just tried to set to ' ' a blank space.
Is there a setting I need to set some where to keep the blank space?
Thanks!