Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Running 9.2 compiled applications on a 10g server
"Arun Mathur" <themathurs_at_gmail.com> wrote in news:1124115536.329036.252220
@g14g2000cwa.googlegroups.com:
> What does your makefile look like?
For a test program, I used a shellscript like this:
NAME=32339
rm -f $NAME
proc $NAME.esql PARSE=NONE CODE=ANSI_C ONAME=tmp.c || exit
xlc tmp.c -L/grpbin -lclntsh -o $NAME || exit
rm -f tmp.c $NAME.lis
echo "\007\c" # beep
/grpbin is the directory (on both the 9.2 development and the 10g production machine) that contains the 9.2 libclntsh.a file.
And 32339.esql is a simple Pro*C method 4 test program to do a "select * from dual". It works fine on the 9.2 development machine but crashes on the production machine (after successfully establishing a connection to the database).
#include <stdio.h>
EXEC SQL include sqlca;
int main(void)
{
EXEC SQL begin declare section;
char *UId = "myuser";
char *Pwd = "mypasswd";
char Buf[256+1];
short iBuf;
EXEC SQL end declare section;
EXEC SQL connect :UId identified by :Pwd;
if (sqlca.sqlcode!=0)
exit(1);
EXEC SQL DECLARE vcursor CURSOR FOR
SELECT * FROM dual;
EXEC SQL OPEN vcursor;
for(;;)
{
EXEC SQL FETCH vcursor INTO :Buf:iBuf;
if (sqlca.sqlcode!=0)
{
int const Err = sqlca.sqlcode; if (Err != 1403) printf("Error %d:\n%s\n",Err,sqlca.sqlerrm.sqlerrmc); break;
EXEC SQL CLOSE vcursor;
EXEC SQL commit release;
return 0;
}
Regards
W. Rösler
Received on Mon Aug 15 2005 - 09:32:20 CDT
![]() |
![]() |