Re: [sqlite] CURRENT_DATE Behavior

2008-10-21 Thread jonwood
cmartin-2 wrote: > > I suspect it is quite common, e.g., web apps built on SQLServer backends > are quite likely to use UTC. At any rate, it is definitely a design > decision, if one expects that local times will always work in all > scenarios, but all means use local times. If design

Re: [sqlite] genfkey tool

2008-10-21 Thread Dan
> And now I'd like to check that, for all foreign keys, there is an > associated index. > Is it feasible? IIRC, it's tricky. In function populateTempTable(), there is code that checks that all parent keys are either the PRIMARY KEY of their table or subject to a UNIQUE constraint (have a UNIQUE

Re: [sqlite] Foreign Key Constraints

2008-10-21 Thread D. Richard Hipp
On Oct 21, 2008, at 10:33 PM, Daniel Zingaro wrote: > > However, then, on the SQLite wiki, I found that there is a way to > implement FK constraints using triggers!: > http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers > > I'm wondering if anyone can help me understand the discrepancy here.

[sqlite] Foreign Key Constraints

2008-10-21 Thread Daniel Zingaro
Hi all, I've just joined this list hoping to learn more about SQLite. I'm using SQLite to teach the SQL portion of a college databases course. The one thing that concerns me a little is the lack of foreign key constraints. (I've been yapping about referential integrity for weeks and really

Re: [sqlite] Case Insensitive Comparison for Double Byte Characters

2008-10-21 Thread Alexander Yap
Hi Mike, Thanks for the information. Will be looking at it. Alex On Tue, Oct 21, 2008 at 6:47 PM, MikeW <[EMAIL PROTECTED]> wrote: > Alexander Yap <[EMAIL PROTECTED]> writes: > > > > > Hi All, > > I am new here and would like to learn on how to do Case Insensitive > > comparison of Double Byte

Re: [sqlite] CURRENT_DATE Behavior

2008-10-21 Thread cmartin
On Tue, 21 Oct 2008, jonwood wrote: > mikewhit wrote: >> >> Using UTC in the DB stops you going mad when something happens >> on the DST changeover (localtime hours vanish, or happen twice), >> or you have systems running in or across different countries. >> >> It also means you can subtract two

Re: [sqlite] Getting text data w/ embedded nulls from shell

2008-10-21 Thread Evan Burkitt
Roger Binns rogerb-at-rogerbinns.com |Sqlite| wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Evan Burkitt wrote: >> Roger Binns rogerb-at-rogerbinns.com |Sqlite| wrote: >>> select cast(column as blob) >> I'm glad to know this syntax, but no dice. The nulls seem to be >>

Re: [sqlite] problem with INTEGER PRIMARY KEY ASC AUTOINCREMENT column

2008-10-21 Thread Timothy A. Sawyer
What does your insert statement look like? --Original Message-- From: Kenneth McDonald Sender: [EMAIL PROTECTED] To: sqlite-users@sqlite.org ReplyTo: General Discussion of SQLite Database Sent: Oct 20, 2008 10:23 Subject: [sqlite] problem with INTEGER PRIMARY KEY ASC AUTOINCREMENT column

Re: [sqlite] CURRENT_DATE Behavior

2008-10-21 Thread jonwood
mikewhit wrote: > > Using UTC in the DB stops you going mad when something happens > on the DST changeover (localtime hours vanish, or happen twice), > or you have systems running in or across different countries. > > It also means you can subtract two times and always get the right answer >

Re: [sqlite] problem with INTEGER PRIMARY KEY ASC AUTOINCREMENT column

2008-10-21 Thread P Kishor
On 10/20/08, Kenneth McDonald <[EMAIL PROTECTED]> wrote: > Basically, my database INSERT commands seem to still expect a value > for this, even though my expectation is that it will be computed > automatically, starting with (I assume) a default of 0 or 1. But I'm > getting errors of the sort

Re: [sqlite] problem with INTEGER PRIMARY KEY ASC AUTOINCREMENT column

2008-10-21 Thread Jim Dodgen
some sql examples would help, With out that I will attempt an answer. 1. Could be that you are including your auto increment field in the list of fields. So just don't reference the field, it will be done automatically. 2. Or you could be msiing the field list all together and just supplying

[sqlite] genfkey tool

2008-10-21 Thread elbart0
Hello, I discovered the great 'genfkey' tool with the last release (3.6.4). And I tried to customize it such as the output is not "CREATE TRIGGER" statements but "SELECT" statements. Indeed, my SQLite database is populated from a MySQL dump and is not modified afterwards. The order of record

[sqlite] problem with INTEGER PRIMARY KEY ASC AUTOINCREMENT column

2008-10-21 Thread Kenneth McDonald
Basically, my database INSERT commands seem to still expect a value for this, even though my expectation is that it will be computed automatically, starting with (I assume) a default of 0 or 1. But I'm getting errors of the sort "table images has 12 columns but 11 values were supplied." Is

Re: [sqlite] Getting text data w/ embedded nulls from shell

2008-10-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Evan Burkitt wrote: > Roger Binns rogerb-at-rogerbinns.com |Sqlite| wrote: >> select cast(column as blob) > > I'm glad to know this syntax, but no dice. The nulls seem to be > insurmountable barriers. That is due to the sqlite3_exec api used by

Re: [sqlite] CURRENT_DATE Behavior

2008-10-21 Thread MikeW
jonwood <[EMAIL PROTECTED]> writes: > > > Greetings, > > Okay, I understand that the designer of SQLite felt it was important that > fields with a default value of CURRENT_DATE should be initialized to the > current date in a DIFFERENT time zone. Setting aside for now that I've read > all the

Re: [sqlite] Getting text data w/ embedded nulls from shell

2008-10-21 Thread Evan Burkitt
Roger Binns rogerb-at-rogerbinns.com |Sqlite| wrote: > > select cast(column as blob) I'm glad to know this syntax, but no dice. The nulls seem to be insurmountable barriers. > > You have the full source to the shell and can change the text printing > routine to do whatever you want Yeah, I

Re: [sqlite] How does a default value for fieldtype "time" look ?

2008-10-21 Thread Igor Tandetnik
"PEL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "time" time NOT NULL DEFAULT HH:MM What's that supposed to achieve? If you want current time in HH:MM format, make it DEFAULT (strftime('%H:%M', 'now')) If you want, say, midnight in HH:MM format, make it DEFAULT '00:00'

Re: [sqlite] How does a default value for fieldtype "time" look ?

2008-10-21 Thread PEL
"time" time NOT NULL DEFAULT HH:MM gets me that error: SQL Error: near ":MM": syntax error found this: 1. -MM-DD 2. -MM-DD HH:MM 3. -MM-DD HH:MM:SS 4. -MM-DD HH:MM:SS.SSS 5. -MM-DDTHH:MM 6. -MM-DDTHH:MM:SS 7. -MM-DDTHH:MM:SS.SSS 8.

Re: [sqlite] CURRENT_DATE Behavior

2008-10-21 Thread Doug
In an effort to share some hard-won insight: I used to store local times in the database, but it's a bad idea and I got bit. Think about what gets stored: A number of seconds/nanoseconds/whatever from some time in the past (Jan 1, 1970 for example). When daylight savings arrives, all of your

Re: [sqlite] How does a default value for fieldtype "time" look ?

2008-10-21 Thread Igor Tandetnik
"PEL" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I just created in sqlite database a field called time with fieldtype > time. What should i set the time as default value maybe 00:00 ? > doesnt work... http://article.gmane.org/gmane.comp.db.sqlite.general/38853 Figure out how

Re: [sqlite] Case Insensitive Comparison for Double Byte Characters

2008-10-21 Thread MikeW
Alexander Yap <[EMAIL PROTECTED]> writes: > > Hi All, > I am new here and would like to learn on how to do Case Insensitive > comparison of Double Byte Characters? > > Thanks in advance. > > Alex To begin with, read the useful advice here:

Re: [sqlite] Can you perform an ATTACH-type operation just using DB handles ?

2008-10-21 Thread MikeW
John Belli <[EMAIL PROTECTED]> writes: > GIVEN: db1 is the open handle of the first database, and db2 is the > open handle of the second database > > WANTED: attach database open as db1 to db2 to do an atomic update > * * * WARNING: untested code ahead! * * * > char **table; >

[sqlite] How does a default value for fieldtype "time" look ?

2008-10-21 Thread PEL
Hello, I just created in sqlite database a field called time with fieldtype time. What should i set the time as default value maybe 00:00 ? doesnt work... -- View this message in context: http://www.nabble.com/How-does-a-default-value-for-fieldtype-%22time%22-look---tp20086163p20086163.html