Hi,
 
I use Delphi 5 and SQL Server, to increase speed of query some time I used temporary table, beacuse without temporary table the query was :
   select sum(volume) from aset where location in (select id from location
   where ...)
 
using caluse IN, the  index does not run (the speed is very low)
 
Then, I changed then query :
   select sum(volume) from aset, #loc where location=id
 
before the query, the temporary table (#loc) was created and fill with location to be prossess with the second way the speed increase
 
Now I need to change the Database to Oracle ...
Any one know how to create temporary table in Oracle like in SQl-Server ?
 
this is the description how to create temporary table in SQl-Server:
 
SQL Server supports two types of temporary tables: local and global.
A local temporary table is visible only to the connection that created it.
A global temporary table is available to all connections.
Local temporary tables are automatically dropped at the end of the current session.
Global temporary tables are dropped at the end of the last session using
the table (normally, this is when the session that created the table ends).
 
Temporary tables named with # and ## can be created by any user.
Once the temporary table is created, the owner of the local table is the only one
who can access that table. Permissions cannot be granted on local temporary tables.
Once a global temporary table is created, all users can access it; permissions
cannot be explicitly revoked. Explicitly creating a temporary table in tempdb
(named without a pound sign) can be performed only by those with explicit
CREATE TABLE permission in the tempdb database. Permission can be granted to and
revoked from these tables.
Because temporary tables are not generally maintained for long
(they are automatically dropped by the system), because referenced objects could be
dropped (drop dependencies), and because FOREIGN KEY constraints are not enforced,
a simplified CREATE TABLE syntax can be used:
 
CREATE TABLE #[#]table_name
(column_definition [, next_column_definition]...)
 
thank's
Dedy

Reply via email to