I am quite weak in C but I need to get some work done. Hope someone can help me out. I keep getting this error when i try to run my C application in my HP-UX 10.20 machine.
Some code snippet:
Month(DBTime) =====This is a function which will return variable "CutOffTime" to be use below
strcpy(DBSecTime, CutOffTime)
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);
exec sql begin works;
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);
exec sql select * from tableA where time < :DBSecTime
exec sql commit work;
I am able to print out values of DBSecTime on every sprintf until I reach the sql statement, following which, a Bus error(coredump) will appear.
Hope someone is able to give me some advices. Thanks in advance.
Hi otheus, sorry about that, I have included more codes.
exec sql begin declare section;
char DBSecTime[15];
exec sql end declare section;
Month(DBTime) ===== This is a function which will return variable "CutOfftime" to be use below:
strcpy(DBSecTime, CutOffTime)
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);
exec sql begin works;
sprintf(str, "DBSecTime is : %s\n", DBSecTime);
InputLog(Log, str);
exec sql select * from tableA where time < :DBSecTime
exec sql commit work;
exec sql select * from tableA where time < : DBSecTime, this is actually a embedded sql statement in my C code. I just find it strange that the 2 sprintf statement was able to run smoothly but not the DBSecTime that was in the sql statement. I have even try to replace DBSecTime in the sql statement with a value like "200812000000" and it managed to got thru too.