SQL adaptation guide For Sybase ASE 15.5+ / Data manipulation |
Informix® temporary tables are created through the CREATE TEMP TABLE DDL instruction or through a SELECT ... INTO TEMP statement. Temporary tables are automatically dropped when the SQL session ends, but they can also be dropped with the DROP TABLE command. There is no name conflict when several users create temporary tables with the same name.
The CREATE TEMP TABLE and SELECT INTO TEMP statements are not supported in Sybase ASE.
Sybase ASE supports temporary tables by using the # pound sign before the table name:
CREATE TABL #temp1 ( kcol INTEGER, .... )
SELECT * INTO #temp2 FROM customers WHERE ...
In BDL, Informix temporary tables instructions are converted to generate native Sybase ASE temporary tables.
SELECT INTO TEMP statements cannot be converted, because Sybase ASE does not provide a way to create a temporary table from a result set, such as CREATE TABLE xx AS (SELECT ... ).