<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>CUBRID Q&amp;A</title>
        <link>http://www.cubrid.org/?mid=questions</link>
        <description>CUBRID Q&amp;A</description>
        <language>en</language>
        <pubDate>Fri, 21 Oct 2011 02:37:10 -0800</pubDate>
        <lastBuildDate>Wed, 20 Mar 2013 22:07:09 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>Can&apos;t create composite foreign key with a different cardinality</title>
            <dc:creator>ovidiuv</dc:creator>
            <link>http://www.cubrid.org/questions/435664</link>
            <guid isPermaLink="true">http://www.cubrid.org/questions/435664</guid>
                                    <description><![CDATA[<div>I can't create composite foreign key with a different cardinality&nbsp;than the referenced table's primary key, even if there is a unique&nbsp;index:</div><div><br /></div><div>CREATE TABLE "ITEMS" (</div><div>&nbsp; "ID" integer AUTO_INCREMENT PRIMARY KEY,</div><div>&nbsp; "ITEM_ID" integer FOREIGN KEY REFERENCES "ITEMS",</div><div>&nbsp; UNIQUE ("ITEM_ID", "ID"),</div><div>&nbsp; FOREIGN KEY ("ID", "ITEM_ID") REFERENCES "ITEMS"("ITEM_ID", "ID")</div><div>);</div><div><br /></div><div>gives error:</div><div><br /></div><div>The number of keys of the foreign key 'fk_items_id_item_id' is different from that of the primary key 'pk_items_id'.</div><div><br /></div>]]></description>
                        <pubDate>Tue, 25 Sep 2012 02:00:42 -0800</pubDate>
                        <category>foreign key</category>
                        <category>cardinality</category>
                        <category>unique</category>
                        <category>primary key</category>
                                    <slash:comments>1</slash:comments>
                    </item>
        										        <item>
            <title>How to navigate foreign key relationships using the dictionary views?</title>
            <dc:creator>lukaseder</dc:creator>
            <link>http://www.cubrid.org/questions/317560</link>
            <guid isPermaLink="true">http://www.cubrid.org/questions/317560</guid>
                                    <description><![CDATA[<p>I am implementing a CUBRID integration for <a target="_self" href="http://www.jooq.org">jOOQ</a>, and I wonder how I can discover foreign key relationships using the dictionary views. Using the following query, I can discover foreign key columns:</p><p></p><div editor_component="code_highlighter" code_type="Sql" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;"><p>select k.class_name, k.index_name, k.key_attr_name<br />from db_index&nbsp; i<br />join db_index_key k<br />on i.index_name = k.index_name<br />and i.class_name = k.class_name<br />where is_foreign_key = 'YES'<br />order by k.class_name, k.index_name, k.key_order</p></div><p>Now, how can I discover which columns (or which primary key) is referenced? </p>]]></description>
                        <pubDate>Thu, 29 Mar 2012 08:54:05 -0800</pubDate>
                        <category>SQL</category>
                        <category>index</category>
                        <category>foreign key</category>
                                    <slash:comments>2</slash:comments>
                    </item>
            </channel>
</rss>
