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 there's a difference be

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 the

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, > [A

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 CHA

Re: [sqlite] Create Table oddity

2013-05-19 Thread Keith Medcalf
This is a feature (or a bug, depending on your view). A column default must be a constant, so your reference to "AppID" is translated to the string 'AppID' because it cannot be a column name since that would not be a constant. Perhaps your intent to do the following: CREATE TABLE tApplicatio

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, [SearchM

[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, [SearchMask