Query inmemory dataset

I have created an inmemory dataset with a few columns and several rows. I now want to query the dataset to get a result which is a count of similar text items such as select count(names) from dataset group by names. How can I query an in-memory dataset to get this result?
stonemeadowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

paulo_psaCommented:
I suppose it is a ClientDataSet, so you can:

ClientDataSet.filtered := true;
ClientDataSet.filter := 'fieldname = 'value''; {here you filter what you want}
ClientDataSet.filtered := true;
x := ClientDataSet.recordcount; {here you check how many fields you get}
0
stonemeadowAuthor Commented:
I am familiar with filtering but want to query the dataset as if it were a Table.
0
Geert GOracle dbaCommented:
how did you create your data
are using a TStringList, TClientDataset, etc ?

what do you understand under query data ?
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

stonemeadowAuthor Commented:
The dataset is a TTable without a database backend. All fields are created using the FieldDef's property. You can create fields of float, string  etc. and populate the table using insert, append etc. as if it were a database table. After the data is populated, it would be nice to 'query' the table using sql commands. That is what I am looking to do.
0
Geert GOracle dbaCommented:
doesn't work unless you use a 'embedded' database

you will allways need a engine to interpret the 'query'
otherwise you'll have to write your own engine to do that

you could use absolute database for a single file db
http://www.componentace.com/bde_replacement_database_delphi_absolute_database.htm
or an extreme in memory db:
http://www.mcobject.com/extremedbfamily.shtml?gclid=CIKqnubdnaECFYSD3godlSRPxg
or local files, like SQLite
http://www.sqlite.org/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stonemeadowAuthor Commented:
Solution makes sense. I appreciate the reference to these products.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.