title: Firebird error error code = -206 Column unknown
body: <p>I use IBDac with Delphi to connect to Firebir db and suddenly when I tried to run the software I got this error </p>
  
  <blockquote>
    <p>Dynamic SQL ErrorSQL error code = -206 Column unknown
    table1.MyField_ID At line 6, column 18</p>
  </blockquote>
  
  <p>the error show up when I try to open the dataset</p>
  
  <pre><code>mydataset.open;
  </code></pre>
  
  <p>the column exists of course. it is a foreign key to another table. I really dont know why I get this error !! here is the SQL I used in the component:</p>
  
  <pre><code>CREATE TABLE table1 (
        pkfield1 INTEGER NOT NULL,
        field_no INTEGER NOT NULL,
        fk1_id INTEGER NOT NULL,
        fk2_id INTEGER,
        MyField_ID INTEGER,
        bfield INTEGER);     
  
    select 
          table1.pkfield1,
          table1.field_no,
          table1.fk1_id,
          table1.fk2_id,
          table1.MyField_ID, &lt;&lt;&lt;------- the field that cause the error
          table1.bfield,
          table2.desc1,
          table2.desc2,
          table2.desc3
      from table2
      right outer join table1 on (table2.pk1_id = table1.fk1_id)
      Order by table1.fk1_id, table1.field_no desc
  </code></pre>
  
  <p>Please advise</p>
  
  <p>thanks</p>