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

Miguel Sanchez mikey.sanchez at gmail.com
Fri Apr 29 13:53:01 UTC 2011


OK thanks guys I'll answer answer both in one shot.

> Date: Fri, 29 Apr 2011 10:54:37 +0200
> From: Mariano Martinez Peck <marianopeck at gmail.com>
> Subject: Re: [SqueakDBX] MSSQL, selecting nvarchar (other types too)
>        field   causes DBXTypeNotSupported.
> To: The complete and open-source solution to relational database
>        access  <squeakdbx at lists.squeakfoundation.org>
> Message-ID: <BANLkTi=jeTSo2UOvchsyc=Mp=WbRtfRVxw at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Miguel. This is something that we really need to fix and make it clear.

My apologies for the newbie questions and generally being dense about
understanding the code.

>
> 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.

.... and this includes nvarchar? This doesn't need the large object
functiuon calls does it? doesn't really matter. If it's assigned
unknown then it needs to be handled anyway.
>
> 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.
>
Yup I saw that......

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

> 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?
I think so....... I'll start overriding createDataTypesMap.

> 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.

 ok that's useful. At least I can get at the data in raw form.

> I entered issue:
>
> http://code.google.com/p/dbxtalk/issues/detail?id=3
>
> Thanks
>
> Mariano

Many thanks for the detailed and useful response.

> Date: Fri, 29 Apr 2011 06:00:20 -0300
> From: Diogenes Moreira <diogenes.moreira at gmail.com>
> Subject: Re: [SqueakDBX] MSSQL, selecting nvarchar (other types too)
>        field   causes DBXTypeNotSupported.
> To: The complete and open-source solution to relational database
>        access  <squeakdbx at lists.squeakfoundation.org>
> Message-ID: <BANLkTi=MurApKvuzopN62TyBU2B10LSaRA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi miguel..
>
> why you dont use DBXMSSQLPlatform for MSSQL??

Because I was never able to open the connection to the database using
DBXMSSQLPlatform. I started testing lower level libraries to check
they were all working (freeTDS and OpenDBX). FreeTDS compile fine but
then while I was trying to build OpenDBX the maintainer (Norbert I
think...) suggested I use the ODBC driver instead. I tried it and it
worked so I cut over to DBXOdbcPlatform. If you have any suggestions
I'd love to go back to using the native driver.

>
> well, don't matter.. for give to you a right diagnosis, we need Odbc version
> and what kind of driver.. (ADO or Direct) you are using . If you use ADO,
> wich MDAC version..?

I'll first try getting the raw values as suggested by Mariano. If I
don't have luck with that then I chase this avenue.

>
> DBXTypeNotSupported  is raising when the column type id returned by OpenDbx
> isn´t in the types catalogates or is a "Real" unsupported type.
>
Mariano explains this in depth, thanks.

> you can debug DBXPlatform class>> dataTypeAt: and see what is the id for
> column type returned by OpenDBX.. and send it to us...

will do.....

>
> together we will be find a bug and fix that.
>

Once again thanks for the prompt and useful responses.

Miguel


More information about the SqueakDBX mailing list