Home » Developer & Programmer » Precompilers, OCI & OCCI » Profortran EXEC SQL coredump
Profortran EXEC SQL coredump [message #456130] Fri, 14 May 2010 16:40 Go to next message
saracooper
Messages: 15
Registered: February 2010
Junior Member
Hello, I am using embedded sql in a Fortran program on IBM AIX. Whenever I execute a SQL statement other than connect I get a coredump. So I wrote a small test program, but same thing happens. This is the test program -

PROGRAM TEST
EXEC BEGIN DECLARE SECTION
CHARACTER*20 UDPWD
EXEC END DECLARE SECTION

EXEC SQL INCLUDE SQLCA

UDPWD='oracle/oracle'

EXEC SQL WHENEVER SQLERROR DO CALL SQLERR
EXEC SQL CONNECT :UDPWD
PRINT *, 'Connected'

EXEC SQL EXECUTE IMMEDIATE 'DELETE FROM EMPLOYEES'
PRINT *, 'Records deleted'
END

SUBROUTINE SQLERR
PRINT *, 'ORACLE ERR DETECTED'
END


I pre compile it using profor & then compile it with xlf -
xlf -g -o test test.f -q64 -L $ORACLE_HOME/lib -l clntsh

And then when I run test, I see the 'Connected' print & then coredump. Same thing happens for EXEC SQL Prepare statement.

Am I not linking some library ? Or missing something basic ?
Any help is really appreciated. Thanks
Re: Profortran EXEC SQL coredump [message #456327 is a reply to message #456130] Mon, 17 May 2010 05:08 Go to previous message
saracooper
Messages: 15
Registered: February 2010
Junior Member
I would like to add more info to my previous post -

The OS is IBM AIX 5.3. I use the fortran precompiler - profor to precompile and then use the fortran compiler xlf. The program crashes at EXEC SQL EXECUTE IMMEDIATE statement.
Using the debugger dbx I found out that every EXEC SQL makes a call to 3 functions -
SQLADR, SQLFIN, SQLFX7
For the first EXEC SQL statement which is a CONNECT, all the 3 functions get called properly.
But for the second EXEC SQL statement which is a EXECUTE IMMEDIATE, it crashes, gives a segmentation fault in sqlocc.
Previous Topic: Redefinition error when precompile more than one .pc file in a VC++ project
Next Topic: Using Pointer to a structure for selecting multiple rows from a table
Goto Forum:
  


Current Time: Thu Sep 23 13:54:49 CDT 2021