Recent

Author Topic: Is there a way of getting the TABLE NAME from IBXScript or IBQuery SQL statement  (Read 1889 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
I have a situation where I want to write an UPDATE statement based on the result set sitting in a TIBQuery.  This means I need the table name that was used in the SQL statement in the TIBQuery.  Is there an easy way to get that, or do I need to parse it out of the SQL statement myself?


RedOctober

  • Sr. Member
  • ****
  • Posts: 452
I found the answer.  I put my SQL statement into a TIBSQL, prepare it, and use the function shown.

    sqlGrid.SQL.Text := qryGrid.SQL.Text;
    sqlGrid.Prepare;
    tbl_nm := sqlGrid.MetaData.GetUniqueRelationName;

    ShowMessage(tbl_nm);


 

TinyPortal © 2005-2018