AM GETTING THIS ERROR PLS CAN SOMEBODY TELL ME WHATS WRONG WITH THIS CODE | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

AM GETTING THIS ERROR PLS CAN SOMEBODY TELL ME WHATS WRONG WITH THIS CODE

Cannot insert the value NULL into column 'Order_TestID', table 'Larson.dbo.Order_Test'; column does not allow nulls. INSERT fails. The statement has been terminated. Insert Into Order_Test (ProductName) Values ('Choco')

22nd Mar 2016, 9:06 AM
LARSON CHIGBU
LARSON CHIGBU - avatar
3 Answers
+ 4
The table has a column that does not allow NULLS. Check columns of your table and insert a value to all columns that do not have default value or do not allow NULL value.
30th Mar 2016, 12:34 AM
Pablo Mazzocchi
0
Ensure you assign a value to Order_TestID when inserting , it cannot be blank/null
28th Apr 2016, 8:41 AM
Brian Kamau
Brian Kamau - avatar
0
In mysql command prompt, issue following command: SHOW CREATE TABLE Larson.dbo.Order_Test; In the output shown, u can see that the column Order_TestID having a NOT NULL constraint. That means its value must be specified in INSERT statement. Mostly i guess it will be a numeric datatype (INT). So, give it an integer value.
4th Sep 2016, 7:23 AM
Nagarajan Chinnasamy
Nagarajan Chinnasamy - avatar