Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13

2004-11-04 Thread Liz Steel
Sorry to keep on about this, but I raised a ticket on Tuesday (number 981) 
with severity and priority of 1 (since this is a major issue for my projet) 
and I haven't heard anything back yet.

Even if it is not going to be fixed, I really need to know, as then we can 
take some other action with this.

Thanks,
Liz.
_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13

2004-11-02 Thread Liz Steel
Thanks for your reply, however, wcstombs uses the default code page rather 
that UTF8, which is where I was going wrong with using it originally.

Unfortunately, it is unlikely that I will get approval to use libiconv as it 
is third-party software.

How much effort is involved with converting to SQLite 3.x? I'm not sure if I 
can get approval to use that either, but if that's the only way I'm going to 
get it to work, then I may have to do it.

Liz.
Original Message Follows
From: Cory Nelson <[EMAIL PROTECTED]>
Reply-To: Cory Nelson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13
Date: Tue, 2 Nov 2004 08:41:25 -0800
Well, wcstombs uses WideCharToMultiByte() internally, with some more
locality checks added in.  Maybe you are using it wrong?
If you cant get that to work, libiconv is great for converting charsets.
Is there any reason you can't use sqlite 3.x?  It has native unicode 
support.

On Tue, 02 Nov 2004 15:50:59 +, Liz Steel <[EMAIL PROTECTED]> wrote:
> Hello - I hope somebody can help me!
>
> I am using SQLite version 2.8.13 as a DLL with a windows C++ application. 
I
> have the SQLITE_UTF8 macro defined.
>
> I have no problems adding and retrieving strings to and from the database 
-
> I am using WideCharToMultiByte and MultiByteToWideChar to convert from
> CString (Wide) to char * (Multibyte).
>
> (Previously I was using wcstombs and mbstowcs to convert, but this 
doesn't
> support Greek and Russian characters, and I don't think it was actually
> converting the strings properly.)
>
> However, when I call sqlite_open with a multibyte string, it doesn't seem 
to
> work as I expect.
>
> To clarify: I have a database name with Swedish characters in, which are
> converted to multibyte characters, however, the filename that is created
> treats each of the characters separately, which then causes problems 
later.
> As an example, the string "Ändrad" is converted to "Ändrad".
>
> If I use wcstombs to convert the filename string, this works OK for 
Swedish
> characters, but then doesn't work for Greek characters.
>
> Does anyone have any ideas?
>
> Thanks,
>
> Liz.
>
> _
> Use MSN Messenger to send music and pics to your friends
> http://www.msn.co.uk/messenger
>
>

--
Cory Nelson
http://www.int64.org
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger



[sqlite] Question about UTF8 encoding in SQLite version 2.8.13

2004-11-02 Thread Liz Steel
Hello - I hope somebody can help me!
I am using SQLite version 2.8.13 as a DLL with a windows C++ application. I 
have the SQLITE_UTF8 macro defined.

I have no problems adding and retrieving strings to and from the database - 
I am using WideCharToMultiByte and MultiByteToWideChar to convert from 
CString (Wide) to char * (Multibyte).

(Previously I was using wcstombs and mbstowcs to convert, but this doesn't 
support Greek and Russian characters, and I don't think it was actually 
converting the strings properly.)

However, when I call sqlite_open with a multibyte string, it doesn't seem to 
work as I expect.

To clarify: I have a database name with Swedish characters in, which are 
converted to multibyte characters, however, the filename that is created 
treats each of the characters separately, which then causes problems later. 
As an example, the string "Ändrad" is converted to "Ändrad".

If I use wcstombs to convert the filename string, this works OK for Swedish 
characters, but then doesn't work for Greek characters.

Does anyone have any ideas?
Thanks,
Liz.
_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger



Re: [sqlite] Effectiveness of PRAGMA integrity_check;

2004-04-15 Thread Liz Steel
Hello again,

I'm not sure if you received my last email, so I'm sending it to the list in 
the hope that someone can help me.

You say that I shouldn't get a corrupt database when I pull the power, but I 
am consistently getting this. I am using SQLite version 2.8.9 using the C++ 
interface running on Windows XP Home. Is there anything I can do to stop 
this happening?

Thanks,

Liz.

Original Message Follows
From: "D. Richard Hipp" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [sqlite] Effectiveness of PRAGMA integrity_check;
Date: Wed, 14 Apr 2004 10:50:28 -0400
Liz Steel wrote:
I am trying to do a similar sort of thing with my database. The only way 
I've found to fairly reliably create a corrupt database file is to pull the 
battery out of my laptop whilst my application is accessing the 
database

I've just tried it, and I get a code 11 (SQLITE_CORRUPT) returned from the 
PRAGMA integrity_check command. Is this correct behaviour?

No, this is not correct.  SQLite is suppose to survive an abrupt
power loss with no loss of data.  (Uncommitted transactions will be
rolled back, but committed transactions should persist and be
consistent.)
I believe that SQLite does survive power loss without problems
on Linux.  However, I have received reports that the windows API
function FlushFileBuffers() sometimes lies and does not really
flush contents to the disk surface as it claims it does.  This
is just hearsay - I have not independently verified those reports.
If FlushFileBuffers() does lie and a power loss occurred in the
middle of a COMMIT, then database corruption is possible on
windows.  This is a bug in the OS and there is not anything
SQLite (or any other database engine) can do about it.
There was a bug in SQLite version 2.8.12 that could cause
database corruption if a power loss occurred at a particularly
inauspicious moment in the middle of a COMMIT.  That problem
was fixed with version 2.8.13.
If you are seeing database corruption following power loss
on Linux with SQLite version 2.8.13, please let us know about
it right away.  If you are seeing corruption on Windows, let
us know there too - the problem might be the FlushFileBuffers()
bug or it might be something else - either way we want to
investigate.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [sqlite] Effectiveness of PRAGMA integrity_check;

2004-04-14 Thread Liz Steel
Hello!

I am trying to do a similar sort of thing with my database. The only way 
I've found to fairly reliably create a corrupt database file is to pull the 
battery out of my laptop whilst my application is accessing the database. I 
haven't used the "PRAGMA integrity_check;" command, but I will try it now 
and see if that detects my corrupt database. At the moment, I am selecting 
every row from every table, but I can see this getting a bit slow when my 
database gets bigger.

I've just tried it, and I get a code 11 (SQLITE_CORRUPT) returned from the 
PRAGMA integrity_check command. Is this correct behaviour? Will I always get 
this error returned? The website says something about it returning "ok" but 
I didn't check this as I am using sqlite_exec.

I haven't managed to find anything on the website about using the journal 
file that is created. Can anyone point me in the right direction to using 
this file to re-create my database? Would I need to take a backup of the 
database file before every transaction to use this?

Thanks,

Liz.

Original Message Follows
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [sqlite] Effectiveness of PRAGMA integrity_check;
Date: Wed, 14 Apr 2004 15:48:57 +1000
G'day,

I'm trying to write some defensive code that is able to recover from
database corruption. The idea is that if a disk fails and a database
becomes corrupt it can be detected and synchronised from a backup copy.
To this end, I've just been trying to write a function that returns true
only when it is sure the database is ok. I use PRAGMA integrity check; and
compare the returned string with "ok". When I tried this with a few random
database changes, though, I had a hard time trying to get the corruption
to trigger. I did the following:
CREATE TABLE foo(bar);
INSERT INTO foo VALUES("bar");
I then went in with a text editor and started modifying the bar record. I
changed "bar" to "car", but the change was not detected. I started
modifying characters to the left and right of the "car" string, but still
no corruption. I was able to get corruption to be detected when I
truncated the file.
Can I take it from this behaviour that there isn't any checksum checking
going on apart from headers and the BTrees themselves? Will the
integrity_check at least guarantee me that I won't at some later stage get
an SQLITE_CORRUPT return?
Benjamin.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Tired of 56k? Get a FREE BT Broadband connection 
http://www.msn.co.uk/specials/btbroadband

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Case sensitivity using LIKE.

2004-03-12 Thread Liz Steel
I have a problem that I'm hoping someone has already solved, or at least can 
point me in the right direction.

I am using LIKE in a SELECT statement to search my database. Everything is 
fine when using standard English characters, and the select is not case 
sensitive, which is what I want

However, if I use Swedish/German characters, for example Åå Ää Öö Üü, then 
the select is not case sensitive.

I realise that this is a known issue with the current version of SQLite, but 
I am hoping that someone can point me in the right direction to solve this, 
either in the SQL statement itself, or in my code. (I am using Visual C++.)

Thanks,

Liz.

_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Corrupt database problem.

2004-01-09 Thread Liz Steel
I'm getting an error in my code when I perform a sqlite_finalize on a 
particular table. I have stepped through the code and no rows are returned, 
but why do I get the error here, rather than on sqlite_compile, or 
sqlite_open?

I've looked at the database using the command line interface, and when I do 
a select on this table, I get quite a lot of rows, and then an error:

SQL error: database disk image is malformed

Can anyone shed any light on why I might get this error? What does it mean? 
Is there any way to repair the database?

Thanks in advance,

Liz.

_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] How do I get the last item in a list.

2003-12-04 Thread Liz Steel
I've solved it!

select * from (select * from hooverobject where timestamp < '2003/12/04 
12:00:00:000' order by timestamp desc limit 100) order by timestamp asc 
limit 1

Liz.

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] How do I get the last item in a list.

2003-12-04 Thread Liz Steel
I'm doing a select on a table as follows, and I want to get the last item in 
the list. How can I do this without having to step through all of the 
previous items? This may or may not return 100 rows since I cannot be sure 
of the size of the data.

select * from tablename where timestamp < '2003/12/04 12:00:00:000' order by 
timestamp limit 100;

Also, how do I access the archive of messages sent to this list now that 
it's moved from Yahoo?

Thanks,

Liz.

_
Find a cheaper internet access deal - choose one to suit you. 
http://www.msn.co.uk/internetaccess

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] How do I get the last item in a list.

2003-12-04 Thread Liz Steel
Nope - that just gets the one closest to the date I specified. Perhaps you 
meant to use "asc" instead of "desc", but that gets the oldest one in the 
list.

What I'm trying to do is get the timestamp of 100th (or less if there are 
less than 100 previous items) previous item in the list.

Thanks,

Liz.

Original Message Follows
From: Gerhard Häring <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] How do I get the last item in a list.
Date: Thu, 04 Dec 2003 15:58:41 +0100
Liz Steel wrote:
I'm doing a select on a table as follows, and I want to get the last item 
in the list. How can I do this without having to step through all of the 
previous items? This may or may not return 100 rows since I cannot be sure 
of the size of the data.

select * from tablename where timestamp < '2003/12/04 12:00:00:000' order 
by timestamp limit 100;
select * from tablename where timestamp < '2003/12/04 12:00:00:000'
order by timestamp desc limit 1;
HTH,

-- Gerhard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]