[yunqa.de] Re: Disqlite 3 Pro : Temporary table question

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Sun, 01 Apr 2012 23:01:25 +0200

On 01.04.2012 21:26, Jon Burnham wrote:

> This is what I did. I just put a DB control on the GUI, gave the 
> database a name  - switched to connected. It gave me the warning 
> obviously. The other way round, no name and switched to connected 
> warns me that it will be a temporary db, but it does not allow me to 
> give it a name. It was this second action that I was referring to.
> It is arguable that if the temp db is created here, that it ought to
> be able to be named, although its detail is not defined.

The name of the database file does not matter for temporary databases,
it is chosen automatically according to the system's temp path
settings. The file is deleted when the database connection is closed.

> So that when you go down to code against it, at least you know what
> you have called it.

You can refer to a temporary database by its database handle or by the
TDISQLite3Database instance.

> This becomes even more important when there are
> several dbs being used in the same project as it allows you to keep
> track of them visually.

Each visual component derives from TComponent and has a Name property.
Standard Delphi procedure.

> Also, perhaps there should be visual feedback
> on the type they are: disktemp, mem and file.

There is:

Regular Filename DatabaseName - Normal disk based database.
':memory:' DatabaseName       - Memory database.
'' (empty) DatabaseName       - Temporary database.

All documented under the "sqlite3_open" index keyword.

> Another question that comes up, is this SQL statement:
> ======= SELECT iwin.geo.CountryCode, iwin.geo.CountryName FROM 
> iwin.geo WHERE 404232216 >= iwin.geo.StartIPNum AND 404232216 <= 
> iwin.geo.EndIPNum LIMIT 1 =========
> How do I use parameters for the numbers, quick pointer please.

Did you read

  SQLite3.chm -> Native API Overview?

It explains the basics of data binding and much more.

Delphi Inspiration mailing list

Other related posts: