<?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: default parameter empty string in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838499#M4869342</link>
    <description>&lt;P&gt;Thanks John, but this is not the issue. The default parameter did never take the value NULL&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 10:29:19 GMT</pubDate>
    <dc:creator>kakom</dc:creator>
    <dc:date>2024-05-13T10:29:19Z</dc:date>
    <item>
      <title>default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaq-p/13838492</link>
      <description>&lt;P&gt;I have a stored procedure like this:&lt;/P&gt;
&lt;PRE&gt;create procedure "dba"."xxx"( in @param1 integer,in @param2 integer,in @param3 varchar(4096) default '' ) 
begin
  if @param3 = '' then
/* ... */
  else
/* ... */
  end if
end
&lt;/PRE&gt;

&lt;P&gt;Since a long time this worked well as expected. Actually a customer reported a problem and I noticed by testing the following call:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;call dba.xxx(11,1)
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;@param3 comes with value '0'. 
I am really suprised. Under which circumstances is the default value not reliable?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 08:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaq-p/13838492</guid>
      <dc:creator>kakom</dc:creator>
      <dc:date>2024-05-13T08:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838495#M4869338</link>
      <description>&lt;P&gt;SQL Anywhere version is 17.0.11.7458&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 08:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838495#M4869338</guid>
      <dc:creator>kakom</dc:creator>
      <dc:date>2024-05-13T08:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838496#M4869339</link>
      <description>&lt;P&gt;Additional Info:
After the @param3 was specified once:
call dba.xxx(11,1,'what the hell?')
in the next call
call dba.xxx(11,1)
@param3 came with the last specified value 'what the hell?'&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:10:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838496#M4869339</guid>
      <dc:creator>kakom</dc:creator>
      <dc:date>2024-05-13T09:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838493#M4869336</link>
      <description>&lt;P&gt;With 17.0.11.7672, default parameters work as expected, and I have never had issued with those in previous versions.&lt;/P&gt;
&lt;P&gt;Even an identially named connection variable does not interfere with parameters, and the results are as expected:&lt;/P&gt;
&lt;PRE&gt;create or replace variable @param3 varchar(4096) = 'Dummy variable might get in the way';
create or replace procedure "dba"."xxx"( in @param1 integer,in @param2 integer,in @param3 varchar(4096) default '' ) 
begin
  if @param3 = '' then
     select '@param3 is empty string';
  else
     select '@param3: "' || @param3 || '".';
  end if;
end;
select @param3;                 -- returns 'Dummy variable might get in the way'
call dba.xxx(1, 2);             -- returns '@param3 is empty string'
call dba.xxx(1, 2, 'What?');    -- returns '@param3: "What?".'
call dba.xxx(1, 2);             -- returns '@param3 is empty string'
call dba.xxx(1, 2, default);    -- returns '@param3 is empty string'
call dba.xxx(1, 2, null);       -- returns '@param3: "".'
&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 May 2024 09:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838493#M4869336</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2024-05-13T09:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838497#M4869340</link>
      <description>&lt;P&gt;Thanks for answering!
My tests where done with the database components from NativeDB (Third party component by Liodden Data).
With sqlanywhere Interactive SQL I have the expected results, as you told.
No good result for me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:44:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838497#M4869340</guid>
      <dc:creator>kakom</dc:creator>
      <dc:date>2024-05-13T09:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838494#M4869337</link>
      <description>&lt;P&gt;Did you or your customer connect via TDS? If so, I believe '' is considered equivalent to NULL and comparing anything against NULL would be false (actually 'unknown')? &lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:56:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838494#M4869337</guid>
      <dc:creator>johnsmirnios</dc:creator>
      <dc:date>2024-05-13T09:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838498#M4869341</link>
      <description>&lt;P&gt;Are you able to collect a request level log ( -zr all -zo requests.rll or via sa_server_option).  I would be interested in seeing the difference in how calls from NativeDB are being made. It has been some time, but I seem to recall that one of the "3rd party" connection options for Delphi/C++ are embedded SQL based.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 10:01:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838498#M4869341</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2024-05-13T10:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: default parameter empty string</title>
      <link>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838499#M4869342</link>
      <description>&lt;P&gt;Thanks John, but this is not the issue. The default parameter did never take the value NULL&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 10:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/default-parameter-empty-string/qaa-p/13838499#M4869342</guid>
      <dc:creator>kakom</dc:creator>
      <dc:date>2024-05-13T10:29:19Z</dc:date>
    </item>
  </channel>
</rss>

