when to use notnull=true and notnull=false in schema definition | Community
Skip to main content
Level 4
March 5, 2024
Solved

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

  • March 5, 2024
  • 1 reply
  • 1015 views

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by LakshmiPravallika

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-integer-field-of-data-schema/m-p/437030

 

Regards,

Pravallika.

1 reply

LakshmiPravallika
Community Advisor
LakshmiPravallikaCommunity AdvisorAccepted solution
Community Advisor
March 5, 2024

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-integer-field-of-data-schema/m-p/437030

 

Regards,

Pravallika.