Re: [sqlite] (no subject)

2009-08-21 Thread Jean-Christophe Deschamps


´¯¯¯
>No, I meant exactly UCS-2. Because UCS-2 guarantees that all symbols
>are represented by 2 bytes when UTF-16 does not. And I had an
>understanding that Doug said about this 16-bit guarantee. Also if
>we're talking about encoding where any character can be represented by
>a single variable of type wchar_t then we can talk only about UCS-2 or
>UCS-4, not about UTF-* variants. Though of course someone can talk
>about UTF-16 keeping in mind and relying on the fact that he will not
>ever deal with characters not fitting into 2 bytes in UTF-16 encoding
>and thus he effectively will work with UCS-2.
`---

I didn't see Doug mention anyhow a fixed-length guarantee.

Granted, UCS-2 had the considerable advantage of a fixed-length 
codepoint representation.

Nonetheless this doesn't imply that a single "character" is represented 
by one codepoint exactly, except if the application declares conformity 
to ISO 10646-1 (level 1) where only precomposed "starter" characters 
are allowed (for instance all combining codepoints are forbidden).

It is most probably safe to pass such data to other Unicode 
application, but the reverse is not true: a perfectly valid Unicode 
sequence containing only low (plane 0) codes may be ill-formed wrt UCS.





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-08-21 Thread erik
Doug,

3. "How are your strings stored in your program?  If they are stored with
wchar_t, then using the '16' APIs is probably easiest to use (ie
sqlite3_open16, sqlite3_prepare16_v2, etc)."

I have no idea how they are stored, but I would guess as "standard" ASCII.
Other community members have provided the interface/wrappers between the
scripting language I am using (AutoHotkey) and the SQLite.dll, but I don't
think this provides access to the "16" apis you mention.

"you would need to explicitly convert your strings to UTF-8 (which is not
the same as ASCII) before handing to SQLite."

Explicitly converting back and forth between ASCII/UTF-8 seems to have
solved this problem, thank you!! I hoped this would also solve the issues
I am having with case sensitive international characters (Problem #4), but
unfortunately not! (select * where LastName like '%ø%'; will not return
names with capital Ø in them and vice versa).

Pavel,
Thank you for your reply too, I appreciate it. I think I will stick with
the above mentioned solution.


Regards,
Erik

P.S. Sorry for not having selected a subject/topic, I was too preoccupied
with clarifying my post.


>> If they are stored with wchar_t, then using the '16' APIs is
>> probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc).
>
> Just don't forget that wchar_t on some platforms (reportedly on Linux
> for example) is 32-bit integer. So conversion between wchar_t and
> UCS-2 encoding is not always as easy as you can think.
>
> Pavel
>
> On Fri, Aug 21, 2009 at 9:44 AM, Doug<pa...@poweradmin.com> wrote:
>> Hi Erick --
>>
>> I can only help a little with #3.  How are your strings stored in your
>> program?  If they are stored with wchar_t, then using the '16' APIs is
>> probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc).
>> That's what I do and all sorts of European and Asian customers don't
>> have
>> any issues with storing and retrieving local strings.  If you don't use
>> the
>> wide-char (16) APIs, you would need to explicitly convert your strings
>> to
>> UTF-8 (which is not the same as ASCII) before handing to SQLite.
>>
>> Doug
>>
>>
>>> -Original Message-
>>> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>>> boun...@sqlite.org] On Behalf Of e...@sitadella.com
>>> Sent: Thursday, August 20, 2009 4:21 PM
>>> To: sqlite-users@sqlite.org
>>> Subject: [sqlite] (no subject)
>>>
>>> Hi guys,
>>>
>>> This is my first post. I am creating a simple document archiving
>>> program
>>> for small businesses. I am creating it in a scripting language called
>>> www.autohotkey.com. I intend to place the SQLite database file on a
>>> network share and use sqlite.dll to access and manipulate it.
>>>
>>> In general, everything is on a relatively small scale: there will be
>>> less
>>> than 10 users who will occasionally interact with the database, there
>>> will
>>> be around 4 tables and based on experience with a similar system, I
>>> don't
>>> expect a total of more than 5 records after a few years of use. The
>>> client computers will be Windows XP or newer and the database file will
>>> be
>>> located on a network share on a Windows 2000 server or newer.
>>>
>>> 1. I have read that the file locking mechanisms on older windows
>>> networks
>>> are not very reliable and that it is not advisable to use SQLite on NFS
>>> or
>>> network shares. Given the robustness and efficiency of SQLite and the
>>> low
>>> frequency of use of my application, do I still need to worry about
>>> placing
>>> the database on a network share?
>>>
>>> 2. Should I modify any of the default settings to better suit this
>>> environment?
>>>
>>> 3. I am having problems reading and writing international characters to
>>> and from the database, specifically the norwegian characters æ, ø and
>>> å.
>>> If I use sqlite.exe to create a records containing æ, ø or å, I can
>>> read
>>> the record using sqlite.exe without any problems. Likewise, if I use
>>> SQLiteSpy to create a record containing ø, æ or å I can read the record
>>> using SQLiteSpy without any problems. But if I create a record in
>>> sqlite.exe and try to read it with SQLiteSpy or vice versa, it doesn't
>>> work as expected and the special characters are converted to all sorts
>>> of
>>> oddball symbols like 

Re: [sqlite] (no subject)

2009-08-21 Thread Pavel Ivanov
> Is there really anyone using UCS-2 now or did you mean UTF-16?

No, I meant exactly UCS-2. Because UCS-2 guarantees that all symbols
are represented by 2 bytes when UTF-16 does not. And I had an
understanding that Doug said about this 16-bit guarantee. Also if
we're talking about encoding where any character can be represented by
a single variable of type wchar_t then we can talk only about UCS-2 or
UCS-4, not about UTF-* variants. Though of course someone can talk
about UTF-16 keeping in mind and relying on the fact that he will not
ever deal with characters not fitting into 2 bytes in UTF-16 encoding
and thus he effectively will work with UCS-2.


Pavel

On Fri, Aug 21, 2009 at 11:33 AM, Jean-Christophe
Deschamps wrote:
> Hi Pavel,
>
> ´¯¯¯
>>So conversion between wchar_t and
>>UCS-2 encoding is not always as easy as you can think.
> `---
>
> Is there really anyone using UCS-2 now or did you mean UTF-16?
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-08-21 Thread Jean-Christophe Deschamps
Hi Pavel,

´¯¯¯
>So conversion between wchar_t and
>UCS-2 encoding is not always as easy as you can think.
`---

Is there really anyone using UCS-2 now or did you mean UTF-16?



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-08-21 Thread Pavel Ivanov
> If they are stored with wchar_t, then using the '16' APIs is
> probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc).

Just don't forget that wchar_t on some platforms (reportedly on Linux
for example) is 32-bit integer. So conversion between wchar_t and
UCS-2 encoding is not always as easy as you can think.

Pavel

On Fri, Aug 21, 2009 at 9:44 AM, Doug<pa...@poweradmin.com> wrote:
> Hi Erick --
>
> I can only help a little with #3.  How are your strings stored in your
> program?  If they are stored with wchar_t, then using the '16' APIs is
> probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc).
> That's what I do and all sorts of European and Asian customers don't have
> any issues with storing and retrieving local strings.  If you don't use the
> wide-char (16) APIs, you would need to explicitly convert your strings to
> UTF-8 (which is not the same as ASCII) before handing to SQLite.
>
> Doug
>
>
>> -Original Message-
>> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>> boun...@sqlite.org] On Behalf Of e...@sitadella.com
>> Sent: Thursday, August 20, 2009 4:21 PM
>> To: sqlite-users@sqlite.org
>> Subject: [sqlite] (no subject)
>>
>> Hi guys,
>>
>> This is my first post. I am creating a simple document archiving
>> program
>> for small businesses. I am creating it in a scripting language called
>> www.autohotkey.com. I intend to place the SQLite database file on a
>> network share and use sqlite.dll to access and manipulate it.
>>
>> In general, everything is on a relatively small scale: there will be
>> less
>> than 10 users who will occasionally interact with the database, there
>> will
>> be around 4 tables and based on experience with a similar system, I
>> don't
>> expect a total of more than 5 records after a few years of use. The
>> client computers will be Windows XP or newer and the database file will
>> be
>> located on a network share on a Windows 2000 server or newer.
>>
>> 1. I have read that the file locking mechanisms on older windows
>> networks
>> are not very reliable and that it is not advisable to use SQLite on NFS
>> or
>> network shares. Given the robustness and efficiency of SQLite and the
>> low
>> frequency of use of my application, do I still need to worry about
>> placing
>> the database on a network share?
>>
>> 2. Should I modify any of the default settings to better suit this
>> environment?
>>
>> 3. I am having problems reading and writing international characters to
>> and from the database, specifically the norwegian characters æ, ø and
>> å.
>> If I use sqlite.exe to create a records containing æ, ø or å, I can
>> read
>> the record using sqlite.exe without any problems. Likewise, if I use
>> SQLiteSpy to create a record containing ø, æ or å I can read the record
>> using SQLiteSpy without any problems. But if I create a record in
>> sqlite.exe and try to read it with SQLiteSpy or vice versa, it doesn't
>> work as expected and the special characters are converted to all sorts
>> of
>> oddball symbols like squares and question marks. I assume this is
>> somehow
>> due to different ASCII/UTF encodings, but how can these problems be
>> avoided?
>>
>> 4. Select commands are case sensitive with æ, ø and å. Is there a
>> simple
>> workaround for this?
>>
>>
>> Regards,
>> Erik
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-08-21 Thread Doug
Hi Erick --

I can only help a little with #3.  How are your strings stored in your
program?  If they are stored with wchar_t, then using the '16' APIs is
probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc).
That's what I do and all sorts of European and Asian customers don't have
any issues with storing and retrieving local strings.  If you don't use the
wide-char (16) APIs, you would need to explicitly convert your strings to
UTF-8 (which is not the same as ASCII) before handing to SQLite.

Doug


> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of e...@sitadella.com
> Sent: Thursday, August 20, 2009 4:21 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] (no subject)
> 
> Hi guys,
> 
> This is my first post. I am creating a simple document archiving
> program
> for small businesses. I am creating it in a scripting language called
> www.autohotkey.com. I intend to place the SQLite database file on a
> network share and use sqlite.dll to access and manipulate it.
> 
> In general, everything is on a relatively small scale: there will be
> less
> than 10 users who will occasionally interact with the database, there
> will
> be around 4 tables and based on experience with a similar system, I
> don't
> expect a total of more than 5 records after a few years of use. The
> client computers will be Windows XP or newer and the database file will
> be
> located on a network share on a Windows 2000 server or newer.
> 
> 1. I have read that the file locking mechanisms on older windows
> networks
> are not very reliable and that it is not advisable to use SQLite on NFS
> or
> network shares. Given the robustness and efficiency of SQLite and the
> low
> frequency of use of my application, do I still need to worry about
> placing
> the database on a network share?
> 
> 2. Should I modify any of the default settings to better suit this
> environment?
> 
> 3. I am having problems reading and writing international characters to
> and from the database, specifically the norwegian characters æ, ø and
> å.
> If I use sqlite.exe to create a records containing æ, ø or å, I can
> read
> the record using sqlite.exe without any problems. Likewise, if I use
> SQLiteSpy to create a record containing ø, æ or å I can read the record
> using SQLiteSpy without any problems. But if I create a record in
> sqlite.exe and try to read it with SQLiteSpy or vice versa, it doesn't
> work as expected and the special characters are converted to all sorts
> of
> oddball symbols like squares and question marks. I assume this is
> somehow
> due to different ASCII/UTF encodings, but how can these problems be
> avoided?
> 
> 4. Select commands are case sensitive with æ, ø and å. Is there a
> simple
> workaround for this?
> 
> 
> Regards,
> Erik
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-08-20 Thread erik
Hi guys,

This is my first post. I am creating a simple document archiving program
for small businesses. I am creating it in a scripting language called
www.autohotkey.com. I intend to place the SQLite database file on a
network share and use sqlite.dll to access and manipulate it.

In general, everything is on a relatively small scale: there will be less
than 10 users who will occasionally interact with the database, there will
be around 4 tables and based on experience with a similar system, I don't
expect a total of more than 5 records after a few years of use. The
client computers will be Windows XP or newer and the database file will be
located on a network share on a Windows 2000 server or newer.

1. I have read that the file locking mechanisms on older windows networks
are not very reliable and that it is not advisable to use SQLite on NFS or
network shares. Given the robustness and efficiency of SQLite and the low
frequency of use of my application, do I still need to worry about placing
the database on a network share?

2. Should I modify any of the default settings to better suit this
environment?

3. I am having problems reading and writing international characters to
and from the database, specifically the norwegian characters æ, ø and å.
If I use sqlite.exe to create a records containing æ, ø or å, I can read
the record using sqlite.exe without any problems. Likewise, if I use
SQLiteSpy to create a record containing ø, æ or å I can read the record
using SQLiteSpy without any problems. But if I create a record in
sqlite.exe and try to read it with SQLiteSpy or vice versa, it doesn't
work as expected and the special characters are converted to all sorts of
oddball symbols like squares and question marks. I assume this is somehow
due to different ASCII/UTF encodings, but how can these problems be
avoided?

4. Select commands are case sensitive with æ, ø and å. Is there a simple
workaround for this?


Regards,
Erik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-07-13 Thread Frank

-- 
This message has been scanned for viruses and
dangerous content by Pinpoint, and is
believed to be clean.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-07-13 Thread Frank

-- 
This message has been scanned for viruses and
dangerous content by Pinpoint, and is
believed to be clean.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-06-28 Thread ArbolOne
humm

-- 
ArbolOne.org specializes in Custom Web Site Design, Web Site Re Design, Web 
Site Template Modifications, Web Site Maintenance, Integration of Payment 
Gateways (API's), Database Applications, Custom Applications and much more. 

416.838.2057
arbol...@gmail.com

"O Allah, make my love for You the most beloved thing to me, and my fear for 
You the most fearful thing to me, and remove from me all worldly needs and 
wants by instilling a passion for meeting You, make the coolness of my eyes to 
worshipping You.”

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-06-26 Thread Miroslav Zagorac
> Hello.
>  
> I'm using SQLite with a VB wrapper (dhSQLite) for VB6.
>  
> The following SQL string works fine for putting together a recordset where
> the DATE field contains only the date of the last day of each month.
>  
>  
>  SQLString = "SELECT date(Date,'start of month','+1 month','-1 day') as
> Date, " & _
> "First(Open,ID) as Open, Max(High) as High, " & _
> "Min(Low) as Low, Last(Close,ID) as Close FROM [" & sTable &
> "] GROUP By Year, Month"
> 
>  
> Each record represents the Open, High, Low, Close price for a complete
> month, and is represented by the last day of the month.
>  
> So we have...
>  
> 2009-01-31
> 2009-02-28
> 2009-03-31
> 2009-04-30
> ...
>  
> It is currently in the -mm-dd format.
>  
> The line "date(Date,'start of month','+1 month','-1 day') as Date" is what
> formats the month date to be the last day of the month.
>  
> MY PROBLEM:
>  
> I would like the date format to be either (mm/dd/) or (dd/mm/)
> depending on the user's system date format.
>  
> In the US, we use mm/dd/.
>  
> I'm completely lost on how to do this within the SELECT statement above.
>  
> Can someone suggest?
>  
> Thanks.
>  
> Webbiz

select strftime ('%m/%d/%Y', Date,'start of month','+1 month','-1 day') from ...

-- 
Zaga

You have worked and not worked.  Not working is the hardest work of all.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-06-26 Thread Rick Ratchford
Hello.
 
I'm using SQLite with a VB wrapper (dhSQLite) for VB6.
 
The following SQL string works fine for putting together a recordset where
the DATE field contains only the date of the last day of each month.
 
 
 SQLString = "SELECT date(Date,'start of month','+1 month','-1 day') as
Date, " & _
"First(Open,ID) as Open, Max(High) as High, " & _
"Min(Low) as Low, Last(Close,ID) as Close FROM [" & sTable &
"] GROUP By Year, Month"

 
Each record represents the Open, High, Low, Close price for a complete
month, and is represented by the last day of the month.
 
So we have...
 
2009-01-31
2009-02-28
2009-03-31
2009-04-30
...
 
It is currently in the -mm-dd format.
 
The line "date(Date,'start of month','+1 month','-1 day') as Date" is what
formats the month date to be the last day of the month.
 
MY PROBLEM:
 
I would like the date format to be either (mm/dd/) or (dd/mm/)
depending on the user's system date format.
 
In the US, we use mm/dd/.
 
I'm completely lost on how to do this within the SELECT statement above.
 
Can someone suggest?
 
Thanks.
 
Webbiz
 
 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-06-19 Thread Robert Lehr
Date: Fri, 19 Jun 2009 14:53:05 -0700
From: Robert Lehr <rl...@cadence.com>
Subject: Re: [sqlite] async io and locks
To: sqlite-users@sqlite.org
In-Reply-To: <43c62cbb-57db-4d1b-af36-2facf239c...@gmail.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

I have never been able to reply to messages w/in the mailing-list's
thread.  Outlook must be munging the headers to prevent proper
threading.  I'm trying to force the threading by manipulating the
headers manually.  I apologize if this reply winds up in the top-level
as all of my others have.

On Jun 20, 2009, at 12:30 AM, Dan wrote:
> On Jun 20, 2009, at 12:06 AM, Robert Lehr wrote:
> > I finally got around to reviewing SQLite's asynchronous I/O 
> > functionality.
> >
> >http://sqlite.org/asyncvfs.html <http://sqlite.org/asyncvfs.html>
> >
> > We actually have an C++ wrapper to uses the same concept, a background 
> > thread for I/O.
> 
> You mean you have implemented the callback methods in struct sqlite3_vfs to 
> read
> and write asynchronously just as we have? Or some other technique?
> 

Another technique - the C++ __wrapper__, akin to the numerous other C++ wrappers
that are being hacked together around the world.  We required asynchrony.  We
therefore wrote our own wrapper that implements it.

> >
> > W/rt to the locking policy w/ multiple updates, are there design 
> > reasons for not releasing and re-acquiring a lock between 
> > transactions?  That would facilitate higher concurrency albeit it a 
> > slightly higher cost than the current implementation.
> > That cost should match the current cost of multiple transactions, 
> > though.
> 
> It's to handle this:
> 
>BEGIN;
>  UPDATE t1 SET  WHERE ;
>COMMIT;
>BEGIN
>  UPDATE t2 SET  WHERE ;
>COMMIT;
> 
> If the SQLite user starts the second transaction before the asynchronous 
> thread
> has had time to commit the first, it will read the database to figure out the
> set of rows to apply the  modifications to.  Once that has 
> happened,
> the database file cannot be unlocked before the second transaction is
> committed. Otherwise, some other client might sneak in while the database was
> unlocked and modify table t2, changing the set of rows 
> selects.
> 
> Of course, if the asynchronous thread manages to commit the first transaction 
> to
> disk before the user has time to execute the second, the database file will be
> unlocked between transactions.


Yes, except that I verified that this interpretation is incorrect according
to the docs as I interpret them.  The relevant part of the docs follows.

"If an application using asynchronous IO executes transactions
in quick succession, other database users may be effectively
locked out of the database. This is because when a BEGIN is
executed, a database lock is established immediately."

Particularly note that the following denotes that the lock on the database file
persists beyond the duration of all transactions.

"But when the corresponding COMMIT or ROLLBACK occurs, the
lock is not released until the relevant part of the
write-queue has been flushed through. As a result, if a COMMIT
is followed by a BEGIN before the write-queue is flushed
through, the database is never unlocked,preventing other
processes from accessing the database."

Thus the async functionality does NOT simply wrap each update query (UPDATE,
DELETE) in a transaction.

If it did then I would be sending a completely different query, one pertaining
to broken semantics (for our purposes) of automatically wrapping my queries in
nested transactions which would, again, prevent me from adopting SQLite's
baseline async functionality.

BTW, it occurred to me as I wrote this reply that the fact the SQLite
distinguishes FETCHES from CREATES, UPDATES and DELETES indicates that it is
inspecting the queries themselves before deciding to append them to a
write-queue or not.  It therefore could detect beginnings and ends of
transactions.  Thus SQLite could enqueue transactions as it currently enqueues
write queries.

-robert
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-06-01 Thread Kees Nuyt
On Mon, 1 Jun 2009 04:38:37 -0700 (PDT), "Manasi Save"
 wrote:

>Hi,
>
>we are developing an application on android we are using SQLite Database
>and on phone we are getting SQLiteException:no such table. but, it is
>working fine on simulator.
>
>Can anyone provide any input on this?

ASCII versus UTF-8 or UTF-16?
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-06-01 Thread Manasi Save
Hi,

we are developing an application on android we are using SQLite Database
and on phone we are getting SQLiteException:no such table. but, it is
working fine on simulator.

Can anyone provide any input on this?

-- 
Thanks and Regards,
Manasi Save
Artificial Machines Pvt Ltd.
manasi.s...@artificialmachines.com
Ph:- 9833537392



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-05-26 Thread Samuel Baldwin
On Tue, May 26, 2009 at 6:34 PM, John Machin  wrote:
> Don't try that with your 100MB database without ensuring that your
> keyboard interrupt mechanism isn't seized up :-)
>
> Perhaps you meant
>
> .schema tablename

I did indeed. I even remember going, "oh, yeah, don't want dump in
this case", but yet my hands still wrote "dump". I blame the commies
and their fluoridation.

-- 
Samuel 'Shardz' Baldwin - staticfree.info/~samuel
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-05-26 Thread John Machin
On 26/05/2009 7:58 PM, Samuel Baldwin wrote:
> On Tue, May 26, 2009 at 4:45 PM, Martin.Engelschalk
>  wrote:
>> select * from sqlite_master;
> 
> Or:
> .dump tablename

Don't try that with your 100MB database without ensuring that your 
keyboard interrupt mechanism isn't seized up :-)

Perhaps you meant

.schema tablename

Cheers,
John

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-05-26 Thread Samuel Baldwin
On Tue, May 26, 2009 at 4:45 PM, Martin.Engelschalk
 wrote:
> select * from sqlite_master;

Or:
.dump tablename

-- 
Samuel 'Shardz' Baldwin - staticfree.info/~samuel
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-05-26 Thread Martin.Engelschalk
Hi,

select * from sqlite_master;

Martin

PS.: Please provide a subject which summarises your question.

Manasi Save schrieb:
> Hi All,
>
> Can anyone help me out with the command to see the SQLite table defination
> on command-line SQLite application.
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-05-26 Thread Manasi Save
Hi All,

Can anyone help me out with the command to see the SQLite table defination
on command-line SQLite application.
-- 
Thanks and Regards,
Manasi Save
Artificial Machines Pvt Ltd.
manasi.s...@artificialmachines.com
Ph:- 9833537392



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-02-17 Thread Joanne Pham
Hi All,
I have the select statement as below 
sqlite> select remoteId, hostName , remoteWXType from remoteWXTable order by 
hostName;
and the output  is below:

1|HostName1-T432|2
2|HostName2-T421|2
3|HostName3-XP|2
4|HostName3-XP|2

But I would like the sql statement to return as below:
(HostName3 has two remoteId so I want to return as one row but two different 
remoteId as below)
1|HostName1-T432|2
2|HostName2-T421|2
3,4|HostName3-XP|2
Can you please help to change the sql statement to return the above result set.
Thanks,
JP


  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2009-02-02 Thread Boris Arloff
Daniel,

Thanks for the pointers, but I do not believe that they apply.  You are correct 
in that the script is more complex and it is hard to post.  I tried to post the 
relevant portions with explanations. 

In terms of connection (self.con) and cursor (self.cur) these are the only 
existing attributes and no new connections or cursors are ever created.  
These attributes are passed around and used as needed.  Either pased as 
arguments to external classes or used as self within methods of the clas that 
created the connection.

Thanks anyway,
Boris




From: Daniel Watrous <dwmaill...@gmail.com>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Monday, February 2, 2009 11:55:52 AM
Subject: Re: [sqlite] (no subject)

Hey Boris,

It's a bit hard to follow what you've posted here, but I'm sure that's
because it came from a complicated script.  Here are a few things to
keep in mind.

You've make the connection to be EXCLUSIVE, which means that once you
send the first SQL statement to the database the database is
effectively locked for any other connection regardless of what queries
they might send.  You imply that when you call getDBConnection you
call sqlite.connect().  If self.con already has a connection this
would create a new connection and you would expect your database to be
locked at that point.

So, you could wrap the sqlite.connect() call in a conditional to see
if self.con is already a valid connection or you could call
self.con.commit() and self.con.close() before calling sqlite.connect
again.

Not sure if this helps.  If you have a larger snippet of code you can
send it along.

Daniel

On Sat, Jan 31, 2009 at 11:51 PM, Boris Arloff <boris.arl...@yahoo.com> wrote:
> Daniel,
>
> Apologize for not posting a subject in the original request.
>
> Thanks for offering to help; I do not think is a connection related
> problem, but I could be wrong.  Here are pertinent code segments:
>
> # Method getDBConnection() is called, which performs the following:
> 
> # create a connection property
> self.con = sqlite.connect( path + file,timeout=self.dbdefs.DB_TIMEOUT,
>                detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES,
>                isolation_level='EXCLUSIVE',check_same_thread=False)
> # config some extensions: row_factory, text_factory
> self..con.row_factory = sqlite.Row    # access by index or col names
> self.con.text_factory = sqlite.OptimizedUnicode    # uncode/bytestr
> #create a general cursor property
> self.cur = self.con.cursor()
> .
> # Then the following method is called to create the tables if they do not 
> exist:
> # create the database structure if does not exist
> errBool = not self._DBHandler__createDBTables()
> In this case it is a NOOP since the tables do exist; working with an existing 
> sqlite file.
>
> # Then method deleteData(self, **kwargs) is called, which ends up executing 
> the deletes
> # on each table:
> for table in kwargs.keys():
>    ...
>    cmd, errBool = self.__buildDeleteSQL(table, kwargs[table]) # build a 
>delete sql statement
>    ...
>    errBool, err = self.__execSQLCmd(cmd, self.cur)
>
> Method __execSQLCmd(self, cmd, cur), verifies for complete sql statement and:
> 
>    cur.execute(cmd)                                # execute sql command
> 
>
> Every DELETE executes correctly.
>
> # Then method insertData(self, **kwargs) is called:
> for table in kwargs.keys():
>    ...
>    for val in kwargs[table].keys():
>        ...
>        row = kwargs[table][val]
>        cmd, errBool = self.__buildInsertSQL(table, row) # build insert sql 
>statements
>        ...
>        errBool, err = self.__execSQLCmd(cmd, self.cur) # same method called 
>above to exec sql
>
> # The cur.execute(cmd) succeeds the insert with the first two tables,
> fails on the third table, only  if
> # the record of the first table is not the
> last record.
>
> # Delete and insert loops finish thru every db table; whenever errBool is 
> true, breaks out of the loop
> # with an exception:
> except err_handler.DBInsertFail:
>  errBool = True
>  errMsg += "\nInsert statement structure:\n" + str(kwargs)
> except:
>  errBool = True                                                    # 
>something else wrong; check args
>  errMsg += "\nGeneral exception at insertData; structure:\n" + str(kwargs)
> 
> # If error is returned attempts a rollback; else attempts a commit:
> if errBool:
>  try: self.cur.execute('ROLLBACK;')                # rollback on error
>  except: pass
> else:
>  try: self.cur.execute('COMMIT;')
>  except: pass
>
> The same connection object is maintained throughout; it is never closed
> until the program ends.  Ag

Re: [sqlite] (no subject)

2009-02-02 Thread Daniel Watrous
Hey Boris,

It's a bit hard to follow what you've posted here, but I'm sure that's
because it came from a complicated script.  Here are a few things to
keep in mind.

You've make the connection to be EXCLUSIVE, which means that once you
send the first SQL statement to the database the database is
effectively locked for any other connection regardless of what queries
they might send.  You imply that when you call getDBConnection you
call sqlite.connect().  If self.con already has a connection this
would create a new connection and you would expect your database to be
locked at that point.

So, you could wrap the sqlite.connect() call in a conditional to see
if self.con is already a valid connection or you could call
self.con.commit() and self.con.close() before calling sqlite.connect
again.

Not sure if this helps.  If you have a larger snippet of code you can
send it along.

Daniel

On Sat, Jan 31, 2009 at 11:51 PM, Boris Arloff <boris.arl...@yahoo.com> wrote:
> Daniel,
>
> Apologize for not posting a subject in the original request.
>
> Thanks for offering to help; I do not think is a connection related
> problem, but I could be wrong.  Here are pertinent code segments:
>
> # Method getDBConnection() is called, which performs the following:
> 
> # create a connection property
> self.con = sqlite.connect( path + file,timeout=self.dbdefs.DB_TIMEOUT,
>detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES,
>isolation_level='EXCLUSIVE',check_same_thread=False)
> # config some extensions: row_factory, text_factory
> self.con.row_factory = sqlite.Row# access by index or col names
> self.con.text_factory = sqlite.OptimizedUnicode# uncode/bytestr
> #create a general cursor property
> self.cur = self.con.cursor()
> 
> # Then the following method is called to create the tables if they do not 
> exist:
> # create the database structure if does not exist
> errBool = not self._DBHandler__createDBTables()
> In this case it is a NOOP since the tables do exist; working with an existing 
> sqlite file.
>
> # Then method deleteData(self, **kwargs) is called, which ends up executing 
> the deletes
> # on each table:
> for table in kwargs.keys():
>...
>cmd, errBool = self.__buildDeleteSQL(table, kwargs[table]) # build a 
> delete sql statement
>...
>errBool, err = self.__execSQLCmd(cmd, self.cur)
>
> Method __execSQLCmd(self, cmd, cur), verifies for complete sql statement and:
> 
>cur.execute(cmd)# execute sql command
> 
>
> Every DELETE executes correctly.
>
> # Then method insertData(self, **kwargs) is called:
> for table in kwargs.keys():
>...
>for val in kwargs[table].keys():
>...
>row = kwargs[table][val]
>cmd, errBool = self.__buildInsertSQL(table, row) # build insert sql 
> statements
>...
>errBool, err = self.__execSQLCmd(cmd, self.cur) # same method called 
> above to exec sql
>
> # The cur.execute(cmd) succeeds the insert with the first two tables,
> fails on the third table, only  if
> # the record of the first table is not the
> last record.
>
> # Delete and insert loops finish thru every db table; whenever errBool is 
> true, breaks out of the loop
> # with an exception:
> except err_handler.DBInsertFail:
>   errBool = True
>   errMsg += "\nInsert statement structure:\n" + str(kwargs)
> except:
>  errBool = True# 
> something else wrong; check args
>  errMsg += "\nGeneral exception at insertData; structure:\n" + str(kwargs)
> 
> # If error is returned attempts a rollback; else attempts a commit:
> if errBool:
>   try: self.cur.execute('ROLLBACK;')# rollback on error
>   except: pass
> else:
>  try: self.cur.execute('COMMIT;')
>  except: pass
>
> The same connection object is maintained throughout; it is never closed
> until the program ends.  Again the same code is used for successful and
> failed results as outlined before.
>
> Thanks,
> Boris
>
>
>
>
>
>
> 
> From: Daniel Watrous <dwmaill...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Sent: Saturday, January 31, 2009 5:42:40 PM
> Subject: Re: [sqlite] (no subject)
>
> why don't you send us some code.  It sounds like you might have an
> issue managing your connections.
>
> On Sat, Jan 31, 2009 at 3:09 PM, Boris Arloff <boris.arl...@yahoo.com> wrote:
>> Hi,
>>
>> I am having a small problem with an sqlite3 v3.5.6 database being accessed 
>> from within python 2.5 (import sqlite3 as sqlite).
>>

Re: [sqlite] (no subject)

2009-01-31 Thread Boris Arloff
Daniel,

Apologize for not posting a subject in the original request.

Thanks for offering to help; I do not think is a connection related
problem, but I could be wrong.  Here are pertinent code segments:

# Method getDBConnection() is called, which performs the following:

# create a connection property
self.con = sqlite.connect( path + file,timeout=self.dbdefs.DB_TIMEOUT,
detect_types=sqlite.PARSE_DECLTYPES|sqlite.PARSE_COLNAMES,
isolation_level='EXCLUSIVE',check_same_thread=False)
# config some extensions: row_factory, text_factory
self.con.row_factory = sqlite.Row# access by index or col names
self.con.text_factory = sqlite.OptimizedUnicode# uncode/bytestr
#create a general cursor property
self.cur = self.con.cursor()

# Then the following method is called to create the tables if they do not exist:
# create the database structure if does not exist
errBool = not self._DBHandler__createDBTables()
In this case it is a NOOP since the tables do exist; working with an existing 
sqlite file.

# Then method deleteData(self, **kwargs) is called, which ends up executing the 
deletes 
# on each table:
for table in kwargs.keys():
...
cmd, errBool = self.__buildDeleteSQL(table, kwargs[table]) # build a delete 
sql statement
...
errBool, err = self.__execSQLCmd(cmd, self.cur)

Method __execSQLCmd(self, cmd, cur), verifies for complete sql statement and:

cur.execute(cmd)# execute sql command


Every DELETE executes correctly.

# Then method insertData(self, **kwargs) is called:
for table in kwargs.keys():
...
for val in kwargs[table].keys():
...
row = kwargs[table][val]
cmd, errBool = self.__buildInsertSQL(table, row) # build insert sql 
statements
...
errBool, err = self.__execSQLCmd(cmd, self.cur) # same method called 
above to exec sql

# The cur.execute(cmd) succeeds the insert with the first two tables,
fails on the third table, only  if 
# the record of the first table is not the
last record.

# Delete and insert loops finish thru every db table; whenever errBool is true, 
breaks out of the loop 
# with an exception:
except err_handler.DBInsertFail:
   errBool = True
   errMsg += "\nInsert statement structure:\n" + str(kwargs)
except:
  errBool = True# something 
else wrong; check args
  errMsg += "\nGeneral exception at insertData; structure:\n" + str(kwargs)

# If error is returned attempts a rollback; else attempts a commit:
if errBool:
   try: self.cur.execute('ROLLBACK;')# rollback on error
   except: pass
else:
  try: self.cur.execute('COMMIT;')
  except: pass

The same connection object is maintained throughout; it is never closed
until the program ends.  Again the same code is used for successful and
failed results as outlined before.

Thanks,
Boris







From: Daniel Watrous <dwmaill...@gmail.com>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Saturday, January 31, 2009 5:42:40 PM
Subject: Re: [sqlite] (no subject)

why don't you send us some code.  It sounds like you might have an
issue managing your connections.

On Sat, Jan 31, 2009 at 3:09 PM, Boris Arloff <boris.arl...@yahoo.com> wrote:
> Hi,
>
> I am having a small problem with an sqlite3 v3.5.6 database being accessed 
> from within python 2.5 (import sqlite3 as sqlite).
>
> The database has been working correctly with the exception of the following 
> issue:
> There are 17 tables with the first table being a dataset index table with 
> three columns (index, name, datetimestamp).  All other records have various 
> columns one being a field that stores the index reference to this first 
> table.  Therefore we can access different datasets.
>
> If we create several datasets each with an incremental index (1,2,3, ...n) in 
> the first table, we can then delete the last dataset n and recreate a new one 
> with same name and index number; no problem.
>
> The problem results when we delete a dataset less than n (last created).  
> When any dataset 1 thru n-1 is deleted and we attempt to reenter its 
> information, the following happens:
>
> 1. Delete all records from all tables where the dataset id is lets say 3 
> (with n > 3)
> 2. Then insert all data related to dataset id 3.
> 3.. The data set index table entry is successful with index=3, name set to 
> the original name and new datetimestamp.
> The second table to be updated gets the its first record inserted correctly, 
> corresponding to this dataset.
> The third and subsequent tables however fail to accept the insert and sqlite 
> declares an "sqlite3.OperationalError" with database is locked.
>
> This operation using the last set of data entered does not report this s

Re: [sqlite] (no subject)

2009-01-31 Thread Daniel Watrous
why don't you send us some code.  It sounds like you might have an
issue managing your connections.

On Sat, Jan 31, 2009 at 3:09 PM, Boris Arloff  wrote:
> Hi,
>
> I am having a small problem with an sqlite3 v3.5.6 database being accessed 
> from within python 2.5 (import sqlite3 as sqlite).
>
> The database has been working correctly with the exception of the following 
> issue:
> There are 17 tables with the first table being a dataset index table with 
> three columns (index, name, datetimestamp).  All other records have various 
> columns one being a field that stores the index reference to this first 
> table.  Therefore we can access different datasets.
>
> If we create several datasets each with an incremental index (1,2,3, ...n) in 
> the first table, we can then delete the last dataset n and recreate a new one 
> with same name and index number; no problem.
>
> The problem results when we delete a dataset less than n (last created).  
> When any dataset 1 thru n-1 is deleted and we attempt to reenter its 
> information, the following happens:
>
> 1. Delete all records from all tables where the dataset id is lets say 3 
> (with n > 3)
> 2. Then insert all data related to dataset id 3.
> 3.. The data set index table entry is successful with index=3, name set to 
> the original name and new datetimestamp.
> The second table to be updated gets the its first record inserted correctly, 
> corresponding to this dataset.
> The third and subsequent tables however fail to accept the insert and sqlite 
> declares an "sqlite3.OperationalError" with database is locked.
>
> This operation using the last set of data entered does not report this same 
> error and completes correctly.  For example if we had only three datasets in 
> the case above, then it would have completed successfully.  As a special case 
> if we only have one single dataset (i.e. n=1), then we can repeat the 
> operation successfully until we drop dead.  We can insert all the original 
> data in every table, delete the data, then recreate the same data, and 
> repeat.  As soon as a second dataset is created we can repeat the process 
> with records that pertain to dataset 2 only, any attempts to do the same to 
> dataset 1 causes the "database is locked" error.
>
> Does anyone can help with this?  It seems to me that sqlite corrupts the 
> index when it is deleted, hence perhaps we cannot reuse the same index number.
>
> Thanks,
> Boris
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2009-01-31 Thread Boris Arloff
Hi,

I am having a small problem with an sqlite3 v3.5.6 database being accessed from 
within python 2.5 (import sqlite3 as sqlite).

The database has been working correctly with the exception of the following 
issue:
There are 17 tables with the first table being a dataset index table with three 
columns (index, name, datetimestamp).  All other records have various columns 
one being a field that stores the index reference to this first table.  
Therefore we can access different datasets.

If we create several datasets each with an incremental index (1,2,3, ...n) in 
the first table, we can then delete the last dataset n and recreate a new one 
with same name and index number; no problem.

The problem results when we delete a dataset less than n (last created).  When 
any dataset 1 thru n-1 is deleted and we attempt to reenter its information, 
the following happens:

1. Delete all records from all tables where the dataset id is lets say 3 (with 
n > 3)
2. Then insert all data related to dataset id 3.
3.. The data set index table entry is successful with index=3, name set to the 
original name and new datetimestamp.
The second table to be updated gets the its first record inserted correctly, 
corresponding to this dataset.
The third and subsequent tables however fail to accept the insert and sqlite 
declares an "sqlite3.OperationalError" with database is locked.

This operation using the last set of data entered does not report this same 
error and completes correctly.  For example if we had only three datasets in 
the case above, then it would have completed successfully.  As a special case 
if we only have one single dataset (i.e. n=1), then we can repeat the operation 
successfully until we drop dead.  We can insert all the original data in every 
table, delete the data, then recreate the same data, and repeat.  As soon as a 
second dataset is created we can repeat the process with records that pertain 
to dataset 2 only, any attempts to do the same to dataset 1 causes the 
"database is locked" error.

Does anyone can help with this?  It seems to me that sqlite corrupts the index 
when it is deleted, hence perhaps we cannot reuse the same index number.

Thanks,
Boris


  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-12-19 Thread Rachmat Febfauza
I have problem with executing this query in sqlite. to reconstruct problem 
please follow the following steps.


1. create table awal1, akhir1 and hasil1 first.

CREATE TABLE awal1(Code char(5),Level varchar(8), Category varchar(50), Product 
varchar(60), Location varchar(50), "Begin" datetime);

INSERT INTO `awal1` VALUES ('A1220', 'SMALL', 'FOOD', 'MARGARINE', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `awal1` VALUES ('A1221', 'SMALL', 'FOOD', 'CAKE', 'HOMS 2', 
'2007-05-06 11:31:57');
INSERT INTO `awal1` VALUES ('A1221', 'SMALL', 'FOOD', 'CAKE', 'HOMS 1', 
'2007-05-06 11:31:57');
INSERT INTO `awal1` VALUES ('A1221', 'SMALL', 'FOOD', 'CAKE', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `awal1` VALUES ('A1222', 'SMALL', 'FOOD', 'WAFER', 'HOMS 2', 
'2007-05-06 11:20:34');
INSERT INTO `awal1` VALUES ('A1222', 'SMALL', 'FOOD', 'WAFER', 'HOMS 1', 
'2007-05-06 11:20:34');
INSERT INTO `awal1` VALUES ('A1222', 'SMALL', 'FOOD', 'WAFER', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `awal1` VALUES ('A1236', 'MEDIUM', 'FOOD', 'SNACK', 'HOMS 2', 
'2007-05-06 10:48:57');
INSERT INTO `awal1` VALUES ('A1236', 'MEDIUM', 'FOOD', 'SNACK', 'HOMS 1', 
'2007-05-06 10:48:57');
INSERT INTO `awal1` VALUES ('A1269', 'SMALL', 'CLOTHES', 'BELT', 'HOMS 3', 
'2007-05-07 17:28:25');


CREATE TABLE akhir1(Code char(5),Level varchar(8),Category varchar(50),Product 
varchar(60), Location varchar(50),"End" datetime);

INSERT INTO `akhir1` VALUES ('A1220', 'SMALL', 'FOOD ', 'MARGARINE', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `akhir1` VALUES ('A1221', 'SMALL', 'FOOD ', 'CAKE', 'HOMS 2', 
'2007-05-06 11:31:57');
INSERT INTO `akhir1` VALUES ('A1221', 'SMALL', 'FOOD ', 'CAKE', 'HOMS 1', 
'2007-05-06 11:31:57');
INSERT INTO `akhir1` VALUES ('A1221', 'SMALL', 'FOOD ', 'CAKE', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `akhir1` VALUES ('A1222', 'SMALL', 'FOOD ', 'WAFER', 'HOMS 2', 
'2007-05-06 11:31:57');
INSERT INTO `akhir1` VALUES ('A1222', 'SMALL', 'FOOD ', 'WAFER', 'HOMS 1', 
'2007-05-06 11:31:57');
INSERT INTO `akhir1` VALUES ('A1222', 'SMALL', 'FOOD ', 'WAFER', 'HOMS 1', 
'2007-05-06 11:42:46');
INSERT INTO `akhir1` VALUES ('A1236', 'MEDIUM', 'FOOD ', 'SNACK', 'HOMS 2', 
'2007-05-06 11:19:21');
INSERT INTO `akhir1` VALUES ('A1236', 'MEDIUM', 'FOOD ', 'SNACK', 'HOMS 1', 
'2007-05-06 11:19:25');
INSERT INTO `akhir1` VALUES ('A1269', 'SMALL', 'CLOTHES', 'BELT', 'HOMS 3', 
'2007-05-07 17:28:27');



CREATE TABLE hasil1 (Code char(5), Level vachar(8), Category varchar (50), 
Product varchar(60), Location varchar(50), "Begin" datetime, "End" datetime, 
Difference integer, PRIMARY KEY 
(Code,Level,Category,Product,Location,"Begin","End"));


2. then execute this query 

insert or ignore into hasil1 select awal1.Code, awal1.Level, awal1.Category, 
awal1.Product, awal1.Location, awal1."Begin",akhir1."End", 
strftime("%s",akhir1."End")-strftime("%s",awal1."Begin") as Difference from 
awal1, akhir1 where awal1.Code = akhir1.Code and awal1.Category = 
akhir1.Category and awal1.Product = akhir1.Product and awal1.Location = 
akhir1.Location and akhir1."End" >= awal1."Begin" group by awal1."Begin", 
awal1.Code, awal1.Category, awal1.Product, awal1.Location;


3. check the result

the result that i hope is like this

A1236MEDIUMFOODSNACKHOMS 12007-5-6 10:48:572007-5-6 
11:19:251828
A1236MEDIUMFOODSNACKHOMS 22007-5-6 10:48:572007-5-6 
11:19:211824
A1222SMALLFOODWAFERHOMS 12007-5-6 11:20:342007-5-6 
11:31:57683
A1222SMALLFOODWAFERHOMS 22007-5-6 11:20:342007-5-6 
11:31:57683
A1221SMALLFOODCAKEHOMS 12007-5-6 11:31:572007-5-6 
11:31:570
A1221SMALLFOODCAKEHOMS 22007-5-6 11:31:572007-5-6 
11:31:570
A1220SMALLFOODMARGARINEHOMS 12007-5-6 11:42:462007-5-6 
11:42:460
A1221SMALLFOODCAKEHOMS 12007-5-6 11:42:462007-5-6 
11:42:460
A1222SMALLFOODWAFERHOMS 12007-5-6 11:42:462007-5-6 
11:42:460
A1269SMALLCLOTHESBELTHOMS 32007-5-7 17:28:252007-5-7 
17:28:272


how to make result like i hope?

thanks for advanced


note : the result that i hope is mysql result's, so i confuse how to do this in 
sqlite. Why i prefer sqlite other than mysql, coz if i execute about 12000 rows 
in mysql server, my computer starts not responding temporary, it tooks 100% cpu 
usage but less PF or memory usage.


  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-14 Thread John Stanton
Everything you want is on www.sqlite.org.  If you cannot handle that you 
probably do not have a use for Sqlite.


Satish wrote:
> Hi!
>Can I get some samples to work on sqlite that is how to create a database
> and inserting ... don' t think again I am joking plz help me.it was bit
> confusing when iam using sqlite command prompt
> 
> Regards,
> Satish
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor
> Sent: Friday, November 14, 2008 11:35 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] (no subject)
> 
> On 11/13/08, Satish <[EMAIL PROTECTED]> wrote:
> 
>>Hi!
>>
>>Really I am Serious about this I am very new to database and I
> 
> want
> 
>> to use sqllite.so I want to know.THE Reason why asked this question is I
>> have seen a video of google tech bytes in that the presenter said that
>> sqllite doesn't support foreign key and alter table.is this True.i want
> 
> to
> 
>> know based on this I can proceed further.
> 
> 
> If you are serious, start with reading the documentation on
> sqlite.org. Check out the list of FAQs, the features, datatypes,
> syntax, etc. Do some background work more than just watching a video
> of "google tech bytes" whatever that is.
> 
> Then post a well formed question on the list, with a clear subject
> line, and you will be promptly helped.
> 
> Until then you will likely get a response equivalent to "Wtf, is this
> a joke? :/"
> 
> 
>>
>> -Original Message-----
>> From: [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson
>> Sent: Friday, November 14, 2008 11:22 AM
>> To: General Discussion of SQLite Database
>> Subject: Re: [sqlite] (no subject)
>>
>> On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote:
>> > Hi!
>> >
>> >Will sqllite support Foreign Key and ALTER Table Comands .I want to
>> know
>> > is there any documentation that helps me to know what are the classes
> 
> that
> 
>> I
>> > can use and program.I use vc++ to connect to database.tell me if there
> 
> any
> 
>> > wrapper classes which I can use and also provide me documentation about
>> > those clases and functions present in it and how to use them.
>> >
>>
>> Wtf, is this a joke? :/
>>
>> --
>> Cory Nelson
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-13 Thread Satish
Hi!
   Can I get some samples to work on sqlite that is how to create a database
and inserting ... don' t think again I am joking plz help me.it was bit
confusing when iam using sqlite command prompt

Regards,
Satish

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of P Kishor
Sent: Friday, November 14, 2008 11:35 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] (no subject)

On 11/13/08, Satish <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Really I am Serious about this I am very new to database and I
want
>  to use sqllite.so I want to know.THE Reason why asked this question is I
>  have seen a video of google tech bytes in that the presenter said that
>  sqllite doesn't support foreign key and alter table.is this True.i want
to
>  know based on this I can proceed further.

If you are serious, start with reading the documentation on
sqlite.org. Check out the list of FAQs, the features, datatypes,
syntax, etc. Do some background work more than just watching a video
of "google tech bytes" whatever that is.

Then post a well formed question on the list, with a clear subject
line, and you will be promptly helped.

Until then you will likely get a response equivalent to "Wtf, is this
a joke? :/"

>
>
>  -Original Message-
>  From: [EMAIL PROTECTED]
>  [mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson
>  Sent: Friday, November 14, 2008 11:22 AM
>  To: General Discussion of SQLite Database
>  Subject: Re: [sqlite] (no subject)
>
>  On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote:
>  > Hi!
>  >
>  >Will sqllite support Foreign Key and ALTER Table Comands .I want to
>  know
>  > is there any documentation that helps me to know what are the classes
that
>  I
>  > can use and program.I use vc++ to connect to database.tell me if there
any
>  > wrapper classes which I can use and also provide me documentation about
>  > those clases and functions present in it and how to use them.
>  >
>
>  Wtf, is this a joke? :/
>
>  --
>  Cory Nelson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-13 Thread Ian Walters
Satish wrote:
> Hi!
>
>   Really I am Serious about this I am very new to database and I want
> to use sqllite.so I want to know.THE Reason why asked this question is I
> have seen a video of google tech bytes in that the presenter said that
> sqllite doesn't support foreign key and alter table.is this True.i want to
> know based on this I can proceed further. 

http://www.sqlite.org/lang_altertable.html

http://www.sqlite.org/syntaxdiagrams.html#foreign-key-clause

As for wrappers, I like Qt, but then I am biased in this regard.  More
seriously though, don't use a wrapper unless you want to change SQL
database back ends later.  You only really get portability and
integration with other code related to said wrapper.

--
Ian

p.s. sorry for the blatant plug.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-13 Thread P Kishor
On 11/13/08, Satish <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Really I am Serious about this I am very new to database and I want
>  to use sqllite.so I want to know.THE Reason why asked this question is I
>  have seen a video of google tech bytes in that the presenter said that
>  sqllite doesn't support foreign key and alter table.is this True.i want to
>  know based on this I can proceed further.

If you are serious, start with reading the documentation on
sqlite.org. Check out the list of FAQs, the features, datatypes,
syntax, etc. Do some background work more than just watching a video
of "google tech bytes" whatever that is.

Then post a well formed question on the list, with a clear subject
line, and you will be promptly helped.

Until then you will likely get a response equivalent to "Wtf, is this
a joke? :/"

>
>
>  -Original Message-
>  From: [EMAIL PROTECTED]
>  [mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson
>  Sent: Friday, November 14, 2008 11:22 AM
>  To: General Discussion of SQLite Database
>  Subject: Re: [sqlite] (no subject)
>
>  On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote:
>  > Hi!
>  >
>  >Will sqllite support Foreign Key and ALTER Table Comands .I want to
>  know
>  > is there any documentation that helps me to know what are the classes that
>  I
>  > can use and program.I use vc++ to connect to database.tell me if there any
>  > wrapper classes which I can use and also provide me documentation about
>  > those clases and functions present in it and how to use them.
>  >
>
>  Wtf, is this a joke? :/
>
>  --
>  Cory Nelson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-13 Thread Satish
Hi!
   
Really I am Serious about this I am very new to database and I want
to use sqllite.so I want to know.THE Reason why asked this question is I
have seen a video of google tech bytes in that the presenter said that
sqllite doesn't support foreign key and alter table.is this True.i want to
know based on this I can proceed further.   

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson
Sent: Friday, November 14, 2008 11:22 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] (no subject)

On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote:
> Hi!
>
>Will sqllite support Foreign Key and ALTER Table Comands .I want to
know
> is there any documentation that helps me to know what are the classes that
I
> can use and program.I use vc++ to connect to database.tell me if there any
> wrapper classes which I can use and also provide me documentation about
> those clases and functions present in it and how to use them.
>

Wtf, is this a joke? :/

-- 
Cory Nelson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (no subject)

2008-11-13 Thread Cory Nelson
On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote:
> Hi!
>
>Will sqllite support Foreign Key and ALTER Table Comands .I want to know
> is there any documentation that helps me to know what are the classes that I
> can use and program.I use vc++ to connect to database.tell me if there any
> wrapper classes which I can use and also provide me documentation about
> those clases and functions present in it and how to use them.
>

Wtf, is this a joke? :/

-- 
Cory Nelson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-13 Thread Satish
Hi!

Will sqllite support Foreign Key and ALTER Table Comands .I want to know
is there any documentation that helps me to know what are the classes that I
can use and program.I use vc++ to connect to database.tell me if there any
wrapper classes which I can use and also provide me documentation about
those clases and functions present in it and how to use them.

 

Regards,

G.SATISH

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-13 Thread Rick Pritchett
I am resending my transactions based on the result code that is returned. 
Should I put the time out command in my loops or once set does time out apply to
each transaction despite the resends?  And does the timeout command apply only
to connecting to the data base or to each request?




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-12 Thread Rick Pritchett

I am resending my transactions based on the result code that is returned. 
Should I put the time out command in my loops or once set does time out apply to
each transaction despite the resends?  



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-10 Thread Rick Pritchett



What is the proper syntax to set a variable to the error code using
errorcode method and TCL.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-10 Thread Rick Pritchett

What is the proper syntax to set a variable to the error code using
errorcode method and TCL.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-10 Thread Rick Pritchett



What is the proper syntax to set a variable to the error code using
errorcode method and TCL.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-11-07 Thread Rick Pritchett

What I would like to do is if the data base returns a busy or locked status is
to set up my proc to retry the write.  Or can I take care of this easier by
setting a long timeout?  And from what I read timeout basically keeps retrying
the write for a specified amount of time.  Is this correct?  Or is it that the
write is retried again that time is reached?  Also does sqlite use a serialized
queue for processing the transactions?





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-08-21 Thread Joanne Pham
Hi All,
I have a question related toSQLite db handle(pDb in my codes).
I have the function below to open the database connection. I have to  call 
sqlite3_close(sqlite3 *)(sqlite3_close(pDb) in my case)
before open another  database connection( by calling openDb) for releasing the 
memory which is used by previous sqlite3_open_v2(openDb). Otherwise the 
protential memory leak will be in the codes.
Your response is greatly appreciated.
JP
MonDb::openDb(const char *dbName){
  int sqlSt;
  const char* errMsg;  
  strcpy(name, dbName); //copy database name to the private name field
  sqlSt = sqlite3_open_v2( name, , SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, 0); 
  if(sqlSt != SQLITE_OK){
    errMsg = sqlite3_errmsg(pDb);
    // print out the error message
    sqlite3_free((char*) errMsg);
    return false;
   }
   /* Set database properties for better performance */
   setDbProperties();
  return true;
}


  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-05-08 Thread sebastian stephenson
what  do I need to do to build sqlite?

see ya

sebey


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (no subject)

2008-03-17 Thread dongsheng zhang
Hello, sqlite-users 

i want to be the user member of sqlite.please let me in ,3x so mush!

dongsheng zhang, [EMAIL PROTECTED]
2008-03-17 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Problem with crosscompiler and sqlite - was subject mismatch Re: [sqlite] sqlite ebuild - my problem, i have half year ago, is still here.

2007-02-24 Thread Jakub Ladman
Dne sobota 24 únor 2007 18:33 Jakub Ladman napsal(a):
> Hi Friends
> Please help me
> I need crosscompile sqlite for my sh4 cpu based linux system, but configure
> script (any version of sqlite i have tryed, even the actual one from sqlite
> homepage) fails if crosscompilation is selected.
> Crosscompiler works good in other cases.
> Thank you very much.
>
> Jakub Ladman
>
> ./configure --build=i686-pc-linux-gnu --host=sh4-pc-linux-uclibc
> --disable-tcl checking build system type... i686-pc-linux-gnu
> checking host system type... sh4-pc-linux-uclibc
> checking for sh4-pc-linux-uclibc-gcc... sh4-pc-linux-uclibc-gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... yes
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether sh4-pc-linux-uclibc-gcc accepts -g... yes
> checking for sh4-pc-linux-uclibc-gcc option to accept ANSI C... none needed
> checking for a sed that does not truncate output... /bin/sed
> checking for egrep... grep -E
> checking for ld used by sh4-pc-linux-uclibc-gcc... sh4-pc-linux-uclibc-ld
> checking if the linker (sh4-pc-linux-uclibc-ld) is GNU ld... yes
> checking for sh4-pc-linux-uclibc-ld option to reload object files... -r
> checking for BSD-compatible nm... /usr/bin/sh4-pc-linux-uclibc-nm -B
> checking whether ln -s works... yes
> checking how to recognise dependent libraries... pass_all
> checking how to run the C preprocessor... sh4-pc-linux-uclibc-gcc -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking dlfcn.h usability... yes
> checking dlfcn.h presence... yes
> checking for dlfcn.h... yes
> checking for sh4-pc-linux-uclibc-g++... sh4-pc-linux-uclibc-g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether sh4-pc-linux-uclibc-g++ accepts -g... yes
> checking how to run the C++ preprocessor... sh4-pc-linux-uclibc-g++ -E
> checking for sh4-pc-linux-uclibc-g77... sh4-pc-linux-uclibc-g77
> checking whether we are using the GNU Fortran 77 compiler... yes
> checking whether sh4-pc-linux-uclibc-g77 accepts -g... yes
> checking the maximum length of command line arguments... 32768
> checking command to parse /usr/bin/sh4-pc-linux-uclibc-nm -B output from
> sh4-pc-linux-uclibc-gcc object... ok
> checking for objdir... .libs
> checking for sh4-pc-linux-uclibc-ar... sh4-pc-linux-uclibc-ar
> checking for sh4-pc-linux-uclibc-ranlib... sh4-pc-linux-uclibc-ranlib
> checking for sh4-pc-linux-uclibc-strip... sh4-pc-linux-uclibc-strip
> checking if sh4-pc-linux-uclibc-gcc static flag  works... yes
> checking if sh4-pc-linux-uclibc-gcc supports -fno-rtti -fno-exceptions...
> no checking for sh4-pc-linux-uclibc-gcc option to produce PIC... -fPIC
> checking if sh4-pc-linux-uclibc-gcc PIC flag -fPIC works... yes
> checking if sh4-pc-linux-uclibc-gcc supports -c -o file.o... yes
> checking whether the sh4-pc-linux-uclibc-gcc linker
> (sh4-pc-linux-uclibc-ld) supports shared libraries... yes
> checking whether -lc should be explicitly linked in... no
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... yes
> configure: creating libtool
> appending configuration tag "CXX" to libtool
> checking for ld used by sh4-pc-linux-uclibc-g++... sh4-pc-linux-uclibc-ld
> checking if the linker (sh4-pc-linux-uclibc-ld) is GNU ld... yes
> checking whether the sh4-pc-linux-uclibc-g++ linker
> (sh4-pc-linux-uclibc-ld) supports shared libraries... yes
> checking for sh4-pc-linux-uclibc-g++ option to produce PIC... -fPIC
> checking if sh4-pc-linux-uclibc-g++ PIC flag -fPIC works... yes
> checking if sh4-pc-linux-uclibc-g++ supports -c -o file.o... yes
> checking whether the sh4-pc-linux-uclibc-g++ linker
> (sh4-pc-linux-uclibc-ld) supports shared libraries... yes
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> appending configuration tag "F77" to libtool
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... yes
> checking for sh4-pc-linux-uclibc-g77 option to produce PIC... -fPIC
> checking if sh4-pc-linux-uclibc-g77 PIC flag -fPIC works... yes
> checking if sh4-pc-linux-uclibc-g77 

<    1   2