Some questions

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
pcbb
Posts: 8
Joined: Sun 29 Jul 2012 12:31

Some questions

Post by pcbb » Sun 18 Nov 2012 13:51

I am currently a registered user LiteDAC and MyDAC.

And I say that the components are great.

At the same time I am still a student and I'm learning database, devart components currently.

So I have some questions:

1) To do an insert using LiteDAC I edit the field "LiteQuery.SQL.Text" and call the LiteQuery.Execute. Exists a index field index (autoincrement). Can I get the last index registered without making a new query?

2) In delphi I've kind "TDateTime = Now;". It is a variable of type Double. It's a good idea to use as a Double index to speed up the search? What happens is the following:

- I have a table with 2 fields. "time as DATETIME, name as VARCHAR".
- I need to make a query as fast as possible from a given TDateTime to another. For example between Monday to 12:00 Tuesday Ater 09:00.

What is the correct way to do this quickly and using SQLite with LiteDAC?

I know this second question escapes a little of not topic because it's not directly involves the component of Devart. But I would like to share the experience and opinion of you.

Best regards,

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Some questions

Post by AlexP » Tue 20 Nov 2012 11:59

hello,

At the moment the value of the auto-increment field after inserting a record can be retrieved only by a query, we will consider a possibility to return this value automatically in one of the following versions.
Adding an index to the date field will increase the speed of query execution when using this field in the WHERE clause, for more detailed information on the use of indexes, you should contact SQLite developers.

Post Reply