unicode vs non-unicode ODBC driver

unicode vs non-unicode ODBC driver

am 13.01.2010 00:48:56 von the6campbells

--001485eb00a4130879047d004c1f
Content-Type: text/plain; charset=ISO-8859-1

Consider a simple scenario.

CREATE DATABASE "TEST1"
WITH OWNER = postgres
ENCODING = 'WIN1252'
LC_COLLATE = 'English, United States'
LC_CTYPE = 'English, United States'
CONNECTION LIMIT = -1;

CREATE TABLE z
(
c1 character(6)
)

If you invoke sqlColumns the data type returned from the column changes
depending on if you used the UNICODE or non-UNICODE driver. This is with the
8.04.01 driver.

Get Data All:
"TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE",
"TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS",
"COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
"ORDINAL_POSITION", "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE",
"AUTO_INCREMENT", "PHYSICAL NUMBER", "TABLE OID", "BASE TYPEID"
"TEST1", "public", "z", "c1", 1, "bpchar", 6, 6, , , 1, "",
, 1, , 12, 1, , 6, 1042, 0, 1, 45819, 0
1 row fetched from 24 columns.


Get Data All:
"TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE",
"TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS",
"COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
"ORDINAL_POSITION", "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE",
"AUTO_INCREMENT", "PHYSICAL NUMBER", "TABLE OID", "BASE TYPEID"
"TEST1", "public", "z", "c1", -8, "bpchar", 6, 12, , , 1, "",
, -8, , 12, 1, , 6, 1042, 0, 1, 45819, 0
1 row fetched from 24 columns.

--001485eb00a4130879047d004c1f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable


Consider a simple scenario.

iv>
CREATE DATABASE "TEST1"
  WITH OWNER =3D po=
stgres
   =A0 =A0 ENCODING =3D 'WIN1252'
=
   =A0 =A0 LC_COLLATE =3D 'English, United States'

   =A0 =A0 LC_CTYPE =3D 'English, United States'
>   =A0 =A0 CONNECTION LIMIT =3D -1;

CREA=
TE TABLE z
(
  c1 character(6)
)
iv>


If you invoke sqlColumns the data type returned from the column change=
s depending on if you used the UNICODE or non-UNICODE driver. This is with =
the 8.04.01 driver.

Get Data All:

"TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME"=
;, "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", &=
quot;PRECISION", "LENGTH", "SCALE", "RADIX&qu=
ot;, "NULLABLE", "REMARKS", "COLUMN_DEF", &qu=
ot;SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENG=
TH", "ORDINAL_POSITION", "IS_NULLABLE", "DISP=
LAY_SIZE", "FIELD_TYPE", "AUTO_INCREMENT", "P=
HYSICAL NUMBER", "TABLE OID", "BASE TYPEID"

"TEST1", "public", "z", "c1", =
1, "bpchar", 6, 6, <Null>, <Null>, 1, "", &=
lt;Null>, 1, <Null>, 12, 1, <Null>, 6, 1042, 0, 1, 45819, 0<=
/div>
1 row fetched from 24 columns.


>Get Data All:
"TABLE_QUALIFIER", "TABLE_OWNER&quo=
t;, "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE",=
"TYPE_NAME", "PRECISION", "LENGTH", "SC=
ALE", "RADIX", "NULLABLE", "REMARKS", &q=
uot;COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB&quo=
t;, "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_N=
ULLABLE", "DISPLAY_SIZE", "FIELD_TYPE", "AUTO=
_INCREMENT", "PHYSICAL NUMBER", "TABLE OID", "=
;BASE TYPEID"

"TEST1", "public", "z", "c1", =
-8, "bpchar", 6, 12, <Null>, <Null>, 1, "",=
<Null>, -8, <Null>, 12, 1, <Null>, 6, 1042, 0, 1, 45819,=
0

1 row fetched from 24 columns.


--001485eb00a4130879047d004c1f--

Re: unicode vs non-unicode ODBC driver

am 13.01.2010 10:36:43 von Hiroshi Inoue

the6campbells wrote:
>
> Consider a simple scenario.
>
> CREATE DATABASE "TEST1"
> WITH OWNER = postgres
> ENCODING = 'WIN1252'
> LC_COLLATE = 'English, United States'
> LC_CTYPE = 'English, United States'
> CONNECTION LIMIT = -1;
>
> CREATE TABLE z
> (
> c1 character(6)
> )
>
> If you invoke sqlColumns the data type returned from the column changes
> depending on if you used the UNICODE or non-UNICODE driver. This is with
> the 8.04.01 driver.
>
> Get Data All:
> "TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME",
> "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX",
> "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE",
> "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION",
> "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE", "AUTO_INCREMENT", "PHYSICAL
> NUMBER", "TABLE OID", "BASE TYPEID"
> "TEST1", "public", "z", "c1", 1, "bpchar", 6, 6, , , 1, "",
> , 1, , 12, 1, , 6, 1042, 0, 1, 45819, 0
> 1 row fetched from 24 columns.

It returns SQL_CHAR(=1).

> Get Data All:
> "TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME",
> "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX",
> "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE",
> "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION",
> "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE", "AUTO_INCREMENT", "PHYSICAL
> NUMBER", "TABLE OID", "BASE TYPEID"
> "TEST1", "public", "z", "c1", -8, "bpchar", 6, 12, , , 1,
> "", , -8, , 12, 1, , 6, 1042, 0, 1, 45819, 0
> 1 row fetched from 24 columns.

It returns SQL_WCHAR(=-8).

regards,
Hiroshi Inoue


--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc