Precompile embedded sql in c on ubuntu linux db2 does not work

301 Views Asked by At

I asked before but it looks like its not me, its the system.. My db2 installation completed with "minor errors" so maybe that is it. I can't make out the error code explanations.

The content of the folder:

prog1.sqc sh.sh

I gave DBADM authority to instance user. It should create bnd file on its own, correct?

Here is the report:

 $ db2 precompile prog1.sqc bindfile

 LINE    MESSAGES FOR prog1.sqc
 ------  --------------------------------------------------------------------
    SQL0060W  The "C" precompiler is in progress.
    SQL0031C  File "/home/nikica/UCENJE/precompile/prog1.bnd" 
              could not be opened.
    SQL0095N  No bind file was created because of previous 
              errors.
    SQL0091W  Precompilation or binding was ended with "2" 
              errors and "0" warnings.

IBM support pages:

https://www.ibm.com/support/pages/running-db2look-db2-instance-user-fails-sql0031c-file-db2lkfunbnd-could-not-be-opened

EDIT: my sqc

  #include <stdio.h>
  #include <string.h>
  #include <sqlca.h>

   /* SQL includes */
   EXEC SQL INCLUDE SQLCA;

   EXEC SQL BEGIN DECLARE SECTION;


   EXEC SQL END DECLARE SECTION;

    int main()
    {
    // EXEC SQL CONNECT TO sample;

   return (0);
  }
1

There are 1 best solutions below

1
On

RESOLVED with

 Precompilation or binding was ended with "0" 
              errors and "0" warnings.

Thanks to mao

Did all the steps like 100 times before plus "su - root" in the beginning