Home » Developer & Programmer » Precompilers, OCI & OCCI » Pro C program is not printing anything (Oracle 11g, OS is Windows XP and compiled in cygwin)
Pro C program is not printing anything [message #467234] |
Thu, 22 July 2010 18:31  |
SasDutta
Messages: 9 Registered: July 2010
|
Junior Member |
|
|
Hi
I have small Pro C program.
#include <stdio.h>
#include <string.h>
#include <sqlda.h>
#include <sqlcpr.h>
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR uid[30];
VARCHAR pwd[30];
EXEC SQL END DECLARE SECTION;
EXEC SQL INCLUDE SQLCA.H;
int main()
{
strcpy(uid.arr,"SCOTT");
uid.len =strlen(uid.arr);
strcpy(pwd.arr,"LION");
pwd.len = strlen(pwd.arr);
EXEC SQL WHENEVER sqlerror goto errexit;
EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
printf("\nConnected to Oracle8i using Scott/Tiger\n");
EXEC SQL COMMIT WORK RELEASE;
return 1;
errexit:
printf("\nConnection failed\n");
return 1;
}
To compile this program i used following commands in cygwin
$ORACLE_HOME/bin/proc test.pc
cc -I${ORACLE_HOME}/precomp/public -c test.c
cc -o test test.o -L $ORACLE_HOME/precomp/lib -l orasql11
With above command program is compiling and linking fine. But when i am running the exe, it is not printing anything. Even if it is not printing the printf statement at the very begining of the code
Can anybody help why this is happening
Thanks
Sas
[Updated on: Thu, 22 July 2010 18:36] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Apr 01 04:39:42 CDT 2025
|