Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Keith Medcalf

That is not quite correct Simon.  INTEGER PRIMARY KEY is always "auto 
incrementing" in that a new key is always one larger than the current max() key 
in the table.  However, INTEGER PRIMARY KEY AUTOINCREMENT means that the key is 
always one larger than *any key that has ever existed* in the table.

In other words, INTEGER PRIMARY KEY AUTOINCREMENT keys are uniquely ascending 
and will never be re-used.  Without AUTOINCREMENT the key may be re-used. On a 
"different" record.


---
()  ascii ribbon campaign against html e-mail
/\  www.asciiribbon.org

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Simon Slavin
> Sent: Friday, 03 August, 2012 10:00
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] AUTO_INCREMENT error
> 
> 
> On 3 Aug 2012, at 4:53pm, Brandon Pimenta 
> wrote:
> 
> > When using the SQL query
> >
> > CREATE TABLE test (
> > test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT
> > );
> >
> > or
> >
> > CREATE TABLE test (
> > test_1 INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT
> > );
> >
> > I will get the same error.
> 
> All INTEGER PRIMARY KEY columns automatically have AUTOINCREMENT.  You should
> not specify it yourself.
> 
> Also, SQLite will never itself assign a NULL to any of the values.  Though I
> can see that you might want NOT NULL in there to stop it being done by a
> program which assigns its own value to test_1.
> 
> Simon.
> ___
> 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] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Simon Slavin

On 3 Aug 2012, at 8:32pm, Tobias Giesen  wrote:

> I have a problem with this. Even when I invoke an old sqlite3 
> executable, Mountain Lion still launches 3.7.12.

What are you doing to 'invoke' ?

Put the executable in a folder with your database.  cd to that folder.  type

./sqlite3 databasename.sqlite

> Apparently Apple 
> prevents starting other versions of it and redirects everything to
> their current version in /usr/bin.

There really isn't anything like this in OS X.  The 'which' command will tell 
you which version you'll get if you don't specify a folder

which sqlite3

if you specify a folder for your executable you get the one you specified.

Of course if you have installed DarwinPorts or anything like that you deserve 
all the confusion you created.

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Yuriy Kaminskiy
Igor Tandetnik wrote:
> Brandon Pimenta  wrote:
>> CREATE TABLE test (
>> test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT
>> );
> 
> Make it 
> 
> INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
> 
> Though NOT NULL is redundant - PRIMARY KEY implies it.

Unlike other sql dialects, PRIMARY KEY in sqlite does not imply NOT NULL
constraint (see documentation).
However, INTEGER PRIMARY KEY is very special and unlike other column types - it
enforce type check and attempt to insert NULL will insert autoincremented value
instead.
sqlite> create table x(a text primary key);
sqlite> create table y(b integer primary key);
sqlite> insert into x values (NULL);
sqlite> insert into x values ('a');
sqlite> insert into x values (3);
sqlite> insert into x values (NULL);
sqlite> insert into y values (NULL);
sqlite> insert into y values ('a');
Error: datatype mismatch
sqlite> insert into y values (3);
sqlite> insert into y values (NULL);
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE x(a text primary key);
INSERT INTO "x" VALUES(NULL);
INSERT INTO "x" VALUES('a');
INSERT INTO "x" VALUES('3');
INSERT INTO "x" VALUES(NULL);
CREATE TABLE y(b integer primary key);
INSERT INTO "y" VALUES(1);
INSERT INTO "y" VALUES(3);
INSERT INTO "y" VALUES(4);
COMMIT;

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
> On ML here I can launch my version in /user/local/bin just fine.

Maybe because it's newer. Try to start the Snow Leopard version. If you
can get that done, I will be thrilled!

However I will also try putting it in /usr/local/bin next.

Cheers,
Tobias


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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Warren Young

On 8/3/2012 1:26 PM, Tobias Giesen wrote:

SQLite version 3.7.12 2012-05-14 01:41:23


Apple's version is 3.7.12 2012-04-03 19:43:07.


Well, that's the problem, then, isn't it?  SQLite 3.7.12 shipped on May 
14.  Apple must have shipped a pre-release version of SQLite 3.7.12, 
with the bug Dan remembers in it.


You should be able to fix it by statically compiling SQLite 3 into your 
program.  Then it doesn't matter that the platform version is broken.

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Doug Currie
On Aug 3, 2012, at 3:32 PM, Tobias Giesen  wrote:

> Apparently Apple prevents starting other versions of it and redirects 
> everything to
> their current version in /usr/bin.

On ML here I can launch my version in /user/local/bin just fine.

e$ which sqlite3
/usr/local/bin/sqlite3
e$ sqlite3
SQLite version 3.7.12 2012-05-14 01:41:23
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT sqlite_source_id();
2012-05-14 01:41:23 8654aa9540fe9fd210899d83d17f3f407096c004
sqlite> .exit
e$ uname -mprsv
Darwin 12.0.0 Darwin Kernel Version 12.0.0: Sun Jun 24 23:00:16 PDT 2012; 
root:xnu-2050.7.9~1/RELEASE_X86_64 x86_64 i386

e


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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Hi,

I have a problem with this. Even when I invoke an old sqlite3 
executable, Mountain Lion still launches 3.7.12. Apparently Apple 
prevents starting other versions of it and redirects everything to
their current version in /usr/bin.

As I wrote earlier, the same thing happened with the sqlite3.dylib.
I am positive that I loaded an older library from my code, but Mac OS
replaced it with the current one they have.

Ever heard of such a thing? And how to work around it?

So there's still no solution ...

Cheers,
Tobias

 
> if your users with 10.8 do need to do the .dump, all you need send them is 
> the executable version of sqlite3 which comes with 10.7, and a script 
> which calls it.  It should run fine under 10.8 and does not have any 
> dependencies or call any libraries.
> 
> But give the experts time to explore your problem first, since by the look of 
> it it shouldn't be occurring.
> 
> Simon.

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
> The broken.sql file works with 3.7.12 here.

So you're not using Mountain Lion ...

> SQLite version 3.7.12 2012-05-14 01:41:23

Apple's version is 3.7.12 2012-04-03 19:43:07.

> CREATE TABLE t1(x, CONSTRAINT pk_cons PRIMARY KEY(x));

Yes I can do that too. But in some larger tables, it does not work.

> SELECT sqlite_source_id();

I get:
2012-04-03 19:43:07 86b8481be7e7692d14ce762d21bfb69504af

Kind Regards,
Tobias Giesen

"To avoid a reboot, make sure that no SuperFlexible or ExtremeSync 
 processes are running in Task Manager before installing an update."

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com
 
---
Registered at register court Steinfurt as HRA 5061
Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Giesen

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Doug Currie

On Aug 3, 2012, at 2:33 PM, Dan Kennedy  wrote:

> There was a problem similar to your description at one point, but
> it should have been fixed before the 3.7.12 release. What do you
> get from the shell command "SELECT sqlite_source_id();" on
> Mountain Lion?

e$ /usr/bin/sqlite3
SQLite version 3.7.12 2012-04-03 19:43:07
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT sqlite_source_id();
2012-04-03 19:43:07 86b8481be7e7692d14ce762d21bfb69504af


e


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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Dan Kennedy

On 08/03/2012 11:33 PM, Tobias Giesen wrote:

Hello,

thanks for the replies!

A sample Mountain-unreadable file is here:
http://www.superflexible.com/broken.sql

Works fine under Snow Leopard.

I get the same results when using my own application as when using
/usr/bin/sqlite3. So, we can concentrate on the sqlite3 command line tool.

I noticed that with the new sqlite version, I can no longer use the
CONSTRAINT keyword. In other words, in a CREATE TABLE script, I
had to change this:
CONSTRAINT PK_SECTIONS PRIMARY KEY (ID),
to this:
PRIMARY KEY (ID),


The broken.sql file works with 3.7.12 here. And I can do:

  SQLite version 3.7.12 2012-05-14 01:41:23
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite> CREATE TABLE t1(x, CONSTRAINT pk_cons PRIMARY KEY(x));
  sqlite>

There was a problem similar to your description at one point, but
it should have been fixed before the 3.7.12 release. What do you
get from the shell command "SELECT sqlite_source_id();" on
Mountain Lion?

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Sounds like a plan!! Many thanks! 

Please excuse the shortness of this mail, as I am sending it from my phone. If 
necessary, I will send more details soon.
Warmest mobile regards from
Tobias Giesen


On 03.08.2012, at 19:12, Simon Slavin  wrote:

> 
> On 3 Aug 2012, at 5:48pm, Tobias Giesen  wrote:
> 
>> yes I can run the dump on Snow Leopard, but many of my customers do not
>> have Snow Leopard any more and they do not want to send me their files
>> for conversion.
>> 
>> The problem is that hundreds of customers need to convert/fix their 
>> files. It must be done under Mountain only and I have to automate it
>> or they will yell at me.
> 
> I suspect that the experts here will figure out what the problem is.  
> However, if your users with 10.8 do need to do the .dump, all you need send 
> them is the executable version of sqlite3 which comes with 10.7, and a script 
> which calls it.  It should run fine under 10.8 and does not have any 
> dependencies or call any libraries.
> 
> But give the experts time to explore your problem first, since by the look of 
> it it shouldn't be occurring.
> 
> Simon.
> ___
> 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] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Simon Slavin

On 3 Aug 2012, at 5:48pm, Tobias Giesen  wrote:

> yes I can run the dump on Snow Leopard, but many of my customers do not
> have Snow Leopard any more and they do not want to send me their files
> for conversion.
> 
> The problem is that hundreds of customers need to convert/fix their 
> files. It must be done under Mountain only and I have to automate it
> or they will yell at me.

I suspect that the experts here will figure out what the problem is.  However, 
if your users with 10.8 do need to do the .dump, all you need send them is the 
executable version of sqlite3 which comes with 10.7, and a script which calls 
it.  It should run fine under 10.8 and does not have any dependencies or call 
any libraries.

But give the experts time to explore your problem first, since by the look of 
it it shouldn't be occurring.

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Hello,

yes I can run the dump on Snow Leopard, but many of my customers do not
have Snow Leopard any more and they do not want to send me their files
for conversion.

The problem is that hundreds of customers need to convert/fix their 
files. It must be done under Mountain only and I have to automate it
or they will yell at me.

Cheers,
Tobias

 
> On 3 Aug 2012, at 5:33pm, Tobias Giesen  wrote:
> 
> > And a .dump results in an incomplete dump, otherwise it would be easy
> > for me to convert/fix the database.
> > 
> > The .dump does not give me any of the contents of the table DATA.
> 
> You should definitely be able run .dump using the shell tool in your 10.7 
> setup, then read the dump in using .read in your 10.8 setup to create a new 
> database file.
> 
> If you can't do the .dump on your 10.7 setup please run an integrity check
> 
> 
> 
> and tell us what it says (no need to paste a hundred error messages, just 
> summarise).
> 
> Simon.
> ___
> 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] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Simon Slavin

On 3 Aug 2012, at 5:33pm, Tobias Giesen  wrote:

> And a .dump results in an incomplete dump, otherwise it would be easy
> for me to convert/fix the database.
> 
> The .dump does not give me any of the contents of the table DATA.

You should definitely be able run .dump using the shell tool in your 10.7 
setup, then read the dump in using .read in your 10.8 setup to create a new 
database file.

If you can't do the .dump on your 10.7 setup please run an integrity check



and tell us what it says (no need to paste a hundred error messages, just 
summarise).

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Hello,

thanks for the replies! 

A sample Mountain-unreadable file is here:
http://www.superflexible.com/broken.sql

Works fine under Snow Leopard.

I get the same results when using my own application as when using 
/usr/bin/sqlite3. So, we can concentrate on the sqlite3 command line tool.

I noticed that with the new sqlite version, I can no longer use the
CONSTRAINT keyword. In other words, in a CREATE TABLE script, I 
had to change this:
CONSTRAINT PK_SECTIONS PRIMARY KEY (ID),
to this:
PRIMARY KEY (ID),

And the new sqlite version can't read the old sqlite files.

But there may be more to it.

And pragma integrity_check reports:
Error: malformed database schema (DATA) - near "CONSTRAINT":
syntax error

And a .dump results in an incomplete dump, otherwise it would be easy
for me to convert/fix the database.

The .dump does not give me any of the contents of the table DATA.

Cheers,
Tobias

 
> On 3 Aug 2012, at 3:33pm, Tobias Giesen  wrote:
> 
> > I have one particular type of database that has become unreadable on
> > the new Mac OS 10.8. It must be related to the SQL structure. The error
> > I get is "database disk image is malformed". But the same file, on
> > Snow Leopard, works fine.
> > 
> > The SQLite version on Snow Leopard is 3.6.12, and on Mountain Lion it
> > is 3.7.12.
> 
> How are you accessing this file ?  Are you using your own application or are 
> you using the shell tool included with Mac OS X in
> 
> /usr/bin/sqlite3
> 
> ?  In the folder where you find the database file on your 10.7 computer, are 
> there any other files with similar names ?  They may be journal files for 
> when the database was not closed properly.
> 
> > The strange thing is, when I attempt to load the sqlite3.dylib from
> > Snow Leopard under Mountain Lion, it also does not work. But I'm not
> > totally sure if loading the older sqlite3 library actually worked.
> 
> That may be totally unrelated to the file format.  You may be trying to open 
> the wrong dynamic library, or one compiled for a different OS, or something.  
> Check out the database itself using the shell tool, then involve a dynamic 
> library only once you're sure the database file is okay.
> 
> Simon.
> ___
> 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] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
Simon Slavin  wrote:
> All INTEGER PRIMARY KEY columns automatically have AUTOINCREMENT.  You should 
> not specify it yourself.

There's a subtle difference in behavior with and without AUTOINCREMENT keyword. 
See

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

-- 
Igor Tandetnik

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
Brandon Pimenta  wrote:
> CREATE TABLE test (
> test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT
> );

Make it 

INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL

Though NOT NULL is redundant - PRIMARY KEY implies it.
-- 
Igor Tandetnik

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


Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Dan Kennedy

On 08/03/2012 09:33 PM, Tobias Giesen wrote:

Hello,

here's a problem that's puzzling me.

I have one particular type of database that has become unreadable on
the new Mac OS 10.8. It must be related to the SQL structure. The error
I get is "database disk image is malformed". But the same file, on
Snow Leopard, works fine.

The SQLite version on Snow Leopard is 3.6.12, and on Mountain Lion it
is 3.7.12.

The strange thing is, when I attempt to load the sqlite3.dylib from
Snow Leopard under Mountain Lion, it also does not work. But I'm not
totally sure if loading the older sqlite3 library actually worked.

Does anybody have any advice for me?


I'd like to see the database file if possible. Are you able to
post it somewhere or else mail it directly to me?

Dan.

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Simon Slavin

On 3 Aug 2012, at 4:53pm, Brandon Pimenta  wrote:

> When using the SQL query
> 
> CREATE TABLE test (
> test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT
> );
> 
> or
> 
> CREATE TABLE test (
> test_1 INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT
> );
> 
> I will get the same error.

All INTEGER PRIMARY KEY columns automatically have AUTOINCREMENT.  You should 
not specify it yourself.

Also, SQLite will never itself assign a NULL to any of the values.  Though I 
can see that you might want NOT NULL in there to stop it being done by a 
program which assigns its own value to test_1.

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Brandon Pimenta
When using the SQL query

CREATE TABLE test (
test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT
);

or

CREATE TABLE test (
test_1 INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT
);

I will get the same error.

On Fri, Aug 3, 2012 at 12:46 PM, Kees Nuyt  wrote:

> On Fri, 3 Aug 2012 10:08:56 -0300, Brandon Pimenta
>  wrote:
>
> >I cannot use AUTO_INCREMENT. Here's my query:
> >
> >CREATE TABLE test (
> >test_1 NOT NULL AUTO_INCREMENT
> >);
> >
> >Running this query gives me "SQL error: near "AUTO_INCREMENT": syntax
> >error". What does this mean?
>
> The keyword is AUTOINCREMENT, without underscore.
> It will only work on INTEGER PRIMARY KEY columns.
>
> http://www.sqlite.org/lang_createtable.html
>
>
> --
> Regards,
>
> Kees Nuyt
>
> ___
> 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] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Adam DeVita
Good day,

I had a similar sounding issue on 2 different flavours of Windows.
The problem was an over active anti-virus program.

Adam

On Fri, Aug 3, 2012 at 11:45 AM, Simon Slavin  wrote:
>
> On 3 Aug 2012, at 3:33pm, Tobias Giesen  wrote:
>
>> I have one particular type of database that has become unreadable on
>> the new Mac OS 10.8. It must be related to the SQL structure. The error
>> I get is "database disk image is malformed". But the same file, on
>> Snow Leopard, works fine.
>>
>> The SQLite version on Snow Leopard is 3.6.12, and on Mountain Lion it
>> is 3.7.12.
>
> How are you accessing this file ?  Are you using your own application or are 
> you using the shell tool included with Mac OS X in
>
> /usr/bin/sqlite3
>
> ?  In the folder where you find the database file on your 10.7 computer, are 
> there any other files with similar names ?  They may be journal files for 
> when the database was not closed properly.
>
>> The strange thing is, when I attempt to load the sqlite3.dylib from
>> Snow Leopard under Mountain Lion, it also does not work. But I'm not
>> totally sure if loading the older sqlite3 library actually worked.
>
> That may be totally unrelated to the file format.  You may be trying to open 
> the wrong dynamic library, or one compiled for a different OS, or something.  
> Check out the database itself using the shell tool, then involve a dynamic 
> library only once you're sure the database file is okay.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
VerifEye Technologies Inc.
905-948-0015x245
151 Whitehall Dr, Unit 2
Markham ON, L3R 9T1
Canada
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Kees Nuyt
On Fri, 3 Aug 2012 10:08:56 -0300, Brandon Pimenta
 wrote:

>I cannot use AUTO_INCREMENT. Here's my query:
>
>CREATE TABLE test (
>test_1 NOT NULL AUTO_INCREMENT
>);
>
>Running this query gives me "SQL error: near "AUTO_INCREMENT": syntax
>error". What does this mean?

The keyword is AUTOINCREMENT, without underscore.
It will only work on INTEGER PRIMARY KEY columns.

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


-- 
Regards,

Kees Nuyt

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
Brandon Pimenta  wrote:
> I cannot use AUTO_INCREMENT. Here's my query:
> 
> CREATE TABLE test (
> test_1 NOT NULL AUTO_INCREMENT
> );

First, it's AUTOINCREMENT, without underscore. Second, it can only appear after 
PRIMARY KEY.

> Running this query gives me "SQL error: near "AUTO_INCREMENT": syntax error". 
> What does this mean?

It means that yours is not a syntactically valid SQL statement. The error 
message seems pretty clear to me.
-- 
Igor Tandetnik

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


Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Rob Richardson
Don't you have to specify a column type for test_1?

RobR

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Brandon Pimenta
Sent: Friday, August 03, 2012 9:09 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] AUTO_INCREMENT error

I cannot use AUTO_INCREMENT. Here's my query:

CREATE TABLE test (
test_1 NOT NULL AUTO_INCREMENT
);

Running this query gives me "SQL error: near "AUTO_INCREMENT": syntax error". 
What does this mean?

SQLite 3.6.12
___
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] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Hello,

here's a problem that's puzzling me.

I have one particular type of database that has become unreadable on
the new Mac OS 10.8. It must be related to the SQL structure. The error
I get is "database disk image is malformed". But the same file, on
Snow Leopard, works fine.

The SQLite version on Snow Leopard is 3.6.12, and on Mountain Lion it
is 3.7.12.

The strange thing is, when I attempt to load the sqlite3.dylib from
Snow Leopard under Mountain Lion, it also does not work. But I'm not
totally sure if loading the older sqlite3 library actually worked.

Does anybody have any advice for me?

Many thanks!
Tobias Giesen
www.syncovery.com



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


[sqlite] AUTO_INCREMENT error

2012-08-03 Thread Brandon Pimenta
I cannot use AUTO_INCREMENT. Here's my query:

CREATE TABLE test (
test_1 NOT NULL AUTO_INCREMENT
);

Running this query gives me "SQL error: near "AUTO_INCREMENT": syntax
error". What does this mean?

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


[sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Tobias Giesen
Hello,

here's a problem that's puzzling me.

I have one particular type of database that has become unreadable on
the new Mac OS 10.8. It must be related to the SQL structure. The error
I get is "database disk image is malformed". But the same file, on
Snow Leopard, works fine.

The SQLite version on Snow Leopard is 3.6.12, and on Mountain Lion it
is 3.7.12.

The strange thing is, when I attempt to load the sqlite3.dylib from
Snow Leopard under Mountain Lion, it also does not work. But I'm not
totally sure if loading the older sqlite3 library actually worked.

Does anybody have any advice for me?

Many thanks!
Tobias Giesen
www.syncovery.com



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