pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lothar.behrens@lollisoft.de <lothar.behrens@lollisoft.de>
To: pgsql-odbc@postgresql.org
Subject: Re: VARCHAR, CHAR types changed ?
Date: 25 Nov 2005 05:20:49 -0800
Message-ID: <1132924849.659236.187420@o13g2000cwo.googlegroups.com> (raw)
In-Reply-To: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4E7E37B@ratbert.vale-housing.co.uk>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4E7E37B@ratbert.vale-housing.co.uk>

I have tried to use ANSI driver. It crashes :-(

My code to connect and setup a statement looks like this:

SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*) SQL_OV_ODBC3, 0);

SQLSetConnectAttr(hdbc,
        SQL_ATTR_ODBC_CURSORS,
        SQL_CUR_USE_IF_NEEDED, 0);

SQLConnect(hdbc, (unsigned char*) DSN, SQL_NTS,
                 (unsigned char*) user, SQL_NTS,
                 (unsigned char*) passwd, SQL_NTS);

SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_ON);

SQLSetStmtOption(hstmt, SQL_ATTR_CONCURRENCY, SQL_CONCUR_ROWVER);
SQLSetStmtOption(hstmt, SQL_CURSOR_TYPE, SQL_CURSOR_KEYSET_DRIVEN);

This is my standard setup to do database work. All these steps do not
report any error.

The following happens:

char buf[] = "create table regressiontest ("
                "test char(100) DEFAULT 'Nothing',\n"
                "btest bool DEFAULT false, "
                "btest1 bool DEFAULT false"
                ");";

// Do not internally collect meta data, like foreign key to primary key
mapping
query->skipFKCollecting();
query->query(buf);

// Tese statements work properly
query1->query("insert into regressiontest (test) values('Nix')");
query1->query("insert into regressiontest (btest) values(true)");
query1->query("insert into regressiontest (btest1) values(true)");

// This statement crashes inside SQLExecDirect(...)
query1->query("select test, btest, btest1 from regressiontest");

query1->PrintData();
query->query("drop table regressiontest");

The code is simple console based, but my database classes encapsulate
all ODBC
CLI calls. The internal statement handle is reused. The table get's
created and filled.

Any ideas ?




view thread (7+ messages)  latest in thread

Message-ID: <1132924849.659236.187420@o13g2000cwo.googlegroups.com>
Permalink:  ../1132924849.659236.187420@o13g2000cwo.googlegroups.com/
Also on:    postgresql.org/message-id/1132924849.659236.187420@o13g2000cwo.googlegroups.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: lothar.behrens@lollisoft.de
  Subject: Re: VARCHAR, CHAR types changed ?
  In-Reply-To: <1132924849.659236.187420@o13g2000cwo.googlegroups.com>
  References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4E7E37B@ratbert.vale-housing.co.uk> <1132924849.659236.187420@o13g2000cwo.googlegroups.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox