<?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>Question Re: INSERT errors out in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397049#M4942227</link>
    <description>&lt;P&gt;What was &lt;EM&gt;tempdb's&lt;/EM&gt; setting for&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; at the time the table was created?&amp;nbsp; Had you set&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; to &lt;EM&gt;&lt;STRONG&gt;'false'&lt;/STRONG&gt;&lt;/EM&gt; at some time in the past?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Running &lt;EM&gt;&lt;STRONG&gt;sp_dboption tempdb, 'allow nulls by default', 'true'&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; will affect future column creations; it will not modify columns that have already been created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What does &lt;EM&gt;&lt;STRONG&gt;sp_help&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;abcatedt&lt;/STRONG&gt;&lt;/EM&gt; show as the NULLability for column&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;abe_edit&lt;/STRONG&gt;&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After running &lt;EM&gt;&lt;STRONG&gt;sp_dboption tempdb, 'allow nulls by default', 'true' &lt;/STRONG&gt;&lt;/EM&gt;, if you drop and recreate the table, does your code work (ie, the column will now accept NULLs)?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2026 11:50:53 GMT</pubDate>
    <dc:creator>Mark_A_Parsons</dc:creator>
    <dc:date>2026-05-15T11:50:53Z</dc:date>
    <item>
      <title>INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaq-p/14396640</link>
      <description>&lt;P&gt;Hi, ALL,&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;queries.push_back( L"IF NOT EXISTS(SELECT 1 FROM sysobjects WHERE name = 'abcatedt' AND type = 'U') EXECUTE(\"CREATE TABLE abcatedt(abe_name char(30) NOT NULL, abe_edit char(254), abe_type smallint, abe_cntr integer, abe_seqn smallint NOT NULL, abe_flag integer, abe_work char(32), PRIMARY KEY( abe_name, abe_seqn ))\")" );&lt;/P&gt;&lt;P&gt;queries.push_back( L"IF NOT EXISTS(SELECT o.name, i.name FROM sysobjects o, sysindexes i WHERE o.id = i.id AND o.name = 'abcatedt' AND i.name = 'abcate_x') EXECUTE(\"CREATE UNIQUE INDEX abcate_x ON abcatedt(abe_name ASC, abe_seqn ASC) WITH IGNORE_DUP_KEY\")");&lt;/P&gt;&lt;P&gt;[[/code]&lt;/P&gt;&lt;P&gt;After running those I tried to do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;2084 for( std::vector&amp;lt;std::wstring&amp;gt;::iterator it = queries.begin(); it &amp;lt; queries.end(); ++it )&lt;BR /&gt;(gdb)&lt;BR /&gt;2086 qry.reset( new SQLWCHAR[(*it).length() + 2] );&lt;BR /&gt;(gdb)&lt;BR /&gt;2087 memset( qry.get(), '\0', (*it).length() + 2 );&lt;BR /&gt;(gdb)&lt;BR /&gt;2088 uc_to_str_cpy( qry.get(), (*it) );&lt;BR /&gt;(gdb)&lt;BR /&gt;2089 ret = SQLExecDirect( m_hstmt, qry.get(), SQL_NTS );&lt;BR /&gt;(gdb)&lt;BR /&gt;2090 if( ret != SQL_SUCCESS &amp;amp;&amp;amp; ret != SQL_SUCCESS_WITH_INFO )&lt;BR /&gt;(gdb)&lt;BR /&gt;2092 GetErrorMessage( errorMsg, STMT_ERROR );&lt;BR /&gt;(gdb)&lt;BR /&gt;2093 ret = SQLEndTran( SQL_HANDLE_DBC, m_hdbc, SQL_ROLLBACK );&lt;BR /&gt;(gdb) p (*it)&lt;BR /&gt;$1 = (std::__cxx11::basic_string&amp;lt;wchar_t, std::char_traits&amp;lt;wchar_t&amp;gt;, std::allocator&amp;lt;wchar_t&amp;gt; &amp;gt; &amp;amp;) @0x6210005e12a0: {&lt;BR /&gt;static npos = 18446744073709551615,&lt;BR /&gt;_M_dataplus = {&amp;lt;std::allocator&amp;lt;wchar_t&amp;gt;&amp;gt; = {&amp;lt;__gnu_cxx::new_allocator&amp;lt;wchar_t&amp;gt;&amp;gt; = {&amp;lt;No data fields&amp;gt;}, &amp;lt;No data fields&amp;gt;},&lt;BR /&gt;_M_p = 0x6130000dc840 L"INSERT INTO abcatedt VALUES( 'BenefitsCheckBox', NULL, 85, 4, 1, 536870916, NULL );"}, _M_string_length = 83, {&lt;BR /&gt;_M_local_buf = L"S\000\xbebebebe\xbebebebe", _M_allocated_capacity = 83}}&lt;BR /&gt;(gdb) p errorMsg.at(0)&lt;BR /&gt;$2 = (__gnu_cxx::__alloc_traits&amp;lt;std::allocator&amp;lt;std::__cxx11::basic_string&amp;lt;wchar_t, std::char_traits&amp;lt;wchar_t&amp;gt;, std::allocator&amp;lt;wchar_t&amp;gt; &amp;gt; &amp;gt;, std::__cxx11::basic_string&amp;lt;wchar_t, std::char_traits&amp;lt;wchar_t&amp;gt;, std::allocator&amp;lt;wchar_t&amp;gt; &amp;gt; &amp;gt;::value_type &amp;amp;) @0x606000233840: {&lt;BR /&gt;static npos = 18446744073709551615,&lt;BR /&gt;_M_dataplus = {&amp;lt;std::allocator&amp;lt;wchar_t&amp;gt;&amp;gt; = {&amp;lt;__gnu_cxx::new_allocator&amp;lt;wchar_t&amp;gt;&amp;gt; = {&amp;lt;No data fields&amp;gt;}, &amp;lt;No data fields&amp;gt;},&lt;BR /&gt;_M_p = 0x615000194b80 L"[SAP][ASE ODBC Driver][Adaptive Server Enterprise]The column abe_edit in table abcatedt does not allow null values.\n"}, _M_string_length = 116, {_M_local_buf = L"t\000\xbebebebe\xbebebebe", _M_allocated_capacity = 116}}&lt;BR /&gt;(gdb)&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand the error.&lt;/P&gt;&lt;P&gt;The field abe_edit should allow NULLs - it does not have "NOT NULL" clause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please sched some lights?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have SAP ASE 16..1 on Linux.&lt;/P&gt;&lt;P&gt;The connection is done thru the ODBC driver with unixODBC Driver Manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any pointers...&lt;/P&gt;&lt;P&gt;P.S.: For some reason SAP ASE tag is not available to me. If someone can fix it and place the proper tag here it would be great.&lt;/P&gt;&lt;P&gt;P.P.S.: I tried to add:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;if( !result )&lt;BR /&gt;{&lt;BR /&gt;memset( qry.get(), '\0', 200 );&lt;BR /&gt;uc_to_str_cpy( qry.get(), L"sp_dboption tempdb, 'allow nulls by default', 'true'" );&lt;BR /&gt;ret = SQLExecDirect( m_hstmt, qry.get(), SQL_NTS );&lt;BR /&gt;if( ret != SQL_SUCCESS &amp;amp;&amp;amp; ret != SQL_SUCCESS_WITH_INFO )&lt;BR /&gt;{&lt;BR /&gt;GetErrorMessage( errorMsg, STMT_ERROR );&lt;BR /&gt;result = 1;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;doesn't help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 01:47:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaq-p/14396640</guid>
      <dc:creator>oneeyeman1</dc:creator>
      <dc:date>2026-05-15T01:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397049#M4942227</link>
      <description>&lt;P&gt;What was &lt;EM&gt;tempdb's&lt;/EM&gt; setting for&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; at the time the table was created?&amp;nbsp; Had you set&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; to &lt;EM&gt;&lt;STRONG&gt;'false'&lt;/STRONG&gt;&lt;/EM&gt; at some time in the past?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Running &lt;EM&gt;&lt;STRONG&gt;sp_dboption tempdb, 'allow nulls by default', 'true'&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; will affect future column creations; it will not modify columns that have already been created.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What does &lt;EM&gt;&lt;STRONG&gt;sp_help&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;abcatedt&lt;/STRONG&gt;&lt;/EM&gt; show as the NULLability for column&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;abe_edit&lt;/STRONG&gt;&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After running &lt;EM&gt;&lt;STRONG&gt;sp_dboption tempdb, 'allow nulls by default', 'true' &lt;/STRONG&gt;&lt;/EM&gt;, if you drop and recreate the table, does your code work (ie, the column will now accept NULLs)?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 11:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397049#M4942227</guid>
      <dc:creator>Mark_A_Parsons</dc:creator>
      <dc:date>2026-05-15T11:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397188#M4942236</link>
      <description>@MarkAParsons, so every time I need to run sp_F option it has to be run against my db and tempdb?</description>
      <pubDate>Fri, 15 May 2026 14:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397188#M4942236</guid>
      <dc:creator>oneeyeman1</dc:creator>
      <dc:date>2026-05-15T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397226#M4942239</link>
      <description>&lt;P&gt;I have no idea what &lt;EM&gt;&lt;STRONG&gt;sp_F&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;is nor what it has to do with the original question of a failed insert (due to a column not allowing NULLs).&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;Have you solved the original issue (failing insert due to column not allowing NULLs)?&lt;/P&gt;&lt;P&gt;If the answer is '&lt;EM&gt;yes&lt;/EM&gt;' and you're now running into a new issue then I'd suggest asking a new question.&lt;/P&gt;&lt;P&gt;If the answer is '&lt;EM&gt;no&lt;/EM&gt;' then could you please provide answers to my previous questions.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 18:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397226#M4942239</guid>
      <dc:creator>Mark_A_Parsons</dc:creator>
      <dc:date>2026-05-15T18:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397291#M4942246</link>
      <description>&lt;P&gt;@MarkAParsons,&lt;/P&gt;&lt;P&gt;In your first reply you wrote::&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; What was &lt;EM&gt;tempdb's&lt;/EM&gt; setting for&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; at the time the table was created?&amp;nbsp; Had you set&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;'allow nulls by default'&lt;/STRONG&gt;&lt;/EM&gt; to &lt;EM&gt;&lt;STRONG&gt;'false'&lt;/STRONG&gt;&lt;/EM&gt; at some time in the past?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I didn't execute such a command. I only executed it for my DB. That's why in my reply I asked if I have to run it for the "tempdb" as well and also run every single option change in both.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sorry for the confusion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me try to run it for the "tempdb" as well and see what will happen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 19:15:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397291#M4942246</guid>
      <dc:creator>oneeyeman1</dc:creator>
      <dc:date>2026-05-15T19:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397300#M4942247</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;sp_dboption&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;is used to change the settings for a single database.&lt;/P&gt;&lt;P&gt;If you need multiple databases to have their settings changed then you need to run &lt;EM&gt;&lt;STRONG&gt;sp_dboption&lt;/STRONG&gt;&lt;/EM&gt; once for each database in question.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt;: If you're using multiple tempdb's, and they are being assigned to users in a round-robin(ish) approach, then you should insure all tempdbs have been configured the same.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2026 19:44:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397300#M4942247</guid>
      <dc:creator>Mark_A_Parsons</dc:creator>
      <dc:date>2026-05-15T19:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT errors out</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397305#M4942248</link>
      <description>@MarkAParsons, it looks like I have to run "sp_dboption tempdb, 'allow nulls by default', 'true'" AND "sp_dboption &amp;lt;myDB&amp;gt;, 'allow nulls by default', 'true'" in order to allow NULLS to be inserted. Thx. Now I presume that whenever I need to run "sp_dboption" I will have to run it for both my own db and the "tempdb".</description>
      <pubDate>Fri, 15 May 2026 20:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-errors-out/qaa-p/14397305#M4942248</guid>
      <dc:creator>oneeyeman1</dc:creator>
      <dc:date>2026-05-15T20:00:01Z</dc:date>
    </item>
  </channel>
</rss>

