Returns a table with the information of the columns with foreign key of the passed table as argument. They are classified by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ.

 

1 connection.metadata.getCrossReference

<connection.metadata.getCrossReference>
    <primaryCatalog /> +
    <primarySchema /> +
    <primaryTable /> +
    <foreignCatalog /> +
    <foreignSchema /> +
    <foreignTable /> +
</connection.metadata.getCrossReference>
Example
Copy
<xsql-script name='connection_metadata.getCrossReference'>
    <body>
        <println>
            <connection.metadata.getCrossReference>
                <null />
                <null />
                <string>gcompedh</string>
                <null />
                <null />
                <null />
            </connection.metadata.getCrossReference>
        </println>
    </body>
</xsql-script>
Copy
+-----------+-------------+------------+-------------+-----------+-------------+-------------+-------------+--------+-----------+-----------+----------------+----------+-------------+
|pktable_cat|pktable_schem|pktable_name|pkcolumn_name|fktable_cat|fktable_schem|fktable_name |fkcolumn_name|key_seq |update_rule|delete_rule|fk_name         |pk_name   |deferrability|
|varchar    |varchar      |varchar     |varchar      |varchar    |varchar      |varchar      |varchar      |smallint|smallint   |smallint   |varchar         |varchar   |smallint     |
+-----------+-------------+------------+-------------+-----------+-------------+-------------+-------------+--------+-----------+-----------+----------------+----------+-------------+
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|erp          |gcompedl_orig|cabped       |       1|          1|          1|f_gcompedl_orig2|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompeda     |cabid        |       1|          1|          1|f_gcompeda2     |p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedh_cart|cabid        |       1|          1|          1|f_gcompedh_cart1|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedh_docs|cabid        |       1|          1|          1|f_gcompedh_docs1|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedh_dtcl|cabid        |       1|          1|          1|f_gcompedh_dtcl1|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedh_note|cabid        |       1|          1|          1|f_gcompedh_note1|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedl     |cabid        |       1|          1|          1|f_gcompedl1     |p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedl_dtlh|cabid        |       1|          1|          1|f_gcompedl_dtlh1|p_gcompedh|            7|
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gedi_gcommovp|cabped       |       1|          1|          1|f_gedi_gcommovp2|p_gcompedh|            7|
+-----------+-------------+------------+-------------+-----------+-------------+-------------+-------------+--------+-----------+-----------+----------------+----------+-------------+
Example
Copy
<xsql-script name='connection_metadata.getCrossReference'>
   <body>
       <println>
           <connection.metadata.getCrossReference>
               <null />
               <null />
               <string>gcompedh</string>
               <null />
               <null />
               <string>gcompedl</string>
           </connection.metadata.getCrossReference>
       </println>
   </body>
</xsql-script>
Copy
+-----------+-------------+------------+-------------+-----------+-------------+------------+-------------+--------+-----------+-----------+-----------+----------+-------------+
|pktable_cat|pktable_schem|pktable_name|pkcolumn_name|fktable_cat|fktable_schem|fktable_name|fkcolumn_name|key_seq |update_rule|delete_rule|fk_name    |pk_name   |deferrability|
|varchar    |varchar      |varchar     |varchar      |varchar    |varchar      |varchar     |varchar      |smallint|smallint   |smallint   |varchar    |varchar   |smallint     |
+-----------+-------------+------------+-------------+-----------+-------------+------------+-------------+--------+-----------+-----------+-----------+----------+-------------+
|demo_sports|informix     |gcompedh    |cabid        |demo_sports|informix     |gcompedl    |cabid        |       1|          1|          1|f_gcompedl1|p_gcompedh|            7|
+-----------+-------------+------------+-------------+-----------+-------------+------------+-------------+--------+-----------+-----------+-----------+----------+-------------+