Hi,
There seems to be a problem while processing GUID datatype.
It's being identified as a Binary Data type( datatype = -2) instead of being identified as 1117 (Datatype OTHER + 6) as clarified by HXTT Support in another query posted by a user.
http://www.hxtt.com/support_view_issue.jsp?product=access&id=1176808563
Also please let us know the DDL to create a table with a GUID ( Replication id ) column.
|
We are also having issues in reading and writing to an existing table with a GUID column. Hopefully if the datatype is addressed, then the reading and writing would work as designed.
|
>It's being identified as a Binary Data type( datatype = -2) instead of being identified as 1117 (Datatype OTHER + 6) as clarified by HXTT Support in another query posted by a user.
It has been modified to provide friend known sql type. So you will get Types.BINARY.
You can get the detailed information through
resultSetMetaData.getColumnTypeName(j) :returns GUID AUTO_INCREMENT
resultSetMetaData.getColumnType(j): return -2
typedef struct _GUID {
' unsigned long Data1;
' unsigned short Data2;
' unsigned short Data3;
' unsigned char Data4[8];
'} GUID;
For read, you can use resultSet.getBytes(j) or resultSet.getObject(j): a byte array with the length of 16
For instance, {AA5CCDD9-4BDD-4D11-920C-6E6D30FD330E} value in MS Access, the byte array will be D9 CD 5C AA (-) DD 4B (-) 11 4D (-) 92 0C (-) 6E 6D 30 FD 33 0E.
For write, you needn't to be care, because it will be automatically produced, and can't be modified in MS Access too. If you wish to update or insert it, you can use preparedStatement.setBytes(16-byte array) or SQL Escape Syntax{"varbinary" 'string'})
insert into bbb (a,b) values({"varbinary" '\x7B\x36\x43\x30\x30\x30\x30\x30\x30\x2D\x30\x30\x30\x30\x2D\x3E'}/* a hexstring for guid value */,'ccc');
If you wish to get an auto gernated key, you should use int AUTO_INCREMENT , since it's a simple int type.
|