1

I have an db which has two table: note and category. There is a schema below for my tables. I want to insert a record to the note table but I'm getting this error below. Can anyone please help? enter image description here

Here is the method I create for insert a record to note table and the error which I'm getting from this process.

enter image description here

1 Answer 1

1

It clearly states that you declared your category_id as NOT NULL but you are passing a null value while trying to insert a note.

There may be 2 approach here,

  1. You can simply remove NOT NULL constraint from your table definition by modifiying "category_id" INTEGER NOT NULL DEFAULT 1 to "category_id" INTEGER DEFAULT 1
  2. You should really be sure that you are passing a non-null value to category_id in insert operation

As I see from your logs, it clearly says that one of the argument you are passing is null and it causes this crash.

Hope these helps you to detect your problem and fix it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.