Discussion:
[sqlite] [sqlite-dev] using COUNT(*) in sql from a delphi program
Keith Medcalf
2018-12-07 02:22:06 UTC
Permalink
You will probably have a better response if you post your query to the correct list rather than the sqlite-dev list. It is unlikely that the SQLite3 developers use Delphi, however it is probable that at least one sqlite-user uses delphi ...

Reporting to the correct list.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.
-----Original Message-----
On Behalf Of Steve Leonard
Sent: Thursday, 6 December, 2018 18:29
Subject: [sqlite-dev] using COUNT(*) in sql from a delphi program
I have a very basic query like this
select state, count(*) from customers
group by state
I am using a Delphi program which displays the data in a dbgrid.
The problem is the count(*) displays as "WIDEMEMO".
select state, count(*) as mycount from customers and this runs fine
using other database.
With SQLITE it has a problem with the field mycount, and when I go
into
the fields editor and add mycount as a new field
of type aggregate or calculated I have different problems.
Eventually I found a combination of entries into the "new field"
screen
that works, but the mycount field is blank.
My attempts to use the delphi "fieldbyname('mycount') do not work.
Does
anyone have a sample Delphi program using SQLITE that displays the
value
of "count(*)"?
Thank you.
Steve
_______________________________________________
sqlite-dev mailing list
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev
R Smith
2018-12-07 09:05:43 UTC
Permalink
-----Original Message-----
On Behalf Of Steve Leonard
Sent: Thursday, 6 December, 2018 18:29
Subject: [sqlite-dev] using COUNT(*) in sql from a delphi program
I have a very basic query like this
select state, count(*) from customers
group by state
I am using a Delphi program which displays the data in a dbgrid.
The problem is the count(*) displays as "WIDEMEMO".
select state, count(*) as mycount from customers and this runs fine
using other database.
This was the correct solution to the first problem.
With SQLITE it has a problem with the field mycount, and when I go
into
the fields editor and add mycount as a new field
of type aggregate or calculated I have different problems.
That field, to the Delphi DB components, is just a normal field, not a
calculated or aggregate field, but it can't be updated (which may cause
the confusion) - which makes me think you are using some weird
connection object, query object, or setup.
Eventually I found a combination of entries into the "new field"
screen
that works, but the mycount field is blank.
My attempts to use the delphi "fieldbyname('mycount') do not work.
Does
anyone have a sample Delphi program using SQLITE that displays the
value
of "count(*)"?
Here is a sample Delphi program using SQLite: www.sqlitespeed.com - but
I assume you would rather like a sample program using the exact DB
objects and connections that you are using (which could be one to many
of many), so if you share the exact objects plus delphi version, we can
surely assist with samples.
Thank you.
Steve
Pleasure Steve - This is however a Delphi question and not really an
SQLite question, so might be better suited on a Delphi forum - however,
there's a few Delphi devs here and we'd be glad to help without spamming
the list too much.

Cheers!
Ryan

Loading...