Re: [GENERAL] connection problem with ecpg (SOLVED) - Mailing list pgsql-general

From Lincoln Spiteri
Subject Re: [GENERAL] connection problem with ecpg (SOLVED)
Date
Msg-id 365431F0.D46C55C@st.com
Whole thread Raw
In response to connection problem with ecpg  (Lincoln Spiteri <lincoln.spiteri@st.com>)
List pgsql-general
Hello again,

Couldn't wait and did what should have done before opening my mouth!

It just happens that there might be a bug in ECPG. When looking at the
code genereted for the line:

    exec sql CONNECT 'my_db';

the output after runing my source through the preprocessor was:

     no_auto_trans = 0;
    ECPGconnect(__LINE__, NULL, "my_db", NULL,NULL);
#line 96 "my_source.c"

This wont't work. Manually editing the generated code fixes the problem
and everything works ok. The code should be:

    no_auto_trans = 0;
    ECPGconnect(__LINE__, "my_db", NULL, NULL,NULL);
#line 96 "my_source.c

Regards

Lincoln Spiteri
STMicroelectronics (Malta)

lincoln.spiteri@st.com wrote:
>
> Hi,
>
> I have been using EPCG since 6.3.2 with no problems. I am extending some
> code written in my 6.3.2 days which is now targeting a newly built 6.4.
> I now have a problem connecting to my database.
>
> The command:
>
>
> give out the following error during runtime:
>
>         connect: could not open database NULL.
>
> Has the syntaxt changed in anyway or could it be a setup problem.
>
> Any help would be greatly aprreciated.
>
> Regards
>
> Lincoln Spiteri
> (STMicroelectronics, Malta)

pgsql-general by date:

Previous
From: Lincoln Spiteri
Date:
Subject: connection problem with ecpg
Next
From: eddie w
Date:
Subject: How to compile correctly with gcc?