<?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: Problem with Union Syntax in DataWindow in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815323#M4846166</link>
    <description>&lt;P&gt;Try asking this question on the sybase.public.powerbuilder.datawindow newsgroup on the &lt;A href="http://forums.sybase.com"&gt;forums.sybase.com&lt;/A&gt; NNTP server.&lt;/P&gt;
&lt;P&gt;Suggestion: Switch to using SQL syntax instead of the PBSELECT syntax, then you can code an actual UNION.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2011 07:25:16 GMT</pubDate>
    <dc:creator>Breck_Carter</dc:creator>
    <dc:date>2011-12-14T07:25:16Z</dc:date>
    <item>
      <title>Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaq-p/13815320</link>
      <description>&lt;P&gt;I am converting the old PowerBuilder code to the latest version and having some problem with a datawindow code which uses Union function. &lt;/P&gt;
&lt;P&gt;The old code makes union of 4 tables with 3 tables. The old code works fine but there is syntax error with the new code. The error is caused by the 0 and 'X' in the following example. Can someone tell me what should be the right syntax. Thanks.&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;retrieve&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"&lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    PBSELECT( VERSION(400)&lt;/SPAN&gt;

&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )  &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )  &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table3&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )  &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table4&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )&lt;/SPAN&gt;

&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;a&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;b&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table2&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;c&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table3&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;d&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table4&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;")&lt;/SPAN&gt;

&lt;SPAN class="s"&gt;    UNION(&lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    PBSELECT( VERSION(400)&lt;/SPAN&gt;

&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )  &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table3&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )  &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    TABLE(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table4&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;" )&lt;/SPAN&gt;

&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table1&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;a&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    0&lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    'X'&lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table3&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;d&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="s"&gt;") &lt;/SPAN&gt;
&lt;SPAN class="s"&gt;    COLUMN(NAME=~"&lt;/SPAN&gt;&lt;SPAN class="n"&gt;table4&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="o"&gt;~&lt;/SPAN&gt;&lt;SPAN class="err"&gt;"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Dec 2011 03:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaq-p/13815320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-14T03:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815323#M4846166</link>
      <description>&lt;P&gt;Try asking this question on the sybase.public.powerbuilder.datawindow newsgroup on the &lt;A href="http://forums.sybase.com"&gt;forums.sybase.com&lt;/A&gt; NNTP server.&lt;/P&gt;
&lt;P&gt;Suggestion: Switch to using SQL syntax instead of the PBSELECT syntax, then you can code an actual UNION.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 07:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815323#M4846166</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-12-14T07:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815324#M4846167</link>
      <description>&lt;P&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/2/breck-carter/"&gt;@Breck&lt;/A&gt; Carter thanks for the suggestion. Could you please tell how to switch to using SQL Syntax instead of PBSELECT? Can I simply write SQL syntax in the datawindow?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 08:14:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815324#M4846167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-14T08:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815325#M4846168</link>
      <description>&lt;P&gt;Open the DataWindow painter, switch to SQL mode and select Design-&amp;gt;Convert to Syntax from the menu bar.&lt;/P&gt;
&lt;P&gt; &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Re Problem with Union Syntax in DataWindow"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/189559iBA47F52C9109A1A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Re Problem with Union Syntax in DataWindow" alt="Re Problem with Union Syntax in DataWindow" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815325#M4846168</guid>
      <dc:creator>reimer_pods</dc:creator>
      <dc:date>2011-12-14T09:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815321#M4846164</link>
      <description>&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;depending&lt;/SPAN&gt; &lt;SPAN class="n"&gt;on&lt;/SPAN&gt; &lt;SPAN class="n"&gt;your&lt;/SPAN&gt; &lt;SPAN class="n"&gt;version&lt;/SPAN&gt; &lt;SPAN class="n"&gt;of&lt;/SPAN&gt; &lt;SPAN class="n"&gt;pb&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;this&lt;/SPAN&gt; &lt;SPAN class="n"&gt;should&lt;/SPAN&gt; &lt;SPAN class="n"&gt;be&lt;/SPAN&gt; &lt;SPAN class="n"&gt;available&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="k"&gt;while&lt;/SPAN&gt; &lt;SPAN class="n"&gt;in&lt;/SPAN&gt; &lt;SPAN class="n"&gt;the&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dw&lt;/SPAN&gt; &lt;SPAN class="n"&gt;painter&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;click&lt;/SPAN&gt; &lt;SPAN class="n"&gt;the&lt;/SPAN&gt; &lt;SPAN class="n"&gt;data&lt;/SPAN&gt; &lt;SPAN class="n"&gt;source&lt;/SPAN&gt; &lt;SPAN class="n"&gt;option&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;one&lt;/SPAN&gt; &lt;SPAN class="n"&gt;of&lt;/SPAN&gt; &lt;SPAN class="n"&gt;the&lt;/SPAN&gt; &lt;SPAN class="n"&gt;tabs&lt;/SPAN&gt; &lt;SPAN class="n"&gt;should&lt;/SPAN&gt; &lt;SPAN class="n"&gt;be&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Syntax&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;copy&lt;/SPAN&gt; &lt;SPAN class="n"&gt;the&lt;/SPAN&gt; &lt;SPAN class="n"&gt;syntax&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;convert&lt;/SPAN&gt; &lt;SPAN class="n"&gt;to&lt;/SPAN&gt; &lt;SPAN class="n"&gt;syntax&lt;/SPAN&gt; &lt;SPAN class="n"&gt;as&lt;/SPAN&gt; &lt;SPAN class="n"&gt;shown&lt;/SPAN&gt; &lt;SPAN class="n"&gt;above&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;paste&lt;/SPAN&gt; &lt;SPAN class="n"&gt;what&lt;/SPAN&gt; &lt;SPAN class="n"&gt;you&lt;/SPAN&gt; &lt;SPAN class="n"&gt;copied&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;the&lt;/SPAN&gt; &lt;SPAN class="n"&gt;syntax&lt;/SPAN&gt; &lt;SPAN class="n"&gt;tab&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;you&lt;/SPAN&gt; &lt;SPAN class="n"&gt;should&lt;/SPAN&gt; &lt;SPAN class="n"&gt;be&lt;/SPAN&gt; &lt;SPAN class="n"&gt;good&lt;/SPAN&gt; &lt;SPAN class="n"&gt;to&lt;/SPAN&gt; &lt;SPAN class="n"&gt;go&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:02:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815321#M4846164</guid>
      <dc:creator>t1950</dc:creator>
      <dc:date>2011-12-14T10:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815322#M4846165</link>
      <description>&lt;P&gt;The syntax from 12.5 Build 2511 for a union of the PB Demo DB department table looks like:&lt;/P&gt;
&lt;P&gt;retrieve="
PBSELECT( VERSION(400) TABLE(NAME=~"department~" ) COLUMN(NAME=~"department.dept_id~") COLUMN(NAME=~"department.dept_name~") COLUMN(NAME=~"department.dept_head_id~"))  &lt;BR /&gt;
UNION 
PBSELECT( VERSION(400) TABLE(NAME=~"department~" ) COLUMN(NAME=~"department.dept_id~") COMPUTE(NAME=~"'X'~") COMPUTE(NAME=~"1~"))) " update="department" updatewhere=1 updatekeyinplace=no )&lt;/P&gt;
&lt;P&gt;Notice that the 'X' and 1 column values are tagged with COMPUTE.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 15:13:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815322#M4846165</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2011-12-14T15:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815326#M4846169</link>
      <description>&lt;P&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/365/chris-keating/"&gt;@Chris&lt;/A&gt; Keating Thanks, if it was an answer, I'd accept it. The problem was because of missing COMPUTE tag.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2011 03:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815326#M4846169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-15T03:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Union Syntax in DataWindow</title>
      <link>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815327#M4846170</link>
      <description>&lt;P&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/365/chris-keating/"&gt;@Chris&lt;/A&gt; Keating Just a small question, what would be syntax if i want to write NULL. It won't accept COMPUTE(NAME=~"NULL~"). Would the NULL be exactly same as COMPUTE(NAME=~"0~")?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2011 07:36:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/problem-with-union-syntax-in-datawindow/qaa-p/13815327#M4846170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-15T07:36:51Z</dc:date>
    </item>
  </channel>
</rss>

