Re: [sqlite] Create Table oddity

2013-05-20 Thread Simon Slavin
On 20 May 2013, at 2:41pm, Keith Medcalf wrote: > It works quite fine: > > sqlite> create table a(a,b text default (datetime())); > sqlite> insert into a (a) values (1); > sqlite> insert into a (a) values (2); > sqlite> select * from a; > 1|2013-05-20 13:27:30 >

Re: [sqlite] Create Table oddity

2013-05-20 Thread Keith Medcalf
iiribbon.org > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: Monday, 20 May, 2013 07:17 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Create Table oddity >

Re: [sqlite] Create Table oddity

2013-05-20 Thread Simon Slavin
On 20 May 2013, at 4:55am, Simon Slavin wrote: > I wonder if there's a difference between > > DEFAULT date('now') > > and > > DEFAULT (date('now')) Bah. Of course, you can't do either: "An explicit DEFAULT clause may

Re: [sqlite] Create Table oddity

2013-05-19 Thread Simon Slavin
On 20 May 2013, at 4:33am, Stephen Chrzanowski wrote: > CREATE TABLE [tApplicationPaths] ( > [AppID] INTEGER PRIMARY KEY, > [ApplicationName] CHAR, > [ApplicationMonitorPath] CHAR, > [SearchSubDirs] BOOL DEFAULT 1, > [SearchMask] CHAR DEFAULT 8*8); Hmm. I wonder if

Re: [sqlite] Create Table oddity

2013-05-19 Thread Stephen Chrzanowski
Maybe this will help someone else later on down the road when dealing with defaults and how the library handles them. My intention was to see about changing the behavior of SQLite Expert when it came to generating the SQL statement to create a new table. Currently, Expert takes whatever is in

Re: [sqlite] Create Table oddity

2013-05-19 Thread Jay A. Kreibich
On Sun, May 19, 2013 at 06:05:05PM -0400, Stephen Chrzanowski scratched on the wall: > I've been talking with Bogdan about a change to SQLite Expert and ran > across something I did NOT expect. > > I have this schema: > > CREATE TABLE [tApplicationPaths] ( > [AppID] INTEGER PRIMARY KEY, >

Re: [sqlite] Create Table oddity

2013-05-19 Thread Jean-Christophe Deschamps
For me this inserts the text 'AppID' ... Sorry my bad, I tried a dummy table but made the type integer not char. So it was displaying 0 but hold text indeed. It's too late here for me to post anything, must be age! ___ sqlite-users mailing list

Re: [sqlite] Create Table oddity

2013-05-19 Thread Keith Medcalf
> While Keith is closer to the right explanation than I was, there are a > couple of points: > default does not need a constant: a function call is valid as well, > e.g. date() It can be a "constant expression" if surrounded by brackets. This does not mean that the value of the expression is

Re: [sqlite] Create Table oddity

2013-05-19 Thread Jean-Christophe Deschamps
While Keith is closer to the right explanation than I was, there are a couple of points: default does not need a constant: a function call is valid as well, e.g. date() The syntax: CREATE TABLE tApplicationPaths ( AppID INTEGER PRIMARY KEY, ApplicationName CHAR, ApplicationMonitorPath

Re: [sqlite] Create Table oddity

2013-05-19 Thread Keith Medcalf
tml e-mail /\ www.asciiribbon.org > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Stephen Chrzanowski > Sent: Sunday, 19 May, 2013 18:05 > To: General Discussion of SQLite Database > Subject: [sqlite] Create Table o

Re: [sqlite] Create Table oddity

2013-05-19 Thread Jean-Christophe Deschamps
I've been talking with Bogdan about a change to SQLite Expert and ran across something I did NOT expect. I have this schema: CREATE TABLE [tApplicationPaths] ( [AppID] INTEGER PRIMARY KEY, [ApplicationName] CHAR, [ApplicationMonitorPath] CHAR, [SearchSubDirs] BOOL DEFAULT 1,

[sqlite] Create Table oddity

2013-05-19 Thread Stephen Chrzanowski
I've been talking with Bogdan about a change to SQLite Expert and ran across something I did NOT expect. I have this schema: CREATE TABLE [tApplicationPaths] ( [AppID] INTEGER PRIMARY KEY, [ApplicationName] CHAR, [ApplicationMonitorPath] CHAR, [SearchSubDirs] BOOL DEFAULT 1,