Re: Migrating Informix to PostgreSQL
Posted in 2004
If you're going via 4GL then Aubit4GL takes care of both of these issues (as
well as a lot more - for example, putting in the 'AS' for column aliases
and re-writing UPDATE statements in ANSI syntax) .
We've already successfully migrated a large system from Informix SE to
Postgres with just a few 4gl source code changes..
This example program :
main
define lv_arr array[10] of char(1)
define lv_mydb char(64)
let lv_mydb=arg_val(1)
database lv_mydb
create table bibble( a integer)
insert into bibble values(1)
select a into lv_arr[4] from bibble
display lv_arr[4]
end main
Compiles and runs fine with Aubit4GL talking to a postgres database via ecpg
If doing it directly in esqlc/ecpg -
1) the variable in a database statement - you don't prepare it you
'connect'
EXEC SQL CONNECT TO $s AS 'sessionname';
2) Select into a variable then copy it to the array afterwards.
Scott Burns wrote:
> Andrej Falout wrote:
>
>>Guys;
>>
>>There is Informix compatibility patch for PG and ecpg compiler:
>>
>>http://gborg.postgresql.org/project/pginformix/projdisplay.php
>>
>>There is allready patched code available from:
>>
>>http://informix.fastcrypt.com/
>>
>>Older RPM's:
>>
>>http://informix.postgresintl.com/
>>
>>We are using them as part of Aubit 4GL compiler project.
>>
>>There is at least one company that is using them in production
>>situation.
>>
>>HTH,
>>Andrej Falout
>>
>>
>>
>>
> Thanks for that link. I've thought of two more issues over the
> weekend but hopefully your link will help:
>
> 1) ecpg will not allow you to prepare a statement until you have a
> database open. This means you cannot determine database at runtime
> unless you use the core C function to do it.
>
> 2) ecpg does not allow arrays of host variables. My boss noticed this
> so I'm not too sure of any extra details.
>