<?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: ArchiCAD and SQL in Collaboration with other software</title>
    <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7542#M479</link>
    <description>&lt;BLOCKQUOTE&gt;eldhead wrote:&lt;BR /&gt;And now we want to connect OBJECT ID with LIBRARYPART PREVIEW, but how?&lt;/BLOCKQUOTE&gt;

Well, this should never be possible, as the OBJECT ID is a user defined piece of text that is part of the placed object (OBJECTS table) and not part of the LIBRARYPART (actual GDL definition).&lt;BR /&gt;
&lt;BR /&gt;
However, doing a join to obtain the preview for placed objects should be possible ... getting ANY data about placed objects for that matter should be possible, but the current table design does not allow this (I will report the problem).&lt;BR /&gt;
&lt;BR /&gt;
The LIBRARYPARTS table has the UNID field that gives the new unique identifier for a library part - that exactly identifies it, since parts with the same name can exist.  HOWEVER,  the OBJECTS table - which lists all placed objects in the file - contains only the ID (unique to that table) and the USERID (the text assigned by the user)!  It MUST have the UNID for the placed object as well to permit a proper JOIN.&lt;BR /&gt;
&lt;BR /&gt;
At present, the best you can do is to use the LIBRARY_PART_NAME field, perhaps, in the OBJECTS table and just run the risk of having parts with duplicate names.  A textual JOIN such as this is very inefficient, too.&lt;BR /&gt;
&lt;BR /&gt;
The following query will more or less get you what you want:&lt;BR /&gt;
&lt;BR /&gt;
SELECT DISTINCT PREVIEW FROM LIBRARYPARTS JOIN OBJECTS&lt;BR /&gt;
ON (LIBRARYPARTS.NAME = OBJECTS.LIBRARY_PART_NAME)&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
    <pubDate>Thu, 26 Feb 2004 20:43:07 GMT</pubDate>
    <dc:creator>Karl Ottenstein</dc:creator>
    <dc:date>2004-02-26T20:43:07Z</dc:date>
    <item>
      <title>ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7535#M472</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;hi,&lt;BR /&gt;
i'm trying to use sql for making queries to the database, but i can't quite figure out what sql-statements it understands and which ones i doesn't. does anybody have a clue or is i documentet somewhere?&lt;BR /&gt;
regards,&lt;BR /&gt;
vannassen&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Feb 2004 14:30:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7535#M472</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-02-12T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7536#M473</link>
      <description>&lt;BLOCKQUOTE&gt;vannassen wrote:&lt;BR /&gt;i'm trying to use sql for making queries to the database, but i can't quite figure out what sql-statements it understands and which ones i doesn't. does anybody have a clue or is i documentet somewhere?&lt;/BLOCKQUOTE&gt;

The local database expert is Karl Ottenstein; I am sure he will respond soon ...</description>
      <pubDate>Thu, 12 Feb 2004 18:01:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7536#M473</guid>
      <dc:creator>Djordje</dc:creator>
      <dc:date>2004-02-12T18:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7537#M474</link>
      <description>&lt;BLOCKQUOTE&gt;vannassen wrote:&lt;BR /&gt;hi,&lt;BR /&gt;
i'm trying to use sql for making queries to the database, but i can't quite figure out what sql-statements it understands and which ones i doesn't. does anybody have a clue or is i documentet somewhere?&lt;BR /&gt;
regards,&lt;BR /&gt;
vannassen&lt;/BLOCKQUOTE&gt;

The available tables and fields are fully documented, but the version of SQL is not.  I had asked GS tech support about this once and was simply told it was 'standard' SQL and given no further information.  Of course, there are many dialects and so we are on our own it seems to determine the exact syntax allowed.&lt;BR /&gt;
&lt;BR /&gt;
The following post with some sample code might help you:&lt;BR /&gt;
&lt;A href="http://www.graphisoft.com/community/archicad-talk/viewtopic.php?p=6914#6914" target="_blank"&gt;&lt;LINK_TEXT text="http://www.graphisoft.com/community/arc ... =6914#6914"&gt;http://www.graphisoft.com/community/archicad-talk/viewtopic.php?p=6914#6914&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I used to know other versions of SQL, but after having used Microsoft Access for so many years, that's the only version I know these days ... and the FLAT keyword was new to me.  The other syntax in the linked example might be enough for you to extrapolate your SQL knowledge to retrieve what you want.&lt;BR /&gt;
&lt;BR /&gt;
Post some examples for others ... of things that don't work, and we'll see if we can figure them out jointly ... or of things that work that people can use Cookbook-style like my tip above.   It seems that very few people are using this feature.&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 12 Feb 2004 18:30:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7537#M474</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-02-12T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7538#M475</link>
      <description>thanx!&lt;BR /&gt;
i haven't seen the flat-keyword before, so this was really helpfull!&lt;BR /&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
regards,&lt;BR /&gt;
vannassen</description>
      <pubDate>Mon, 16 Feb 2004 09:57:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7538#M475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-02-16T09:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7539#M476</link>
      <description>There's a new article in ArchiGuide named "Using SQL Queries within ArchiCAD" dated 16.02.2004 but until now the link was broken.I reported it and I hope they'll fix it.</description>
      <pubDate>Mon, 16 Feb 2004 13:17:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7539#M476</guid>
      <dc:creator>Petros Ioannou</dc:creator>
      <dc:date>2004-02-16T13:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7540#M477</link>
      <description>The link was fixed and it was Karl's tip!</description>
      <pubDate>Mon, 16 Feb 2004 15:38:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7540#M477</guid>
      <dc:creator>Petros Ioannou</dc:creator>
      <dc:date>2004-02-16T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7541#M478</link>
      <description>And now we want to connect OBJECT ID with LIBRARYPART PREVIEW, but how?&lt;BR /&gt;
&lt;BR /&gt;
/Johan</description>
      <pubDate>Thu, 26 Feb 2004 14:19:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7541#M478</guid>
      <dc:creator>eldhead</dc:creator>
      <dc:date>2004-02-26T14:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiCAD and SQL</title>
      <link>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7542#M479</link>
      <description>&lt;BLOCKQUOTE&gt;eldhead wrote:&lt;BR /&gt;And now we want to connect OBJECT ID with LIBRARYPART PREVIEW, but how?&lt;/BLOCKQUOTE&gt;

Well, this should never be possible, as the OBJECT ID is a user defined piece of text that is part of the placed object (OBJECTS table) and not part of the LIBRARYPART (actual GDL definition).&lt;BR /&gt;
&lt;BR /&gt;
However, doing a join to obtain the preview for placed objects should be possible ... getting ANY data about placed objects for that matter should be possible, but the current table design does not allow this (I will report the problem).&lt;BR /&gt;
&lt;BR /&gt;
The LIBRARYPARTS table has the UNID field that gives the new unique identifier for a library part - that exactly identifies it, since parts with the same name can exist.  HOWEVER,  the OBJECTS table - which lists all placed objects in the file - contains only the ID (unique to that table) and the USERID (the text assigned by the user)!  It MUST have the UNID for the placed object as well to permit a proper JOIN.&lt;BR /&gt;
&lt;BR /&gt;
At present, the best you can do is to use the LIBRARY_PART_NAME field, perhaps, in the OBJECTS table and just run the risk of having parts with duplicate names.  A textual JOIN such as this is very inefficient, too.&lt;BR /&gt;
&lt;BR /&gt;
The following query will more or less get you what you want:&lt;BR /&gt;
&lt;BR /&gt;
SELECT DISTINCT PREVIEW FROM LIBRARYPARTS JOIN OBJECTS&lt;BR /&gt;
ON (LIBRARYPARTS.NAME = OBJECTS.LIBRARY_PART_NAME)&lt;BR /&gt;
&lt;BR /&gt;
Karl</description>
      <pubDate>Thu, 26 Feb 2004 20:43:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Collaboration-with-other/ArchiCAD-and-SQL/m-p/7542#M479</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2004-02-26T20:43:07Z</dc:date>
    </item>
  </channel>
</rss>

