Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert/Update/Delete in Oracle using .NET Datasets

LuckyLuke82Nov 23 2016 — edited Nov 24 2016

Hello,

I'm not sure If I'm posting at the right place as this is my first one, but :

I'm developing VB.NET app which uses Oracle DB for manipulating data. My question is about doing Insert/Update/Delete on Oracle.

I have been folllowing exact instructions as provided in this link:

https://docs.oracle.com/cd/B28359_01/appdev.111/b28844/building_odp.htm#TDPNG40000

In chapter "Enabling Updates to the Database" & "Inserting, Deleting, and Updating Data" is explained how should Insert/Update/Delete work in .NET Datagridview control.

I tried this myself and Update works without any problems, but Insert doesn't (haven't tried delete yet, but probably I won't need It anyway). When I try to do Insert I get this error:

"ORA-01400: cannot insert NULL into ("SCHEMA"."TABLE_NAME"."COLUMN_NAME")".

I know this error means that I want to Insert Null value to my ID field, but that article doesn't provide anything about it. I Also tried many different things (such as adding a new row to Dataset object), but result is still same.

Only way that INSERT works is to manually write "INSERT INTO" SQL clause, but I have many different views in app, so I'm trying to do same as in article - It would help me with shortening my code a lot.

So, I'm wondering - Is there maybe something wrong with my DB design ? Only thing to mention here is that I created a sequences for each table, so If doing INSERT manually I need to include them in SQL statements.

I can provide my .NET code here too, to see what I did exactly - but It's exactly same as in article, a few differences only.

Thanks for any help in advance !

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2016
Added on Nov 23 2016
13 comments
1,312 views