pro*c segmentation fault!!!!!!!
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: pro*c segmentation fault!!!!!!!

  1. #1
    Join Date
    May 2003
    Posts
    10

    pro*c segmentation fault!!!!!!!

    Hi,
    I am using a make file to compile a pro*C program.I am able to compile and generate the executable.However while I am executing the program I am encountering a segmentation fault.It gives this fault on encountering a EXEC SQL statement.The following is a part of the code that is giving this fault.

    memset((char*)username.arr, 0x00, 20);
    strcpy((char*)username.arr, "user/pwd");
    username.len = strlen((char*)username.arr);

    fprintf(stdout, "DEBUG=Connect to database\n");

    EXEC SQL CONNECT :username;
    if (sqlca.sqlcode != OK) {
    fprintf(stderr, "\nUnable to connect - sqlca.sqlcode[%d]\n\n", s
    qlca.sqlcode);
    exit(NOTOK);
    }

    Can anyone please help me with this?

    Aakhil
    Last edited by aakhil; 09-02-2003 at 03:50 AM.

  2. #2
    Join Date
    Dec 2002
    Location
    Chennai, India
    Posts
    104
    Just try this......

    memset(username, 0,sizeof(username));
    strcpy(username, "user/pwd");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width