Re: [sqlite] how to cast utf16 text to int?

2007-12-12 Thread Trevor Talbot
On 12/11/07, Maxim V. Shiyanovsky <[EMAIL PROTECTED]> wrote: > One more question - is there any way to insert utf-16 string from > sqlite3.exe? > As I understand I can't use syntax like this: > insert into t values (X'31003700', 1); No; the sqlite3 shell deals only in UTF-8, which is hard to

RE: [sqlite] how to cast utf16 text to int?

2007-12-11 Thread Maxim V. Shiyanovsky
Sorry again. The problem is solved. I had to read FM :) and use sqlite3_open16 instead of sqlite3_open. -Original Message- From: Maxim V. Shiyanovsky [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 2:34 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] how to cast utf16

RE: [sqlite] how to cast utf16 text to int?

2007-12-11 Thread Maxim V. Shiyanovsky
Sorry, I forgot initial problem. As I wrote in the first letter I need cast from utf-16 text to int. In other words I need select like this: Select * from t, d where cast(t.value as int) = d.id Assuming t.value is utf-16 presentation of numeric. This select works fine for one-digit value. It

RE: [sqlite] how to cast utf16 text to int?

2007-12-11 Thread Maxim V. Shiyanovsky
, 2007 10:42 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] how to cast utf16 text to int? On 12/5/07, Maxim V. Shiyanovsky <[EMAIL PROTECTED]> wrote: > I have table that holds values of different types in utf16. > I also know value type for the current row. > How should I cast v

Re: [sqlite] how to cast utf16 text to int?

2007-12-10 Thread Trevor Talbot
On 12/5/07, Maxim V. Shiyanovsky <[EMAIL PROTECTED]> wrote: > I have table that holds values of different types in utf16. > I also know value type for the current row. > How should I cast value to compare it with integer? > > This test shows 1 instead of 17 that I expected. > > sqlite> create

[sqlite] how to cast utf16 text to int?

2007-12-05 Thread Maxim V. Shiyanovsky
I have table that holds values of different types in utf16. I also know value type for the current row. How should I cast value to compare it with integer? This test shows 1 instead of 17 that I expected. sqlite> create table t (value text, field_type int); sqlite> insert into t values