* * *

Author Topic: TSQLquery and packetRecords  (Read 773 times)

Pabdym

  • New member
  • *
  • Posts: 21
TSQLquery and packetRecords
« on: September 22, 2012, 10:02:46 am »
Hi,

My table contains up to 10000 rows. In my TSQLquery, PacketRecords := 1000. My request is asimple 'SELECT * FROM myTable;' It works fine...
But is there a variable in the TSQLquery which indicates that all the rows of the table were read?

Thanks.
Laz 1.1-38979 fpc-2.6.1-20121007-win32
Laz 1.0.4-0_amd64  fpc_2.6.0-120824_amd64 (x86_64-linux-gtk2)  [2013-01-02]

BigChimp

  • Hero Member
  • *****
  • Posts: 3343
    • FPCTwit twitter, CheckRide remote control and other open source projects
Re: TSQLquery and packetRecords
« Reply #1 on: September 22, 2012, 10:11:55 am »
Use the wiki, Luke ;)
http://wiki.lazarus.freepascal.org/SqlDBHowto#Why_does_TSQLQuery.RecordCount_always_return_10.3F
So, either a .Last or change PacketRecords as mentioned there.

By the way, why would you want to load 10000 records at once? If you're going to show that to the user, he'll be flabbergasted ;)
If you're going to want to modify it, why not run SQL commands against the server? (Ok, I understand that may not always be easiest/most convenient).

Edit: oh, welcome to the forum ;)
Edit: also see:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
... if you're going to ask questions next time, please mention OS, Lazarus+FPC version. Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including twitter/Oauth library:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Pabdym

  • New member
  • *
  • Posts: 21
Re: TSQLquery and packetRecords
« Reply #2 on: September 22, 2012, 12:33:41 pm »
Thank you for your welcome.
The problem is solved.
I take very good note of your remarks.
Goodbye.
Laz 1.1-38979 fpc-2.6.1-20121007-win32
Laz 1.0.4-0_amd64  fpc_2.6.0-120824_amd64 (x86_64-linux-gtk2)  [2013-01-02]

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads