Hello,
I'm trying to migrate an application from Visual Cobol / Linux / Oracle to Visual Cobol / Linux / Postgres.
Visual Cobol use openEsql to precompile sources with SQL, and need to used ODBC driver to connect to postgres database.
But i've got this error :
ORDER : OPEN CURPARMOD
MESSAGE SQL : ERROR: column eg_parmod.oid does not exist;
I work with PG13.
Do i need to change my database physical model ?
Who needs oid ? OpenEsql ? ODBC (I use postgresqlodbc 13.02 driver)
What is the solution to use my default database physical model ?
thank you for your help.
Laurent.
What does your SELECT statement for your cursor look like?
Were you also using OpenESQL and ODBC for accessing your Oracle database or were you using Pro*COBOL and COBSQL?
What does your SELECT statement for your cursor look like?
Were you also using OpenESQL and ODBC for accessing your Oracle database or were you using Pro*COBOL and COBSQL?
My select statement is :
116000 EXEC SQL DECLARE CURPARMOD CURSOR FOR
116100 SELECT
116200 IDMOD, NOMBATCH, NOMTP
116300 FROM
116400 EG_PARMOD
116800 END-EXEC.
117000 EXEC SQL OPEN CURPARMOD END-EXEC.
The problem is when i'm using Openesql and ODBC to access my Postgres database.
My script to compile my source file is :
cob -O -i -k my_file -C SQL=DBMAN=ODBC -C SQL=BEHAVIOR=ANSI -C SQL=TARGETDB=POSTGRESQL -C SQL=ANSI92ENTRY -C SQL=CHECKSINGLETON -C SQL=CLOSE_ON_COMMIT=NO-C LIST=my_list_file -C CHKECM=CTRACE -C ECMLIST
My table in postgres database :
create table EG_PARMOD (
IDMOD CHAR(6) not null,
NOMBATCH CHAR(6) not null,
NOMTP CHAR(6) not null,
constraint PK_EG_PARMOD primary key (IDMOD) );
My select statement is :
116000 EXEC SQL DECLARE CURPARMOD CURSOR FOR
116100 SELECT
116200 IDMOD, NOMBATCH, NOMTP
116300 FROM
116400 EG_PARMOD
116800 END-EXEC.
117000 EXEC SQL OPEN CURPARMOD END-EXEC.
The problem is when i'm using Openesql and ODBC to access my Postgres database.
My script to compile my source file is :
cob -O -i -k my_file -C SQL=DBMAN=ODBC -C SQL=BEHAVIOR=ANSI -C SQL=TARGETDB=POSTGRESQL -C SQL=ANSI92ENTRY -C SQL=CHECKSINGLETON -C SQL=CLOSE_ON_COMMIT=NO-C LIST=my_list_file -C CHKECM=CTRACE -C ECMLIST
My table in postgres database :
create table EG_PARMOD (
IDMOD CHAR(6) not null,
NOMBATCH CHAR(6) not null,
NOMTP CHAR(6) not null,
constraint PK_EG_PARMOD primary key (IDMOD) );
It looks like this internal pseudo column, ".oid", which is a unique identity column, is specific to PostgresSQL and was deprecated in V12 onward, but the OpenESQL run-time still requires this field in certain circumstances.
The oid column is required for “FOR UPDATE” cursor. The workaround is to create a real oid column in the table as documented here:
https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-EclipseUNIX/GUID-1F1C4505-B771-4F8E-B274-952CAF3E8265.html
From the code snippet for the SELECT that you included, it doesn't look like you are using the “FOR UPDATE” cursor support., at least in this case so you might try adding the SQL(NOWHERECURRENT) directive to disable the use of oid in the runtime:
https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-EclipseUNIX/GUID-DC52546D-EC5A-497B-A0CE-DB3BB882903B.html
If neither of these workarounds is suitable then please open up a support case and we can take a closer look.
Thanks
It looks like this internal pseudo column, ".oid", which is a unique identity column, is specific to PostgresSQL and was deprecated in V12 onward, but the OpenESQL run-time still requires this field in certain circumstances.
The oid column is required for “FOR UPDATE” cursor. The workaround is to create a real oid column in the table as documented here:
https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-EclipseUNIX/GUID-1F1C4505-B771-4F8E-B274-952CAF3E8265.html
From the code snippet for the SELECT that you included, it doesn't look like you are using the “FOR UPDATE” cursor support., at least in this case so you might try adding the SQL(NOWHERECURRENT) directive to disable the use of oid in the runtime:
https://www.microfocus.com/documentation/enterprise-developer/ed90/ED-EclipseUNIX/GUID-DC52546D-EC5A-497B-A0CE-DB3BB882903B.html
If neither of these workarounds is suitable then please open up a support case and we can take a closer look.
Thanks
Hi Chris,
SQL precompiler option : NOWHERECURRENT works fine !
Thanks a lot.
Regards,
Laurent.