MS SQL to Informix – Basics

Recently a friend asked me to help him convert some custom historical reports for Cisco UCCX   from using Microsoft SQL Server to IBM Informix before they upgraded from UCCX 7.0 to 8.5.  I had never really spent any time in Informix so I thought that it may be a good learning experience, so I excepted the challenge and agreed to help him out.  I learnd a lot in the few days I spent converting a coupe of stored procedures from Microsoft’s variant of T-SQL to IBM’s so I thought I would share the love.

 

 --MS SQL

DECLARE @foo VARCHAR(50)

 

--Informix

DEFINE l_foo VARCHAR(50); 
 --MS SQL

SET @foo = 'bar'

 

--Informix

LET l_foo = 'bar'; 
 --MS SQL

SELECT TOP 100 * FROM foo

 

--Informix

SELECT FIRST 100 * FROM foo; 
 --MS SQL

'foo' + 'bar'

 

--Informix

'foo' || 'bar'; 
 --example adds 3 days to DateTime variable

 

--MS SQL

DATEADD(d, 3, @varDateTime)

 

--Informix

l_varDateTime + 3 UNITS DAY; 
 --example converts string to numeric

 

--MS SQL

CAST('300' AS NUMERIC)

 

--Informix

'300'::NUMERIC; 

Leave a Reply

Your email address will not be published. Required fields are marked *