Thread: BoolsAsChar

BoolsAsChar

From
Eric Hallander
Date:
I am running the same version of the libodbcpsql.sl on two different
machines, and for some unknown reason the values in odbc.ini are being
ignored with regard to the BoolsAsChar setting.

I turned CommLog on on both machines, and see the trace from both
executions. On the good machine the bools_as_char setting reflects its
odbc.ini setting, and on the bad machine it always shows as 1.

I have been racking my brain trying to remember all the things I did on the
development machine to get my odbc library stuff working, and maybe I am
just missing something on the IT machine.


Bad Machine Output:
conn = 1073859256, PGAPI_Connect(DSN='EMSADM', UID='emsadm', PWD='')
Global Options: Version='07.01.0009', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarc
har_size=8190
                disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=0
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1
                extra_systable_prefixes='dd_;', conn_settings=''



Good Machine output
conn = 1073859120, PGAPI_Connect(DSN='Eric', UID='eric', PWD='')
Global Options: Version='07.01.0009', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size
=8190
                disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=0
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=0
                extra_systable_prefixes='dd_;', conn_settings=''


Any Ideas

Eric


Eric Hallander
Tellium Inc.
2 Crescent Place
Oceanport, NJ 07757
(732) 483-2922
(732) 923-9804 FAX
mailto:ehallander@tellium.com <mailto:ehallander@tellium.com>
http://www.tellium.com <http://www.tellium.com/>



Re: BoolsAsChar

From
Matt Clark
Date:
I have recently upgraded from postgresql-7.2x to postgresql-7.3, and also
downloaded the ODBC version psqlodbc-7.01.00.03-src.

My application is running on Solaris, and was running correctly under
postgresql-7.2x

However, attempting to run under postgresql-7.3 and the psqlodbc-7.01 appears to
have problems.

1 - apparently there is a problem with the flag "ksqo", which 7.3 does not
recognize.  I found a patch in the archives which apparently just comments out
the SQLExecDirect call which sets the flag.  The patch doesn't match the code in
connection.c, however....

2 - apparently there is a problem in that my database appears to be opened
readonly.  Using SQLDirectExec  with the string "update MYCOUNTER set CVALUE =
101 where CNAME='USER_ID'" fails with the error message 'Connection is
readonly'.  I can issue the same SQL statement from psql successfully.  Is there
some other flag that changed?

Any hints?

The client is running on Solaris, not NT.

Thanks,

Matt
M



Re: BoolsAsChar

From
"Dave Page"
Date:

> -----Original Message-----
> From: Matt Clark [mailto:mclark@rushe.aero.org]
> Sent: 12 December 2002 23:39
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] BoolsAsChar

Hi,

> 1 - apparently there is a problem with the flag "ksqo", which
> 7.3 does not
> recognize.  I found a patch in the archives which apparently
> just comments out
> the SQLExecDirect call which sets the flag.  The patch
> doesn't match the code in
> connection.c, however....

In connection.c here (on the machine that built the distribution) I
have:

    /* KSQO (not applicable to 7.1+ - DJP 21/06/2002) */
    if (ci->drivers.ksqo && PG_VERSION_LT(self, 7.1))
    {
        result = PGAPI_ExecDirect(hstmt, "set ksqo to 'ON'",
SQL_NTS);
        if ((result != SQL_SUCCESS) && (result !=
SQL_SUCCESS_WITH_INFO))
            status = FALSE;

        mylog("%s: result %d, status %d from set ksqo\n", func,
result, status);

    }

What do you have in connection.c?

Regards, Dave.

Re: BoolsAsChar

From
Eric Hallander
Date:
Just to add alittle spice,

I am running 7.2.3 PG on both machines, and I did finally get BoolsAsChar
recognized, but it was only after moving the attributes from my odbcinst.ini
to my odbc.ini file. While this perplexes me, I will take the solution. I
don't understand how the Driver parameter could be read successfully from
the odbcinst.ini, but not the other parameters. Oh well.

Thanks

Eric

> -----Original Message-----
> From: Eric Hallander [mailto:ehallander@tellium.com]
> Sent: Thursday, December 12, 2002 5:30 PM
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] BoolsAsChar
>
>
> I am running the same version of the libodbcpsql.sl on two different
> machines, and for some unknown reason the values in odbc.ini are being
> ignored with regard to the BoolsAsChar setting.
>
> I turned CommLog on on both machines, and see the trace from both
> executions. On the good machine the bools_as_char setting reflects its
> odbc.ini setting, and on the bad machine it always shows as 1.
>
> I have been racking my brain trying to remember all the
> things I did on the
> development machine to get my odbc library stuff working, and
> maybe I am
> just missing something on the IT machine.
>
>
> Bad Machine Output:
> conn = 1073859256, PGAPI_Connect(DSN='EMSADM', UID='emsadm', PWD='')
> Global Options: Version='07.01.0009', fetch=100, socket=4096,
> unknown_sizes=0, max_varchar_size=254, max_longvarc
> har_size=8190
>                 disable_optimizer=1, ksqo=1, unique_index=1,
> use_declarefetch=0
>                 text_as_longvarchar=1, unknowns_as_longvarchar=0,
> bools_as_char=1
>                 extra_systable_prefixes='dd_;', conn_settings=''
>
>
>
> Good Machine output
> conn = 1073859120, PGAPI_Connect(DSN='Eric', UID='eric', PWD='')
> Global Options: Version='07.01.0009', fetch=100, socket=4096,
> unknown_sizes=0, max_varchar_size=254, max_longvarchar_size
> =8190
>                 disable_optimizer=1, ksqo=1, unique_index=1,
> use_declarefetch=0
>                 text_as_longvarchar=1, unknowns_as_longvarchar=0,
> bools_as_char=0
>                 extra_systable_prefixes='dd_;', conn_settings=''
>
>
> Any Ideas
>
> Eric
>
>
> Eric Hallander
> Tellium Inc.
> 2 Crescent Place
> Oceanport, NJ 07757
> (732) 483-2922
> (732) 923-9804 FAX
> mailto:ehallander@tellium.com <mailto:ehallander@tellium.com>
> http://www.tellium.com <http://www.tellium.com/>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>