Re: Regarding PostgreSQL BIT datatype binding in ODBC.......
От | ranjeeth kumar |
---|---|
Тема | Re: Regarding PostgreSQL BIT datatype binding in ODBC....... |
Дата | |
Msg-id | 1347251524.26745.YahooMailNeo@web190003.mail.sg3.yahoo.com обсуждение исходный текст |
Ответ на | Regarding PostgreSQL BIT datatype binding in ODBC....... (ranjeeth kumar <ranjeeth_cool@yahoo.co.in>) |
Ответы |
Re: Regarding PostgreSQL BIT datatype binding in ODBC.......
|
Список | pgsql-odbc |
Hello All,
I have a table with a bit(10) type colmn. I can insert "1010110110" into that column from PSQL.
i.e.,
postgres=# insert into public.ranc2b values(1,'1101010101');
INSERT 0 1
I want to insert the same character data "1010110110" into the same bit(10) typed column from an ODBC application program,
Can somebody please suggest me how should I bind the data in the SQLBindParameter call.
I tried to bind the data as SQL_BINARY and SQL_CHAR but I got Incorrect binary data format error.
Quick help is appreciated.
Thanks in Advance.
Regards,
Ranjeeth.
From: ranjeeth kumar <ranjeeth_cool@yahoo.co.in>
To: "pgsql-odbc@postgresql.org" <pgsql-odbc@postgresql.org>
Sent: Thursday, 2 August 2012 12:55 PM
Subject: Regarding PostgreSQL BIT datatype binding in ODBC.......
I have a table with a bit(10) type colmn. I can insert "1010110110" into that column from PSQL.
i.e.,
postgres=# insert into public.ranc2b values(1,'1101010101');
INSERT 0 1
I want to insert the same character data "1010110110" into the same bit(10) typed column from an ODBC application program,
Can somebody please suggest me how should I bind the data in the SQLBindParameter call.
I tried to bind the data as SQL_BINARY and SQL_CHAR but I got Incorrect binary data format error.
Quick help is appreciated.
Thanks in Advance.
Regards,
Ranjeeth.
From: ranjeeth kumar <ranjeeth_cool@yahoo.co.in>
To: "pgsql-odbc@postgresql.org" <pgsql-odbc@postgresql.org>
Sent: Thursday, 2 August 2012 12:55 PM
Subject: Regarding PostgreSQL BIT datatype binding in ODBC.......
Hello All,
I am new to this mailing list and this is my first post :)
I want to pass numeric data (2345) into a PostgreSQL BIT datatype column bit(1) using dynamic sql thru ODBC. I very much understand the risk of data getting truncated...
On PSQL, I simply can do -- insert into tab values(CAST(2345 AS BIT(1))) to acheive what i want (and I understand only 1 would get inserted). But I want to do this through ODBC and dynamic sql.
I will have to prepare my query as
insert into tab values(CAST(? AS bit(1));
then bind 2345 and then execute the statement.
Can someone help me on how the binding should happen...
I mean wat should be the "ValueType" and the "ParameterType" etc. in the call to the SQLBindParameter function....
SQLRETURN SQLBindParameter(
SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
SQLSMALLINT InputOutputType,
SQLSMALLINT ValueType,
SQLSMALLINT ParameterType,
SQLULEN ColumnSize,
SQLSMALLINT DecimalDigits,
SQLPOINTER ParameterValuePtr,
SQLLEN BufferLength,
SQLLEN * StrLen_or_IndPtr);
Quick help is appreciated and additional inputs/coments are also most welcome...
Thanks and Regards,
Ranjeeth.
В списке pgsql-odbc по дате отправления: