Expand my Community achievements bar.

SOLVED

when to use notnull=true and notnull=false in schema definition

Avatar

Level 4

 

Hi All,

 

Pleasse help to understand when to use 

when to use notnull=true and notnull=false in schema definition

and if we put notnull=true ,what is the difference it make and if we put notnull=false what will hapeen on that particualr field

 

<attribute desc="CSLS_SourceTimestamp" label="CSLS_SourceTimestamp" name="CSLS_SourceTimestamp"
notNull="false" sqlname="CSLS_SourceTimestamp" type="datetime"/>

 

 

@Parvesh_Parmar ,@AkshayAnand 

,@isahore ,@AndreaBriceno,@ParthaSarathy

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

 

If we give notNull="false", it will not allow null values in that Particular column where as if we give notNull="true", it will  allow null values in that particular column where we defined.

 

Generally we need to define all the Integer columns so that it wont allow NULL Values instead '0' should be populated , and for string Datatypes the Null values can be allowed.

 

 

Also for this use case:

<attribute desc="CSLS_SourceTimestamp" label="CSLS_SourceTimestamp" name="CSLS_SourceTimestamp"
notNull="false" sqlname="CSLS_SourceTimestamp" type="datetime"/>

 

It will not allow null values as  for the attribute "CSLS_SourceTimestamp" the notNull="false" is defined.

 

You can test it by inserting a record without any value in Datetime field.

 

Also please refer to the below solved post

 

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/null-value-in-inte...

 

Regards,

Pravallika.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @DishaSharma ,

 

If we give notNull="false", it will not allow null values in that Particular column where as if we give notNull="true", it will  allow null values in that particular column where we defined.

 

Generally we need to define all the Integer columns so that it wont allow NULL Values instead '0' should be populated , and for string Datatypes the Null values can be allowed.

 

 

Also for this use case:

<attribute desc="CSLS_SourceTimestamp" label="CSLS_SourceTimestamp" name="CSLS_SourceTimestamp"
notNull="false" sqlname="CSLS_SourceTimestamp" type="datetime"/>

 

It will not allow null values as  for the attribute "CSLS_SourceTimestamp" the notNull="false" is defined.

 

You can test it by inserting a record without any value in Datetime field.

 

Also please refer to the below solved post

 

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/null-value-in-inte...

 

Regards,

Pravallika.