Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8A8DC47617D for ; Thu, 24 Oct 2002 19:41:06 -0400 (EDT) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id A50C3476112 for ; Thu, 24 Oct 2002 19:41:04 -0400 (EDT) Received: (qmail 28002 invoked from network); 24 Oct 2002 23:41:06 -0000 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 24 Oct 2002 23:41:06 -0000 Received: from tpf.co.jp (3dgateway1 [126.0.1.60]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id IAA15404; Fri, 25 Oct 2002 08:41:04 +0900 (JST) Message-ID: <3DB88553.BF2B903B@tpf.co.jp> Date: Fri, 25 Oct 2002 08:42:11 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Scot Loach Cc: "'pgsql-odbc@postgresql.org'" Subject: Re: 64-bit type in SQLBindParameter References: Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/83 X-Sequence-Number: 2168 Scot Loach wrote: > > Is it possible to use 64-bit types for bound queries? > > Here's my setup: > FreeBSD 4.7 > UnixODBC 2.2.0 > PostgreSQL 7.2.1 > PostgreSQL/UnixODBC driver 7.2.1 > > I'm using the BIGINT type for my column. > The program below prints out the error message: > > [unixODBC]Error while executing the query; > ERROR: parser: parse error at or near ")" > > It works if I change the SQL_BIGINT to SQL_INTEGER, but > it only uses 32 bits of the number in that case. > > #include > #include > #include > > main() > { > SQLHENV env; > SQLHDBC dbc; > SQLINTEGER val = 0; > unsigned long long ll = 6000000000; > > SQLAllocEnv(&env); > SQLAllocConnect(env, &dbc); > SQLConnect(dbc, (SQLCHAR*)"my_db", SQL_NTS, (SQLCHAR*)0, 0, (SQLCHAR*)0, > 0); > SQLCHAR sql[] = "INSERT INTO my_table (my_column) VALUES (?)"; > > HSTMT hstmt; > SQLAllocStmt(dbc, &hstmt); > SQLPrepare(hstmt, sql, SQL_NTS); > SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_DEFAULT, SQL_BIGINT, > 0, 0, &ll, 0, &val); SQL_C_DEFAULT for SQL_BIGINT is SQL_C_CHAR. You can't specify SQL_C_SBIGINT(UBIGINT) for the C Data Type under the driver. regards, Hiroshi Inoue http://w2422.nsk.ne.jp/~inoue/