[sqlite] RE: Question regarding INTEGER PRIMARY KEY (zero value in column) ?

2007-07-12 Thread RohitPatel9999
Hi I have a Question regarding INTEGER PRIMARY KEY (zero value in column) ? Example table => create table {id INTEGER PRIMARY KEY, name TEXT}; Is it ever possible that value 0 (zero) will be inserted in a column declared as INTEGER PRIMARY KEY (and not as AUTOINCREMENT) ? Inserts are always wit

Re: [sqlite] Re: Re: trigger and new.*

2007-07-12 Thread Charly Caulet
Le mercredi 11 juillet 2007 à 12:47 -0400, Igor Tandetnik a écrit : > Be aware that SQLite never enters infinite loop of triggers. It keeps > track of a chain of nested triggers that led to the currently executing > statement; if that statement would fire a trigger that is already in the > chain

Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thank you very much Andrew. Regards, Lloyd On Thu, 2007-07-12 at 23:37 -0500, Andrew Finkenstadt wrote: > Use sqlite_int64 as your type. That typedef supports 'long long' or 'signed > __int64' or whatever the compiler environment needs. > > --a > > On 7/12/07, Lloyd <[EMAIL PROTECTED]> wrote:

Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Andrew Finkenstadt
Use sqlite_int64 as your type. That typedef supports 'long long' or 'signed __int64' or whatever the compiler environment needs. --a On 7/12/07, Lloyd <[EMAIL PROTECTED]> wrote: Thanks Andy. So, SQLite doesn't have its own features to manage this? So I must be able to perform 64bit operations

Re: [sqlite] Re: 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thanks Igor :) Regards, Lloyd On Fri, 2007-07-13 at 00:18 -0400, Igor Tandetnik wrote: > Lloyd wrote: > > So, SQLite doesn't have its own features to manage this? So I must be > > able to perform 64bit operations on a 32bit machine using C. How can I > > do that? or how to declare a 64bit inte

[sqlite] Re: 64bit on 32bit machine

2007-07-12 Thread Igor Tandetnik
Lloyd wrote: So, SQLite doesn't have its own features to manage this? So I must be able to perform 64bit operations on a 32bit machine using C. How can I do that? or how to declare a 64bit integer on a 32bit machine? Most modern compilers provide a "long long" type, usually mapped to a 64-bit

Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Thanks Andy. So, SQLite doesn't have its own features to manage this? So I must be able to perform 64bit operations on a 32bit machine using C. How can I do that? or how to declare a 64bit integer on a 32bit machine? Thanks, Lloyd On Thu, 2007-07-12 at 15:06 -0500, Andrew Finkenstadt wrote: >

[sqlite] synchronize MS SQL server and SQLite

2007-07-12 Thread maitong uy
I have multiple devices that has an SQLite database in them. Then I have a central server , which is an MS SQL Server that manages all these devices. Is it possible to replicate the data in the MS SQL Server to the SQLite databases in the devices and vice versa? -- View this message in context:

Re: [sqlite] DELETE using a join?

2007-07-12 Thread Clark Christensen
delete from Payments where UserID in (select UserID from Users where UserName = 'John Smith'); will get the job done. And I'm sure there's a more elegant method. -Clark - Original Message From: Scott Baker <[EMAIL PROTECTED]> To: SQLITE Sent: Thursday, July 12, 2007 3:47:37 PM Subje

Re: [sqlite] Milliseconds

2007-07-12 Thread John Stanton
The Sqlite date/time routimes have a resolution to seconds, not milliseconds. If you want milliseconds from SQL implement your own user defined functions which give you milliseconds. You would access the time functions using the API of the underlying OS. You might choose to implement your un

[sqlite] DELETE using a join?

2007-07-12 Thread Scott Baker
Let's say I have two really simple tables like so Users - UserName UserID Payments UserID PaymentAmount Is there an easy way to do something like "delete all entries in the payment table where the Username is 'John Smith'" I'm thinking it would be trivial to do it with a subquery,

Re: [sqlite] Binding vs No Binding

2007-07-12 Thread Teg
Hello Nathan, Thursday, July 12, 2007, 4:30:13 PM, you wrote: NB> I have been trying see just how fast I can get SQlite to run, so I have NB> been playing with binding data to pre-compiled statements versus having NB> to prepare each statement individually. So far, I have not seen a huge NB> per

RE: [sqlite] Binding vs No Binding

2007-07-12 Thread Samuel R. Neff
I think you'll see the biggest difference when you run the same statement many times with different bound variables (vs recompiling each time). Sam --- We're Hiring! Seeking a passionate developer to join our team building products. Position is in the Wa

Re: [sqlite] Varying Separator

2007-07-12 Thread Rich Shepard
On Thu, 12 Jul 2007, Joe Wilson wrote: The sqlite3 commandline shell has always defaulted to '|' for the separator. You may have been using .mode csv which changes the separator before returning to .mode list: Joe, Ah, yes. I was exporting rows from tables with mode insert, then reverting t

[sqlite] Binding vs No Binding

2007-07-12 Thread Nathan Biggs
I have been trying see just how fast I can get SQlite to run, so I have been playing with binding data to pre-compiled statements versus having to prepare each statement individually. So far, I have not seen a huge performance increase between the two. I expected the pre-compiled statements t

Re: [sqlite] Varying Separator

2007-07-12 Thread Joe Wilson
The sqlite3 commandline shell has always defaulted to '|' for the separator. You may have been using .mode csv which changes the separator before returning to .mode list: SQLite version 3.4.0 Enter ".help" for instructions sqlite> .mode list sqlite> select 1,2,3; 1|2|3 sqlite> .mode csv sqlite>

Re: [sqlite] Sqlite in Shared Memory

2007-07-12 Thread Ben Combee
On 7/12/07, RaghavendraK 70574 <[EMAIL PROTECTED]> wrote: Hi, I want to use Sqlite as in-mem db and want this Mem to be alloacted on SHM. Has anyone tried it? Since sqlite3 uses file locking as an IPC mechanism to prevent multiple modifications, you're probably best using it with a file in /tm

Re: [sqlite] 64bit on 32bit machine

2007-07-12 Thread Andrew Finkenstadt
It uses the feature built-in to the language compiler that you use. In the case of Visual Studio (Microsoft, x86) the underlying compiler uses either the library implementations or direct assembly code using pairs of registers and whatever dual-register assembly instructions are available on the

[sqlite] Varying Separator

2007-07-12 Thread Rich Shepard
Yesterday as I worked on a project database's tables in the SQLite editor, I saw that the separator was a comma, ",", and thought the default separator must have changed between versions 3.3.x and 3.4.0. But, when I select data from the same tables, the separator is back to being the vertical ba

[sqlite] How to better save events (logs) in database?

2007-07-12 Thread bash
Hello All, I have 3 entities: 1. town 2. person 3. alliance Links between entities: person owns the towns group of persons can unites into alliance CREATE TABLE town ( tid int, /* town id */ pid int, /* owner person id */ name char, ... ); CREATE TABLE p

Re: [sqlite] Re: How to store 128 bit values

2007-07-12 Thread Steve Krulewitz
Thanks for the advice all! cheers, -steve - To unsubscribe, send email to [EMAIL PROTECTED] -

[sqlite] 64bit on 32bit machine

2007-07-12 Thread Lloyd
Hi, Can I know how SQLite performs 64bit operations (addition, multiplication, division) on 32bit machine? Thank you very much, Lloyd __ Scanned and protected by Email scanner - T

Re: [sqlite] Milliseconds

2007-07-12 Thread Trey Mack
I rather thought about retrieving and storing milliseconds in SQL. I mean, a SQL data type which is able to store milliseconds and a SQL function to return the current timestamp including milliseconds. I had no luck with CURRENT_TIMESTAMP for instance. There is no true SQLite DATE data type. It'

Re: [sqlite] optimizing a query with ORDER BY and LIMIT

2007-07-12 Thread Joe Wilson
> CREATE INDEX dpi5 on device_perf_interval( > interval_end_date, > interval_type, > interval_duration > ); > > explain query plan > SELECT d.device_type, dpi.* > FROM device d, device_perf_interval dpi > WHERE d.device_id=dpi.device_id AND >dpi.interval_type=1 AND >dpi.

Re: [sqlite] realloc size smaller than malloc size?is it error in vc6?

2007-07-12 Thread Allen . Zhang
it is my fault. I have read msdn again,copy the remarks The size argument gives the new size of the block, in bytes. The contents of the block are unchanged up to the shorter of the new and old sizes, although the new block can be in a different location. Because the new block can be in a new

RE: [sqlite] Milliseconds

2007-07-12 Thread Steinmaurer Thomas
Hi! I rather thought about retrieving and storing milliseconds in SQL. I mean, a SQL data type which is able to store milliseconds and a SQL function to return the current timestamp including milliseconds. I had no luck with CURRENT_TIMESTAMP for instance. Thanks! Thomas > -Original Me

Re: [sqlite] Milliseconds

2007-07-12 Thread Srebrenko Sehic
On 7/12/07, Steinmaurer Thomas <[EMAIL PROTECTED]> wrote: Hello, is there a way to retrieve and store the millisecond part of a (current) timestamp? If you're on a Unix-like system, have a look at gettimeofday which returns: struct timeval { longtv_sec; /* seconds since Jan. 1,

[sqlite] Milliseconds

2007-07-12 Thread Steinmaurer Thomas
Hello, is there a way to retrieve and store the millisecond part of a (current) timestamp? Thanks, Thomas - To unsubscribe, send email to [EMAIL PROTECTED] ---

[sqlite] Sqlite in Shared Memory

2007-07-12 Thread RaghavendraK 70574
Hi, I want to use Sqlite as in-mem db and want this Mem to be alloacted on SHM. Has anyone tried it? regards ragha ** This email and its attachments contain confidential information from HUAWEI, which is in

Re: [sqlite] realloc size smaller than malloc size?is it error in vc6?

2007-07-12 Thread Cory Nelson
On 7/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: in the os_common.h file there are sqlite3GenericMalloc,sqlite3GenericRealloc,sqlite3GenericFree,sqlite3GenericAllocationSize function. If I run the sqlite in windows,the sqlite3GenericRealloc function just call the realloc function. from th

[sqlite] realloc size smaller than malloc size?is it error in vc6?

2007-07-12 Thread Allen . Zhang
in the os_common.h file there are sqlite3GenericMalloc,sqlite3GenericRealloc,sqlite3GenericFree,sqlite3GenericAllocationSize function. If I run the sqlite in windows,the sqlite3GenericRealloc function just call the realloc function. from the msdn and my test,the realloc(void *p, n)function,the