Re: Basic Pro*C problem
Date: Fri, 14 Sep 2001 17:50:34 GMT
Message-ID: <0og4qtkido68e3jritc8bt5ifqj9k17nmf_at_4ax.com>
On Thu, 13 Sep 2001 13:49:00 +0200, Pierre Charpenay <pierre.charpenay_at_unilog.fr> wrote:
>First, check if your username is not longer than 32 characters (take
>care of * with Unix shell).
The user/pass string is well within 32 characters, I even tried it with scott/tiger.
>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).
Well I am on a SunOS system.
>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
Received on Fri Sep 14 2001 - 19:50:34 CEST