1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Profortran Exec SQL coredump

Discussion in 'SQL PL/SQL' started by saracooper, May 14, 2010.

  1. saracooper

    saracooper Active Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    80
    Hello, I am using embedded sql in a Fortran program. Whenever I execute an 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.

    Any help is really appreciated. Thanks
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Have you run the core dump through a debugger like adb or dbx to see why it was dumped? Not having that information makes it virtually impossible to diagnose your issue. Please supply the operating system, user environment and some output indicating what error generated the core dump.
     
  3. saracooper

    saracooper Active Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    80
    Thanks zargon. 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 IMEMDIATE, it crashes, gives a segmentation fault in SQLFX7.

    Thank u very much for any help or suggestion in advance.
     
  4. rajavu

    rajavu Forum Guru

    Messages:
    815
    Likes Received:
    52
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Why can't you use ?

    Code (SQL):
    EXEC SQL 'DELETE FROM EMPLOYEES'
     
  5. saracooper

    saracooper Active Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    80
    Thanks raj. I tried exec sql delete from employees. It does not make a difference, gives a coredump ....
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Segmentation faults are memory errors sometimes caused by improper or incomplete configuration. Is there a memory address reported for this fault?
     
  7. saracooper

    saracooper Active Member

    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    80
    I managed to resolve the issue. The problem was that Pro Fortran does not work well with 64 bit, I changed it to 32 bit and no errors. Thank u for your help.