Quantcast

ODBC param query unicode

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

ODBC param query unicode

Ryan Huffman
According to the release notes the 2.10.8 added unicode support, but thus
far I haven't had any luck getting it to work (
http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html).
 Can anyone shed some light on what is supported?  I've tried using
param_query's with sql_wvarchar but without success (using utf8, utf16
little endian, utf16 big endian, etc...), and selecting rows with utf
characters returns a ? in place of utf characters (as expected, the rest of
the characters are still 8 bits wide rather than 16).

Using 2.10.8 and R14B, connecting to an MSSQL server.

Thanks,

Ryan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ODBC param query unicode

Ingela Andin
Hi!

It says add some unicode support!  (Some is an importante word here).
You have to
handle the encoding yourself but you can insert and extract unicode
data if you know
how your datbase engine handles unicode data.
See the test case unicode in odbc_data_type_SUITE.erl

Regards Ingela Erlang/OTP team - Ericsson AB

2011/2/23 Ryan Huffman <[hidden email]>:

> According to the release notes the 2.10.8 added unicode support, but thus
> far I haven't had any luck getting it to work (
> http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html).
>  Can anyone shed some light on what is supported?  I've tried using
> param_query's with sql_wvarchar but without success (using utf8, utf16
> little endian, utf16 big endian, etc...), and selecting rows with utf
> characters returns a ? in place of utf characters (as expected, the rest of
> the characters are still 8 bits wide rather than 16).
>
> Using 2.10.8 and R14B, connecting to an MSSQL server.
>
> Thanks,
>
> Ryan
>

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ODBC param query unicode

Ryan Huffman
>
> should use mysql native driver, It works fine.


Unfortunately I'm using SQL Server and not MySQL, thank you for the
suggestion though.

It says add some unicode support!  (Some is an importante word here).


Hi Ingela,

Sorry, I should have worded my question better.  I was mostly interested in
finding out what the extent of the added support was :).

Thanks for the tip on the test cases.  Unfortunately I still haven't had any
luck.  The SELECTs still aren't returning unicode, just latin1 binaries. I'm
using Arch Linux, unixODBC and freeTDS.  Using wvarchar always fails with a
bind error - looking at the c code, it looks like a unixodbc or freetds
error.  At this point I'm about ready to throw the towel in.

Thanks for the help,

Ryan

On Wed, Feb 23, 2011 at 1:42 AM, Ingela Andin <[hidden email]>wrote:

> Hi!
>
> It says add some unicode support!  (Some is an importante word here).
> You have to
> handle the encoding yourself but you can insert and extract unicode
> data if you know
> how your datbase engine handles unicode data.
> See the test case unicode in odbc_data_type_SUITE.erl
>
> Regards Ingela Erlang/OTP team - Ericsson AB
>
> 2011/2/23 Ryan Huffman <[hidden email]>:
> > According to the release notes the 2.10.8 added unicode support, but thus
> > far I haven't had any luck getting it to work (
> >
> http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html
> ).
> >  Can anyone shed some light on what is supported?  I've tried using
> > param_query's with sql_wvarchar but without success (using utf8, utf16
> > little endian, utf16 big endian, etc...), and selecting rows with utf
> > characters returns a ? in place of utf characters (as expected, the rest
> of
> > the characters are still 8 bits wide rather than 16).
> >
> > Using 2.10.8 and R14B, connecting to an MSSQL server.
> >
> > Thanks,
> >
> > Ryan
> >
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ODBC param query unicode

Ken Ellis
Ryan,

If you're thinking of throwing in the towel, have you looked at
jinterface + JDBC?  We wound up ditching the ODBC library and using
erlang:open_port to spawn a shell command.  But we're mostly doing
bulk inserts, so COPY form stdin is fast and easy anyway.  We're also
using a shell command to execute and parse the response from an SQL
query.  I had considered briefly jinterface + JDBC to solve some
issues, but did not come to any firm conclusions. Same boat as you,
relatively exotic commercial db, nothing native.  The ODBC library is
useful, for sure, but the level of finish is a bit lower than the rest
of the libs in the OTP distribution.

Ken


On Wed, Feb 23, 2011 at 2:27 PM, Ryan Huffman <[hidden email]> wrote:

>>
>> should use mysql native driver, It works fine.
>
>
> Unfortunately I'm using SQL Server and not MySQL, thank you for the
> suggestion though.
>
> It says add some unicode support!  (Some is an importante word here).
>
>
> Hi Ingela,
>
> Sorry, I should have worded my question better.  I was mostly interested in
> finding out what the extent of the added support was :).
>
> Thanks for the tip on the test cases.  Unfortunately I still haven't had any
> luck.  The SELECTs still aren't returning unicode, just latin1 binaries. I'm
> using Arch Linux, unixODBC and freeTDS.  Using wvarchar always fails with a
> bind error - looking at the c code, it looks like a unixodbc or freetds
> error.  At this point I'm about ready to throw the towel in.
>
> Thanks for the help,
>
> Ryan
>
> On Wed, Feb 23, 2011 at 1:42 AM, Ingela Andin <[hidden email]>wrote:
>
>> Hi!
>>
>> It says add some unicode support!  (Some is an importante word here).
>> You have to
>> handle the encoding yourself but you can insert and extract unicode
>> data if you know
>> how your datbase engine handles unicode data.
>> See the test case unicode in odbc_data_type_SUITE.erl
>>
>> Regards Ingela Erlang/OTP team - Ericsson AB
>>
>> 2011/2/23 Ryan Huffman <[hidden email]>:
>> > According to the release notes the 2.10.8 added unicode support, but thus
>> > far I haven't had any luck getting it to work (
>> >
>> http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html
>> ).
>> >  Can anyone shed some light on what is supported?  I've tried using
>> > param_query's with sql_wvarchar but without success (using utf8, utf16
>> > little endian, utf16 big endian, etc...), and selecting rows with utf
>> > characters returns a ? in place of utf characters (as expected, the rest
>> of
>> > the characters are still 8 bits wide rather than 16).
>> >
>> > Using 2.10.8 and R14B, connecting to an MSSQL server.
>> >
>> > Thanks,
>> >
>> > Ryan
>> >
>>
>

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ODBC param query unicode

Ryan Huffman
Hi Ken,

Thank you for the suggestion.  We threw around a few ideas, including yours,
but ended up opting to put up an http interface which didn't take long.

I agree, the odbc driver is useful, but doesn't seem to get as much
attention as the other db-specific drivers (mysql, postgres).  I have to
imagine the relative demand in the erlang community is unfortunately low in
this regard.

Thanks,

Ryan

On Wed, Feb 23, 2011 at 3:04 PM, Ken Ellis <[hidden email]> wrote:

> Ryan,
>
> If you're thinking of throwing in the towel, have you looked at
> jinterface + JDBC?  We wound up ditching the ODBC library and using
> erlang:open_port to spawn a shell command.  But we're mostly doing
> bulk inserts, so COPY form stdin is fast and easy anyway.  We're also
> using a shell command to execute and parse the response from an SQL
> query.  I had considered briefly jinterface + JDBC to solve some
> issues, but did not come to any firm conclusions. Same boat as you,
> relatively exotic commercial db, nothing native.  The ODBC library is
> useful, for sure, but the level of finish is a bit lower than the rest
> of the libs in the OTP distribution.
>
> Ken
>
>
> On Wed, Feb 23, 2011 at 2:27 PM, Ryan Huffman <[hidden email]>
> wrote:
> >>
> >> should use mysql native driver, It works fine.
> >
> >
> > Unfortunately I'm using SQL Server and not MySQL, thank you for the
> > suggestion though.
> >
> > It says add some unicode support!  (Some is an importante word here).
> >
> >
> > Hi Ingela,
> >
> > Sorry, I should have worded my question better.  I was mostly interested
> in
> > finding out what the extent of the added support was :).
> >
> > Thanks for the tip on the test cases.  Unfortunately I still haven't had
> any
> > luck.  The SELECTs still aren't returning unicode, just latin1 binaries.
> I'm
> > using Arch Linux, unixODBC and freeTDS.  Using wvarchar always fails with
> a
> > bind error - looking at the c code, it looks like a unixodbc or freetds
> > error.  At this point I'm about ready to throw the towel in.
> >
> > Thanks for the help,
> >
> > Ryan
> >
> > On Wed, Feb 23, 2011 at 1:42 AM, Ingela Andin <[hidden email]
> >wrote:
> >
> >> Hi!
> >>
> >> It says add some unicode support!  (Some is an importante word here).
> >> You have to
> >> handle the encoding yourself but you can insert and extract unicode
> >> data if you know
> >> how your datbase engine handles unicode data.
> >> See the test case unicode in odbc_data_type_SUITE.erl
> >>
> >> Regards Ingela Erlang/OTP team - Ericsson AB
> >>
> >> 2011/2/23 Ryan Huffman <[hidden email]>:
> >> > According to the release notes the 2.10.8 added unicode support, but
> thus
> >> > far I haven't had any luck getting it to work (
> >> >
> >>
> http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html
> >> ).
> >> >  Can anyone shed some light on what is supported?  I've tried using
> >> > param_query's with sql_wvarchar but without success (using utf8, utf16
> >> > little endian, utf16 big endian, etc...), and selecting rows with utf
> >> > characters returns a ? in place of utf characters (as expected, the
> rest
> >> of
> >> > the characters are still 8 bits wide rather than 16).
> >> >
> >> > Using 2.10.8 and R14B, connecting to an MSSQL server.
> >> >
> >> > Thanks,
> >> >
> >> > Ryan
> >> >
> >>
> >
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ODBC param query unicode

Ingela Andin
Hi!

I think part of it is because ODBC does not give you all the
transparacy you could wish for so
people think thy might aswell use something native and perhaps get
performance gains. Although we
try to keep our ODBC API useful it is not a very high priority for
Ericsson so we very much
welcome contributions. The ODBC application is fairly small and I
think some of the improvments such
as support for more types in param_query,  better support for NULL
values could be quite easily achived
if you have the time and intrest in adding them.

Regards Ingela Erlang OTP team - Ericsson AB

2011/2/24 Ryan Huffman <[hidden email]>:

> Hi Ken,
> Thank you for the suggestion.  We threw around a few ideas, including yours,
> but ended up opting to put up an http interface which didn't take long.
> I agree, the odbc driver is useful, but doesn't seem to get as much
> attention as the other db-specific drivers (mysql, postgres).  I have to
> imagine the relative demand in the erlang community is unfortunately low in
> this regard.
> Thanks,
> Ryan
>
> On Wed, Feb 23, 2011 at 3:04 PM, Ken Ellis <[hidden email]> wrote:
>>
>> Ryan,
>>
>> If you're thinking of throwing in the towel, have you looked at
>> jinterface + JDBC?  We wound up ditching the ODBC library and using
>> erlang:open_port to spawn a shell command.  But we're mostly doing
>> bulk inserts, so COPY form stdin is fast and easy anyway.  We're also
>> using a shell command to execute and parse the response from an SQL
>> query.  I had considered briefly jinterface + JDBC to solve some
>> issues, but did not come to any firm conclusions. Same boat as you,
>> relatively exotic commercial db, nothing native.  The ODBC library is
>> useful, for sure, but the level of finish is a bit lower than the rest
>> of the libs in the OTP distribution.
>>
>> Ken
>>
>>
>> On Wed, Feb 23, 2011 at 2:27 PM, Ryan Huffman <[hidden email]>
>> wrote:
>> >>
>> >> should use mysql native driver, It works fine.
>> >
>> >
>> > Unfortunately I'm using SQL Server and not MySQL, thank you for the
>> > suggestion though.
>> >
>> > It says add some unicode support!  (Some is an importante word here).
>> >
>> >
>> > Hi Ingela,
>> >
>> > Sorry, I should have worded my question better.  I was mostly interested
>> > in
>> > finding out what the extent of the added support was :).
>> >
>> > Thanks for the tip on the test cases.  Unfortunately I still haven't had
>> > any
>> > luck.  The SELECTs still aren't returning unicode, just latin1 binaries.
>> > I'm
>> > using Arch Linux, unixODBC and freeTDS.  Using wvarchar always fails
>> > with a
>> > bind error - looking at the c code, it looks like a unixodbc or freetds
>> > error.  At this point I'm about ready to throw the towel in.
>> >
>> > Thanks for the help,
>> >
>> > Ryan
>> >
>> > On Wed, Feb 23, 2011 at 1:42 AM, Ingela Andin
>> > <[hidden email]>wrote:
>> >
>> >> Hi!
>> >>
>> >> It says add some unicode support!  (Some is an importante word here).
>> >> You have to
>> >> handle the encoding yourself but you can insert and extract unicode
>> >> data if you know
>> >> how your datbase engine handles unicode data.
>> >> See the test case unicode in odbc_data_type_SUITE.erl
>> >>
>> >> Regards Ingela Erlang/OTP team - Ericsson AB
>> >>
>> >> 2011/2/23 Ryan Huffman <[hidden email]>:
>> >> > According to the release notes the 2.10.8 added unicode support, but
>> >> > thus
>> >> > far I haven't had any luck getting it to work (
>> >> >
>> >>
>> >> http://www3.erlang.org/documentation/doc-5.8/lib/odbc-2.10.8/doc/html/notes.html
>> >> ).
>> >> >  Can anyone shed some light on what is supported?  I've tried using
>> >> > param_query's with sql_wvarchar but without success (using utf8,
>> >> > utf16
>> >> > little endian, utf16 big endian, etc...), and selecting rows with utf
>> >> > characters returns a ? in place of utf characters (as expected, the
>> >> > rest
>> >> of
>> >> > the characters are still 8 bits wide rather than 16).
>> >> >
>> >> > Using 2.10.8 and R14B, connecting to an MSSQL server.
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Ryan
>> >> >
>> >>
>> >
>
>

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Loading...