<?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: database variable same as procedure name in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaa-p/13830767#M4861610</link>
    <description>&lt;P&gt;Odd, seems to be a bug with 17.0.11.6800, too.&lt;/P&gt;
&lt;P&gt;The behaviour is as expected when the database variable is qualified within the function:&lt;/P&gt;
&lt;PRE&gt;create or replace database variable dba.testvar bit default 0;
create or replace function dba.testvar()
returns bit
begin
    if dba.testvar = 1 then
        return(1);
    else
        return(0);
    end if;
end;
set testvar = 1;
select testvar;
select testvar(); return 1 as expected&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Feb 2022 03:05:09 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2022-02-07T03:05:09Z</dc:date>
    <item>
      <title>database variable same as procedure name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaq-p/13830766</link>
      <description>&lt;P&gt;Is this a bug in SQL Anywhere 17.0.9&lt;/P&gt;
&lt;PRE&gt;create or replace database variable testvar bit default 0;
create or replace function testvar()
returns bit
begin
    if testvar = 1 then
        return(1);
    else
        return(0);
    end if;
end;
set testvar = 1;
select testvar;
select testvar();--why this delivers 0?
&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Feb 2022 17:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaq-p/13830766</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2022-02-06T17:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: database variable same as procedure name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaa-p/13830767#M4861610</link>
      <description>&lt;P&gt;Odd, seems to be a bug with 17.0.11.6800, too.&lt;/P&gt;
&lt;P&gt;The behaviour is as expected when the database variable is qualified within the function:&lt;/P&gt;
&lt;PRE&gt;create or replace database variable dba.testvar bit default 0;
create or replace function dba.testvar()
returns bit
begin
    if dba.testvar = 1 then
        return(1);
    else
        return(0);
    end if;
end;
set testvar = 1;
select testvar;
select testvar(); return 1 as expected&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Feb 2022 03:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaa-p/13830767#M4861610</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-02-07T03:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: database variable same as procedure name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaa-p/13830768#M4861611</link>
      <description>&lt;P&gt;It seems to affect a connection-level variable in version 16 as well.
&lt;/P&gt;&lt;PRE&gt;create or replace variable testvar bit default 0;
create or replace function testvar()
returns bit 
begin
    if testvar = 1 then
        return(1);
    else
        return(0);
    end if;
end;
set testvar = 1;
select @@version, testvar, testvar();&lt;P&gt;&lt;/P&gt;
&lt;P&gt;@@version,testvar,testvar()
'16.0.0.2512',true,false&lt;/P&gt;
&lt;P&gt;@@version,testvar,testvar()
'17.0.9.4882',true,false
&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 08:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-variable-same-as-procedure-name/qaa-p/13830768#M4861611</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2022-02-07T08:35:37Z</dc:date>
    </item>
  </channel>
</rss>

