* * *

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

RedOctober

  • Full Member
  • ***
  • Posts: 218
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

  • Full Member
  • ***
  • Posts: 218
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);


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus