<?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 Re: SQL request for single object parameters in Collaboration with other software</title>
    <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147366#M16249</link>
    <description>Hi Joachim,&lt;BR /&gt;
&lt;BR /&gt;
I was going crazy trying to get this to work ... and it turns out that the ArchiCAD SQL interpretter only allows single quote for text strings... I was using double quotes for half an hour!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
The attached is an example that works to display the value of the 'A' parameter for all placed instances of a particular chair:&lt;BR /&gt;

&lt;PRE&gt;select flc.parameters.name, flc.parameters.value  from flat(objects,parameters) as flc
where (library_part_name='Armchair 01 12') and (flc.parameters.variable_name = 'A' )&lt;/PRE&gt;

I tried using the parameter value ('value')in the where clause, but it is of type 'gdlvariant' (permitting text, integer, floating point, etc) - and the only way to get a valid comparison is to use a type coercion function ... and I could not find any that were accepted by the interpreter.  If you happen to figure that out, please post.&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
    <pubDate>Sun, 04 Jan 2009 20:27:04 GMT</pubDate>
    <dc:creator>Karl Ottenstein</dc:creator>
    <dc:date>2009-01-04T20:27:04Z</dc:date>
    <item>
      <title>SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147364#M16247</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Is it possible to make a SQL request for a single parameter of a GDL object?&lt;BR /&gt;
The following request gives back only the whole column of the parameters names:&lt;BR /&gt;
"SELECT XX.PARAMETERS.NAME FROM FLAT(OBJECTS, PARAMETERS) AS XX"&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 04 Jan 2009 12:29:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147364#M16247</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2009-01-04T12:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147365#M16248</link>
      <description>Check the section on SQL on Page 52 in the &lt;FONT color="#001bff"&gt;04 AC 12 Calculation Guide.pdf&lt;/FONT&gt; file in the Documentation folder within the ArchiCAD folder.&lt;BR /&gt;
It will give you some additional info that may help.</description>
      <pubDate>Sun, 04 Jan 2009 19:33:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147365#M16248</guid>
      <dc:creator>Laszlo Nagy</dc:creator>
      <dc:date>2009-01-04T19:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147366#M16249</link>
      <description>Hi Joachim,&lt;BR /&gt;
&lt;BR /&gt;
I was going crazy trying to get this to work ... and it turns out that the ArchiCAD SQL interpretter only allows single quote for text strings... I was using double quotes for half an hour!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_rolleyes.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
The attached is an example that works to display the value of the 'A' parameter for all placed instances of a particular chair:&lt;BR /&gt;

&lt;PRE&gt;select flc.parameters.name, flc.parameters.value  from flat(objects,parameters) as flc
where (library_part_name='Armchair 01 12') and (flc.parameters.variable_name = 'A' )&lt;/PRE&gt;

I tried using the parameter value ('value')in the where clause, but it is of type 'gdlvariant' (permitting text, integer, floating point, etc) - and the only way to get a valid comparison is to use a type coercion function ... and I could not find any that were accepted by the interpreter.  If you happen to figure that out, please post.&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Sun, 04 Jan 2009 20:27:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147366#M16249</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-04T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147367#M16250</link>
      <description>&lt;BLOCKQUOTE&gt;laszlonagy wrote:&lt;BR /&gt;Check the section on SQL on Page 52 in the &lt;FONT color="#001bff"&gt;04 AC 12 Calculation Guide.pdf&lt;/FONT&gt; file in the Documentation folder within the ArchiCAD folder.&lt;BR /&gt;
It will give you some additional info that may help.&lt;/BLOCKQUOTE&gt;

From his example that calls the flattened table 'XX', it is likely that Joachim was working from those pages...&lt;BR /&gt;
&lt;BR /&gt;
But, thanks, Laszlo for pointing out this reference!  The 5 pages there are an excellent tutorial for the SQL feature which was introduced in ArchiCAD 8.0 with no documentation at that time.  I did not realize that something had finally been written up since then...and I see these same pages in the AC 10 and AC 11 Calculation Guide.  So, good news!  &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl</description>
      <pubDate>Sun, 04 Jan 2009 20:36:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147367#M16250</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-04T20:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147368#M16251</link>
      <description>Attached is the GS SQL reference, extracted from the AC 12 ODBC help chm as a PDF.  No time to review myself just yet, but when ODBC and SQL arrived with 8.0, the syntax for each was slightly different, so may still be so.  But, the pages that Laszlo pointed us to further point to the ODBC documentation for the Graphisoft SQL guide, so hopefully this will help.&lt;BR /&gt;
&lt;BR /&gt;
(It is a little odd that the ODBC help, including this syntax, is in a Microsoft Windows CHM format help file, that is not accessible to Mac users - even though the SQL Query window does work on mac.  It is only ODBC that is Windows-only.)&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl</description>
      <pubDate>Sun, 04 Jan 2009 21:05:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147368#M16251</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-04T21:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147369#M16252</link>
      <description>Thanks Laszlo, Thanks Karl.&lt;BR /&gt;
Yes, I used the Calculation Guide. And as you write it, Karl, I remember the SQL Guide, that I downloaded some years ago.&lt;BR /&gt;
I still have acess to Windows, so it wil be no problem for me, to read it.&lt;BR /&gt;
I hope it will help and I will post if I find out news.&lt;BR /&gt;
Thank You again!</description>
      <pubDate>Sun, 04 Jan 2009 21:14:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147369#M16252</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2009-01-04T21:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147370#M16253</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;laszlonagy wrote:&lt;BR /&gt;Check the section on SQL on Page 52 in the &lt;FONT color="#001bff"&gt;04 AC 12 Calculation Guide.pdf&lt;/FONT&gt; file in the Documentation folder within the ArchiCAD folder.&lt;BR /&gt;
It will give you some additional info that may help.&lt;/BLOCKQUOTE&gt;

From his example that calls the flattened table 'XX', it is likely that Joachim was working from those pages...&lt;BR /&gt;
&lt;BR /&gt;
But, thanks, Laszlo for pointing out this reference!  The 5 pages there are an excellent tutorial for the SQL feature which was introduced in ArchiCAD 8.0 with no documentation at that time.  I did not realize that something had finally been written up since then...and I see these same pages in the AC 10 and AC 11 Calculation Guide.  So, good news!  &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl&lt;/BLOCKQUOTE&gt;

I originally wrote this short introduction for Graphisoft for AC9 and it has not changed since. As stated there, there is a lot more that can be done with SQL than is described in those few pages.&lt;BR /&gt;
But thanks for chiming in Karl, I think you are probably the one who knows the most of SQL in practice.</description>
      <pubDate>Sun, 04 Jan 2009 21:17:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147370#M16253</guid>
      <dc:creator>Laszlo Nagy</dc:creator>
      <dc:date>2009-01-04T21:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147371#M16254</link>
      <description>&lt;BLOCKQUOTE&gt;laszlonagy wrote:&lt;BR /&gt;I originally wrote this short introduction for Graphisoft for AC9 and it has not changed since.&lt;/BLOCKQUOTE&gt;

I'm glad that they had you do that!  (And, sorry I had not noticed it!  I was so used to the Calculate Guide getting no improvements, that I stopped looking closely at it!)&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Sun, 04 Jan 2009 22:04:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147371#M16254</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-04T22:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147372#M16255</link>
      <description>&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;
I tried using the parameter value ('value')in the where clause, but it is of type 'gdlvariant' (permitting text, integer, floating point, etc) - and the only way to get a valid comparison is to use a type coercion function ... and I could not find any that were accepted by the interpreter.  If you happen to figure that out, please post.&lt;/BLOCKQUOTE&gt;

ODBC manual (odbc.chm) describes GDLVARIANT as totally unconvertable (Graphisoft SQL Language Reference-&amp;gt;Data Type Conversion chapter). May be you can use "GDL Helper Object" trick as a workaround.&lt;BR /&gt;
&lt;BR /&gt;
Create 'SQL_Tst_1' object with 'Tst_1' variable as a parameter. Define this variable with absolutely the same type, as the type of the field you want to search for (pen number in my case). And set it to the value you want to search for. Place the object and execute this instruction:&lt;BR /&gt;
&lt;BR /&gt;
SELECT *  &lt;BR /&gt;
FROM&lt;BR /&gt;
       flat(objects,parameters) as T_1,&lt;BR /&gt;
       flat(objects,parameters) as T_2&lt;BR /&gt;
WHERE &lt;BR /&gt;
      (T_1.library_part_name = 'Built-in Elevation Marker')&lt;BR /&gt;
       and &lt;BR /&gt;
       (T_1.parameters.variable_name = 'AC_TextPen_1')&lt;BR /&gt;
       and&lt;BR /&gt;
       (T_2.parameters.variable_name = 'Tst_1')&lt;BR /&gt;
       and&lt;BR /&gt;
       (T_1.parameters.value = T_2.parameters.value) &lt;BR /&gt;
&lt;BR /&gt;
It is very important to write WHERE part carefully. We have to select rows with the same GDL type of comparable parameters.  Otherwise SQL reports a bug.</description>
      <pubDate>Mon, 05 Jan 2009 11:35:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147372#M16255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-05T11:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147373#M16256</link>
      <description>Nice trick, Leo. &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;  After I posted the PDF, I saw that chart with the lack of coercion functions for variants (unlike in most languages). Unfortunate to have to create an object like yours to perform the search, but great lateral thinking! &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl</description>
      <pubDate>Mon, 05 Jan 2009 17:42:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147373#M16256</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-05T17:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147374#M16257</link>
      <description>Hello,&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;Karl wrote:&lt;BR /&gt;(It is a little odd that the ODBC help, including this syntax, is in a Microsoft Windows CHM format help file, that is not accessible to Mac users - even though the SQL Query window does work on mac.  It is only ODBC that is Windows-only.)
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
I have used this when reading manuals 'from the dark side of the moon'&lt;BR /&gt;
&lt;A href="http://chmox.sourceforge.net/" target="_blank"&gt;&lt;/A&gt;&lt;S&gt;&lt;A href="http://chmox.sourceforge.net/" target="_blank"&gt;&lt;/A&gt;&lt;A href="&amp;lt;/s&amp;gt;http://chmox.sourceforge.net/&amp;lt;e&amp;gt;"&gt;&lt;/A&gt;&lt;/S&gt;http://chmox.sourceforge.net/&lt;E&gt;&lt;/E&gt;.&lt;BR /&gt;
&lt;BR /&gt;
Regards, Juha</description>
      <pubDate>Mon, 05 Jan 2009 21:50:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147374#M16257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-01-05T21:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL request for single object parameters</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147375#M16258</link>
      <description>Thanks for the tip/link, Juha!&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Tue, 06 Jan 2009 00:03:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/SQL-request-for-single-object-parameters/m-p/147375#M16258</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-01-06T00:03:02Z</dc:date>
    </item>
  </channel>
</rss>

