how to get number of records in my query?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

how to get number of records in my query?

Post by snop21 » Fri Mar 07, 2014 8:47 am

Hello livecoders,

Just wanna ask how to know how to get number of records in my query?

put "Select * from CBMS_Setting" into tSQL
revNumberOfRecords conn, tSQL

I tried my script above but it's wrong.. :(

Thank you

Regards

-snop21

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: how to get number of records in my query?

Post by bangkok » Fri Mar 07, 2014 11:30 am

Code: Select all

  put "Select count(*) from CBMS_Setting" into tSQL
      put revDataFromQuery(,,conn,tSQL) into tNumber
answer tNumber
or

Code: Select all

    put "Select * from CBMS_Setting" into tSQL
      put revDataFromQuery(,,conn,tSQL) into tData
answer the number of lines of tData

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: how to get number of records in my query?

Post by splash21 » Fri Mar 07, 2014 2:20 pm

You can also query the number of rows found in the last query;

Code: Select all

SELECT ROW_COUNT()
LiveCode Development & Training : http://splash21.com

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: how to get number of records in my query?

Post by snop21 » Sat Mar 08, 2014 3:44 am

-Splash21,Bangkok


Thank you for the reply.. :))

Got it.. :))

Regards

-snop21

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”