Re: Basic Pro*C problem

From: Pierre Charpenay <pierre.charpenay_at_unilog.fr>
Date: Thu, 13 Sep 2001 13:49:00 +0200
Message-ID: <3BA09D2C.CED34D0D_at_unilog.fr>


Hello,

[Quoted] First, check if your username is not longer than 32 characters (take [Quoted] [Quoted] care of * with Unix shell). If all is OK, I remember that there were some problems with some configurations (I'm not sure, but I saw something about the compiler used on Sun ... if someone else knows).

Mark Styles a écrit :
>
> Apologies if this is a simple error, my Pro*C is very rusty. The
> following piece of code is very simple, it compiles fine, but at
> runtime it causes a core dump at the CONNECT point, can anyone explain
> why?
>
> Here is the code:
>
> #include <stdio.h>
>
> EXEC SQL BEGIN DECLARE SECTION;
> VARCHAR username[32];
> EXEC SQL END DECLARE SECTION;
>
> EXEC SQL INCLUDE SQLCA;
>
> int main(int argc, char*argv[])
> {
> strcpy(username.arr, argv[1]);
> username.len = strlen(username.arr);
>
> printf("connecting...\n");
> /* dumps core here */
> EXEC SQL CONNECT :username;
> printf("connected\n");
> }
>
> Mark Styles
> FISTT Oracle Developer

-- 
 Pierre CHARPENAY

    _______
   (\_vvv_/)
  / \ _ ^ / \
  | | o O | |
  |  \   /  |\
   \==\v/==/ \\
    ||-U-||  //
    ++   ++  V
Received on Thu Sep 13 2001 - 13:49:00 CEST

Original text of this message