My DB id "test",user is dba,passwd is dba.
 My code contain likes below:

//================myprogram.c===================
 exec sql begin declare section;
 char *name = pchrchr;

 exec sql end declare section;


  
  AUTHID("DBA");    //connect database db1
  
  exec sql insert into test1 values (4,:name);

  if(SQLCODE != 0)
    printf("SQL ERRER !! SQLCODE = %d\n",SQLCODE);
  else
    printf("SQL SUCCESS !!\n");
//==================================================

Compile:

 cpc -d test -u dba,dba myprogram
 cpclnk myprogram

This programs run successlly;



But the program run err when compile by this way:

 cpc -d db1 -u dba,dba -c myprogram
 gcc -o myprogram myprogram.c -I/opt/sdb/programs/sdk/7500/incl 
-L/opt/sdb/programs/sdk/7500/lib  -lsqlca -L/opt/sdb/programs/lib -lsqlod

This program run with core.

Please tell me how the program run successlly with compile by gcc

Reply via email to