Recent

Author Topic: Capture SQL from TSQLQuery.ApplyUpdates  (Read 6021 times)

Titins

  • Newbie
  • Posts: 2
Capture SQL from TSQLQuery.ApplyUpdates
« on: October 19, 2010, 09:16:11 am »
I use Lazarus 0.9.28.2 on XP.

How do I capture the SQL sent to server when I call the method TSQLQuery.ApplyUpdates?

It is only to keep a log file.

Thanks

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: Capture SQL from TSQLQuery.ApplyUpdates
« Reply #1 on: October 19, 2010, 11:53:58 am »
try to read the post, maybe it can help you :D
http://forum.lazarus.freepascal.org/index.php/topic,10811.0.html

Titins

  • Newbie
  • Posts: 2
Re: Capture SQL from TSQLQuery.ApplyUpdates
« Reply #2 on: October 19, 2010, 12:54:28 pm »
Thanks xenablaise,

Great examples but I can't see the way to catch the SQL sent to server when I use the method TSQLQuery.ApplyUpdates in the examples.

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: Capture SQL from TSQLQuery.ApplyUpdates
« Reply #3 on: October 19, 2010, 03:05:03 pm »
Quote
TSQLQuery.ApplyUpdates
These updates to any DbControl components like dbEdit, DbGrid
that is using the Datasource pointing to TSQLQuery.

TSQLQuery has a property "UpdateMode"
eq., SQLQuery1.UpdateMode
Where can be set to;
SQLQuery1.UpdateMode := upWhereAll;
SQLQuery1.UpdateMode := upWhereChange;
SQLQuery1.UpdateMode := upWhereKeyOnly;

So, when you put a code;
TSQLQuery.ApplyUpdates;
Depends on what you have inputed in the UpdateMode
 :D

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: Capture SQL from TSQLQuery.ApplyUpdates
« Reply #4 on: October 19, 2010, 06:57:26 pm »
Updated project source code from this post may answer what you really asking :D
http://forum.lazarus.freepascal.org/index.php/topic,10811.0.html

 

TinyPortal © 2005-2018