![]() SQL database system |
Temporary tablesTemporary tables are created using the SELECT INTO or CREATE STREAM commands. After a temp table is created it may be accessed like any other table using SELECT. Temporary tables are unique to a process; one process cannot access or modify temp tables created by another process (if you need to do this, use ordinary files instead). Temp tables cannot be manipulated using INSERT, UPDATE, or DELETE, nor can indexes be created for them. See also the shsql table types chart.Namesshsql temp table names always begin with a dollar sign ($). Otherwise temp table names follow the same naming rules as regular tables.Temporary tables provide a way of "chaining" or combining commands. These are particularly useful with shsql since the more elaborate forms of some commands aren't supported. For instance, you can put the results of a two-table join into a temp table, then join that temp table against another table.
Removing temp tablesDROP TEMPTABLE may be used to explicitly remove temporary tables.Cleaning up old temp table filesTemp tables are stored as files either in tmpdir or dbtmptabledir as defined in the project config file Old temp table files may accumulate over time and these should be cleaned up periodically. |
![]() Copyright Steve Grubb |