Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cannot insert the value NULL into column

I am joining Excel data and DB table data using tMap with ID as key. With this, DB table has to pull couple of column's more with the help of Key to Output but i am getting below error. Please suggest.

 

Cannot insert the value NULL into column 'MRN', table 'XYZ'; column does not allow nulls. INSERT fails.

 

Actually there's no null value in DB table data, but its still showing cant insert null value in MRN

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

No... there is no null value for MRN in Demographics.

 

I have seen some mismatch in field length. MRN in Demographics is having length as String(20)  but the target table is having the length as nvarchar(50). Does this causing null values? 

View solution in original post

13 Replies
manodwhb
Champion II
Champion II

@samisyed80,since you were getting empty value for MRN column in XYZ table from source. you need to do the some default values.

 

row1.col==null?"ABC":row1.col

TRF
Champion II
Champion II

Seems the columns MRN of the table XYC is declared with the NOT NULL constraint so you MUST give a value for this field when you try to insert a new row. There is no choice.

Why do you have a null value if the input table has not?

Unable to answer while you don't share your job design with the tMap.

Anonymous
Not applicable
Author

MRN is coming from the demographics table given below. Also find the tMap properties. Unfortunately, the target table is having zero rows.

 

 

manodwhb
Champion II
Champion II

@samisyed80, you do not have the matched records between excel file and demographics ,since you were getting as null.

Anonymous
Not applicable
Author

Manohar, Yes there is. Its ID a common field

manodwhb
Champion II
Champion II

@samisyed80,then do you have null values for MNR in demographics ?

Anonymous
Not applicable
Author

No... there is no null value for MRN in Demographics.

 

I have seen some mismatch in field length. MRN in Demographics is having length as String(20)  but the target table is having the length as nvarchar(50). Does this causing null values? 

manodwhb
Champion II
Champion II

@samisyed80,if you are sure about there is no null values in MNR means ,your joining data is not matching please check.

Anonymous
Not applicable
Author

No... there is no null value for MRN in Demographics.

 

I have seen some mismatch in field length. MRN in Demographics is having length as String(20)  but the target table is having the length as nvarchar(50). Does this causing null values?