[SqueakDBX] MSSQL, selecting nvarchar (other types too) field causes DBXTypeNotSupported.

Mariano Martinez Peck marianopeck at gmail.com
Fri Apr 29 08:54:37 UTC 2011


Hi Miguel. This is something that we really need to fix and make it clear.

I will try to explain:  OpenDBX library have 4 special functions (check
above in http://www.linuxnetworks.de/doc/index.php/OpenDBX/C_API/1.2) when
managing large objects WHEN the backend requires such.
We wrongly understood that at the beginning. So...we throw
DBXTypeNotSupported for every large object even if we could really support
it.

So...a backend, i.e, a database client library, 1) can support large objects
with the regular functions (like regular fields);  2) or need special
functions to manage them (and hence, use the special functions of OpenDBX).
We ONLY support 1)  since we didn't yet wrap the OpenDBX functions for large
objects.  However, only  Firebird  is using those functions for large
objects. ALL the rest of the backends, use 1), so we should support it.

Now...what is the problem?  as I told you, we misunderstood that and
therefore we directly throw DBXTypeNotSupported for every large object.
Take a look to DBXPlatform class >> createDataTypesMap
Now, "some" were already fixed. For example, createDataTypesMap  overwrites
#createDataTypesMap and fixes Clob and Blob.

Suggestion: take the DBXMSSQLPlatform, overwrite #createDataTypesMap and fix
what you want.

Real solution we should do ?  We should change DBXPlatform class >>
createDataTypesMap   and map ALL types, and the overwrite
#createDataTypesMap  in Firebird to trow erros (like it is now in
DBXPlatform class >> createDataTypesMap).

Was that clear?

Last comment, depending what you are doing, you may not need to transform
the values of a field and instead, get them as string. DBXRow >> #valueAt:
and valueXXX DO the conversion from string to the tpype. However,
#rawValueAt:  and frinds, DO NOT. So, you can always use them and they will
always work, but getting the value as String.

I entered issue:

http://code.google.com/p/dbxtalk/issues/detail?id=3

Thanks

Mariano




On Fri, Apr 29, 2011 at 10:20 AM, Miguel Sanchez <mikey.sanchez at gmail.com>wrote:

> Hi all,
>
> I have a couple of problems but the second I'll pop in a second mail
> to have a clear subject line.
>
> I have a field on a table defined as nvarchar(50) that is throwing a
> DBXTypeNotSupported error despite the default supported type map on
> DBXPlatform which maps the datatype to a String. I've managed to avoid
> needing to select explicitly unsupported types (CLOB BLOC etc.....)
>
> My platform.
> Windows XP sp3
> Pharo 1.1.1 one-click
> DBXOdbcPlatform
>
> Database (on localhost):
> MSSQL 2005
> MSSQL
>
> Best Regards,
>
>
> Miguel
> _______________________________________________
> SqueakDBX mailing list
> SqueakDBX at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/squeakdbx
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeakdbx/attachments/20110429/243f4205/attachment.htm


More information about the SqueakDBX mailing list