Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create Temp

Status
Not open for further replies.

03Explorer

Technical User
Sep 13, 2005
304
0
0
US
Can someone help with the syntax for both CREATE TEMP and SELECT INTO TEMP.

I am being tasked with Informix SQL coding and my background is heavy with MS SQL Server.

Thanks.
 
1)
CREATE TEMP TABLE yourTable(
yourCarCol CHAR(50)
,yourIntCol INT
)

2)
SELECT yourColumnsList
FROM yourTablesList
WHERE yourExpression
INTO TEMP yourTempTable

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am stumped with this simple statement...

any reason for failure?

Code:
 CREATE TEMP TABLE #sid (ordBy INT, lname char(10), fname char(10) )
insert into TABLE #sid Values(1, 'Smith', 'Jackson')
 

You did 3 things wrong:

Code:
CREATE TEMP TABLE sid (ordBy INT, lname char(10), fname char(10) );
insert into sid Values(1, 'Smith', 'Jackson');
select * from sid;

1) With Informix, the # sign is not a valid character in a table name.
2) Separate your DML statements with a semi-colon
3) Lose 'TABLE' on the insert statemnet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top