Jump to content

Wloochacz

Members
  • Content Count

    5
  • Joined

  • Last visited

Everything posted by Wloochacz

  1. Wloochacz

    TFDMemTable - how to clear structure?

    Hello Jaca! :) There is no simple solution for that. However, I would suggest basing your own solution on the CopyDataSet code. Note that if you specify the coStructure parameter in the options of CopyDataSet method, you will get what you want. Almost ;-)
  2. Wloochacz

    How to Code SQL IN Statement correctly

    In general, this is true, especially in SQL executed on the server side, such as stored procedures, triggers, etc. And there, it's better to write like this: select A.* from foo1 A inner join foo2 B on (A.ID = B.ParentID) instead of this: select A.* from foo1 A where A.ID in (select B.ParentID from foo2 B) Although the result will be identical. However, in some cases it is simply convenient. For example, in my application I pass an array of PrimaryKey values to ReportManager so that he can ask the server for the data he has selected on the list. It works like this: And where in SQL looks like this: where TD.IdDevice in (10,12,16,23) Simply clever :P
  3. Wloochacz

    How to Code SQL IN Statement correctly

    In e.g Firebird database, yes. In MS SQL it does not matter.
  4. Wloochacz

    How to Code SQL IN Statement correctly

    Indeed, but OP work with SQL Server. And this database has no such limits
  5. Wloochacz

    How to Code SQL IN Statement correctly

    Use the macro! 😉 fQ.SQL.Text := 'SELECT * FROM tTableName WHERE Status IN (!InValues) ORDER BY EventDate'; fQ.MacroByName('InValues').AsRaw := '''S'', ''R'''; fQ.Open;
×