<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How user defined data type treat the null values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-user-defined-data-type-treat-the-null-values/m-p/558543#M21451</link>
    <description>&lt;P&gt;According to the documentation. using sp_addtype, we specifying null type The null type determines how the user-defined datatype treats nulls. You can create a user-defined datatype with a null type of “null”, “NULL”, “nonull”, “NONULL”, “not null”, or “NOT NULL”.&lt;/P&gt;
  &lt;P&gt;However, It seems NONULL or NOT NULL provided in the type definition will not prevent the type from accepting the null value. Any idea? &lt;/P&gt;
  &lt;P&gt;My test is like the following. There is no error raised when assign, the new type variable can have NULL value assigned to it. &lt;/P&gt;
  &lt;P&gt;Thank you very much. &lt;/P&gt;
  &lt;P&gt;ASE 16&lt;/P&gt;
  &lt;P&gt;1&amp;gt; sp_addtype nm , "varchar(20)", "NONULL" &lt;/P&gt;
  &lt;P&gt;2&amp;gt; go Type added. &lt;/P&gt;
  &lt;P&gt;(return status = 0) &lt;/P&gt;
  &lt;P&gt;1&amp;gt; declare @ss nm &lt;/P&gt;
  &lt;P&gt;2&amp;gt; select @ss = null &lt;/P&gt;
  &lt;P&gt;3&amp;gt; go &lt;/P&gt;
  &lt;P&gt;(1 row affected) &lt;/P&gt;
  &lt;P&gt;1&amp;gt; declare @ss nm &lt;/P&gt;
  &lt;P&gt;2&amp;gt; select @ss = null &lt;/P&gt;
  &lt;P&gt;3&amp;gt; select isnull(@ss,"NULLVAL") &lt;/P&gt;
  &lt;P&gt;4&amp;gt; go &lt;/P&gt;
  &lt;P&gt;(1 row affected) &lt;/P&gt;
  &lt;P&gt; ---------------------------------------- &lt;/P&gt;
  &lt;P&gt; NULLVAL (1 row affected) &lt;/P&gt;</description>
    <pubDate>Sun, 24 Dec 2017 19:26:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-12-24T19:26:54Z</dc:date>
    <item>
      <title>How user defined data type treat the null values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-user-defined-data-type-treat-the-null-values/m-p/558543#M21451</link>
      <description>&lt;P&gt;According to the documentation. using sp_addtype, we specifying null type The null type determines how the user-defined datatype treats nulls. You can create a user-defined datatype with a null type of “null”, “NULL”, “nonull”, “NONULL”, “not null”, or “NOT NULL”.&lt;/P&gt;
  &lt;P&gt;However, It seems NONULL or NOT NULL provided in the type definition will not prevent the type from accepting the null value. Any idea? &lt;/P&gt;
  &lt;P&gt;My test is like the following. There is no error raised when assign, the new type variable can have NULL value assigned to it. &lt;/P&gt;
  &lt;P&gt;Thank you very much. &lt;/P&gt;
  &lt;P&gt;ASE 16&lt;/P&gt;
  &lt;P&gt;1&amp;gt; sp_addtype nm , "varchar(20)", "NONULL" &lt;/P&gt;
  &lt;P&gt;2&amp;gt; go Type added. &lt;/P&gt;
  &lt;P&gt;(return status = 0) &lt;/P&gt;
  &lt;P&gt;1&amp;gt; declare @ss nm &lt;/P&gt;
  &lt;P&gt;2&amp;gt; select @ss = null &lt;/P&gt;
  &lt;P&gt;3&amp;gt; go &lt;/P&gt;
  &lt;P&gt;(1 row affected) &lt;/P&gt;
  &lt;P&gt;1&amp;gt; declare @ss nm &lt;/P&gt;
  &lt;P&gt;2&amp;gt; select @ss = null &lt;/P&gt;
  &lt;P&gt;3&amp;gt; select isnull(@ss,"NULLVAL") &lt;/P&gt;
  &lt;P&gt;4&amp;gt; go &lt;/P&gt;
  &lt;P&gt;(1 row affected) &lt;/P&gt;
  &lt;P&gt; ---------------------------------------- &lt;/P&gt;
  &lt;P&gt; NULLVAL (1 row affected) &lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 19:26:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-user-defined-data-type-treat-the-null-values/m-p/558543#M21451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-12-24T19:26:54Z</dc:date>
    </item>
  </channel>
</rss>

