Board index » off-topic » Temporary tables

Temporary tables


2004-03-03 11:29:42 PM
off-topic19
Hi all,
Some questions about temporary tables:
- Do you know if BDE support temporary table creation ?, because the
following instruction does not work:
db.Execute('CREATE TEMPORARY TABLE TEMP_TABLE (Id INTEGER,
Description VARCHAR(30), PRIMARY KEY(Id));');
- Where can I found some documentation about BDE SQL Syntax supported
(Paradox)?
- I use for every Database manipulation SQL Instructions, what is better ?
using Delphi objects TTable, TField ... or directly SQL Instructions ?
Thanks for your help
Regards Olivier
 
 

Re:Temporary tables

Olivier,
Look for localsql.hlp in the dir in which the BDE is installed.
Liz
Olivier Sauterel wrote:
Quote

- Where can I found some documentation about BDE SQL Syntax supported
(Paradox)?
 

Re:Temporary tables

Ok, i will see for this documentation ...
It's a new application, but I need to access to a Database Paradox from
another Application...
So I cannot using dbExpress objects for this ... if I've understand the
documentation ...
When using TTable objects, it's possible to setup this objects as a
temporary table that will be automatically
deleted when session exit or connection lose ?
"Bill Todd (TeamB)" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
If you are using Paradox tables look at the Local SQL help file in
your BDE directory. With Paradox tables you will generally get better
performance using TTable than using SQL.

If you are beginning a new application you should not use the BDE at
all. See community.borland.com/article/0,1410,28688,00.html for
details.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
 

{smallsort}

Re:Temporary tables

Olivier,
you should use TQuery instead of TTable. It is better for performances.
sincèrement
Jean-Michel
"Olivier Sauterel" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
Hi all,

Some questions about temporary tables:

- Do you know if BDE support temporary table creation ?, because the
following instruction does not work:
db.Execute('CREATE TEMPORARY TABLE TEMP_TABLE (Id INTEGER,
Description VARCHAR(30), PRIMARY KEY(Id));');
- Where can I found some documentation about BDE SQL Syntax supported
(Paradox)?
- I use for every Database manipulation SQL Instructions, what is better
?
using Delphi objects TTable, TField ... or directly SQL Instructions ?

Thanks for your help

Regards Olivier


 

Re:Temporary tables

Hi,
Uses: Delphi+5, MS SQL Server 2000 with TADO components on Windows XP
Professional 2002;
As I heard, SQL Server offers to create Virtual Tables or Temporary Tables.
My Question here is it possible to connect to TADO Dataset Components? as it
resides in Clients Local Hard Drive how can get connected to TADO Datasets?
Coz I want to use to TDataSet events to process data.
Regards,
Hifni
 

Re:Temporary tables

MSSQL does offer you 2 types of temporary tables and yes you can connect to
them with ADO no problem. You just have to understand how they work to be
able to use them properly.
The first type is a temp table that has a scope of the current session. It
is created using # as a prefix.
The second type is global in scope and can be accessed from different
sessions. It is created using ## as a prefix to the tablename.
So if you create a temp table eg. "CREATE #tmp (ID int)" from your delphi
app with 1 ADO connection which stays connected all the time you can do
anything with it, as if it was a normal table. As soon as you restart the
app or open and close the connection then it is gone!
If you create a global temp table using "CREATE ##tmp (ID int)" then you
will be able to connect to it from multiple sessions no worries, however it
will be dropped as soon as the session that created it ends.
excerpt from the sql help: "Global temporary tables are automatically
dropped when the session that created the table ends and all other tasks
have stopped referencing them. The association between a task and a table is
maintained only for the life of a single Transact-SQL statement. This means
that a global temporary table is dropped at the completion of the last
Transact-SQL statement that was actively referencing the table when the
creating session ended"
They do not reside on the clients local hard drive! The database server
manages them on the server, they are not designed to be a local copy of
existing tables!
Konrad.
"Hifni" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,

Uses: Delphi+5, MS SQL Server 2000 with TADO components on Windows XP
Professional 2002;

As I heard, SQL Server offers to create Virtual Tables or Temporary
Tables. My Question here is it possible to connect to TADO Dataset
Components? as it resides in Clients Local Hard Drive how can get
connected to TADO Datasets? Coz I want to use to TDataSet events to
process data.

Regards,

Hifni