Whats source program type for GnuCobol with embedded Postgres

349 views Asked by At

Have GnuCobol cobc compiler installed in Ubuntu esqlOC installed for SQL pre-processing, Cob-DB2 is working fine. For Cobol with postgres what should be the source program type (like .sqb is for Cob db2)
Presume a new DSN has to be added in data server driver config file with IP and port of Postgres

1

There are 1 answers

0
Laurenz Albe On

There is no PostgreSQL preprocessor for embedded SQL in Cobol.

You should write the code that accesses the database in C and link the compiled C code with your Cobol program.

You can have embedded SQL in C for PostgreSQL using the ecpg preprocessor that is included in PostgresSQL.