when to use notnull=true and notnull=false in schema definition | Adobe Higher Education
Skip to main content
Level 4
March 5, 2024
Répondu

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

 

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par 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 commentaire

LakshmiPravallika
Community Advisor
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.