Re: [sqlite] Can't create empty database

2012-06-25 Thread Valentin Davydov
On Mon, Jun 25, 2012 at 01:01:46AM -0700, L Anderson wrote:
> Googling on how to create a sqlite database (empty one) it appears
> I need only do 'sqlite3 test.db'.  However, when I try that I get:
> 
> ->sqlite3 test.db
> SQLite version 3.7.13 2012-06-11 02:05:22
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>
> 
> however, no database is created.  What am I doing wrong and what
> do I need to do to create an empty database 'test.db'?

Perhaps you have to fill the database with some of your own data (and later
delete them if you want really empty DB). Otherwise it will not even remember
your PRAGMA settings etc.:

$ rm -f test.db
$ sqlite3 test.db "pragma page_size=512;"
$ wc -c test.db
   0 test.db
$ sqlite3 test.db "pragma page_size;"
1024
$ sqlite3 test.db "pragma page_size=512;
create table t(c);drop table t;vacuum;"
$ wc -c test.db
 512 test.db
$ sqlite3 test.db "pragma page_size;"
512
$

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


Re: [sqlite] Can't create empty database

2012-06-25 Thread Niall O'Reilly

On 25 Jun 2012, at 12:48, Black, Michael (IS) wrote:

> Well...it doesnt' any more on Windows and Linux at least as of 3.7.9
> 
> The file doesn't get created until you execute at least one command relevant 
> to it.
> 
> So do a .schema or .dump or such and it creates the empty file.
> 
> Or just enter a ";" and it will create it too (ergo the "" works from the 
> command line).

I'm sorry.  I live on a Mac with 3.6.12.
Thanks for bringing me up to date.

/Niall

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


Re: [sqlite] Can't create empty database

2012-06-25 Thread Black, Michael (IS)
Well...it doesnt' any more on Windows and Linux at least as of 3.7.9



The file doesn't get created until you execute at least one command relevant to 
it.



So do a .schema or .dump or such and it creates the empty file.



Or just enter a ";" and it will create it too (ergo the "" works from the 
command line).





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Niall O'Reilly [niall.orei...@ucd.ie]
Sent: Monday, June 25, 2012 6:26 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Can't create empty database


On 25 Jun 2012, at 11:06, L Anderson wrote:

> So then on page 'http://www.sqlite.org/quickstart.html'
> under 'Create A New Database', the first bullet:
>
> 'At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new 
> database named "test.db". (You can use a different name if you like.)'
>
> is not strictly correct.

It has always worked for me.
/N

___
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] Can't create empty database

2012-06-25 Thread Niall O'Reilly

On 25 Jun 2012, at 11:06, L Anderson wrote:

> So then on page 'http://www.sqlite.org/quickstart.html'
> under 'Create A New Database', the first bullet:
> 
> 'At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new 
> database named "test.db". (You can use a different name if you like.)'
> 
> is not strictly correct.

It has always worked for me.
/N

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


Re: [sqlite] Can't create empty database

2012-06-25 Thread L Anderson

Oliver Peters wrote:

Am 25.06.2012 10:01, schrieb L Anderson:

Googling on how to create a sqlite database (empty one) it appears
I need only do 'sqlite3 test.db'.  However, when I try that I get:

->sqlite3 test.db
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

however, no database is created.  What am I doing wrong and what
do I need to do to create an empty database 'test.db'?

Thanks,

LA



read http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html

for instruction how to use the CLI (sqlite3.exe or the Linux binary)

Oliver


Thanks for your reply.  As it turns out, that's the very tutorial I used 
to run my test case.  The tutorial shows:


$ sqlite3 test.db
  SQLite version 3.0.8
  Enter ".help" for instructions
  sqlite> .quit

and I did:

->sqlite3 test.db
  SQLite version 3.7.13 2012-06-11 02:05:22
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite> .q

but did not get an empty file.

As an OP pointed out, I needed 'sqlite3 test.db ""'

I think this thread can now safely die--thanks all.

Regards,

LA

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


Re: [sqlite] Can't create empty database

2012-06-25 Thread L Anderson

Patrik Nilsson wrote:

sqlite3 test.db ""

It creates an empty file, zero bytes long.

Thanks for your quick reply.  So then on page 
'http://www.sqlite.org/quickstart.html'

under 'Create A New Database', the first bullet:

'At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a 
new database named "test.db". (You can use a different name if you like.)'


is not strictly correct.

I guess I was expecting 'sqlite3 test.db' or even 'sqlite3 test.db ""' 
to have created an "empty database" that contained the 100 byte 'SQLite 
format 3' database header structure together with any internal tables 
such as 'sqlite_master' and not just an empty file.


Regards,

LA



On 06/25/2012 10:01 AM, L Anderson wrote:

Googling on how to create a sqlite database (empty one) it appears
I need only do 'sqlite3 test.db'.  However, when I try that I get:

->sqlite3 test.db
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

however, no database is created.  What am I doing wrong and what
do I need to do to create an empty database 'test.db'?

Thanks,

LA




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


Re: [sqlite] Can't create empty database

2012-06-25 Thread Oliver Peters

Am 25.06.2012 10:01, schrieb L Anderson:

Googling on how to create a sqlite database (empty one) it appears
I need only do 'sqlite3 test.db'.  However, when I try that I get:

->sqlite3 test.db
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

however, no database is created.  What am I doing wrong and what
do I need to do to create an empty database 'test.db'?

Thanks,

LA



read http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html

for instruction how to use the CLI (sqlite3.exe or the Linux binary)

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


Re: [sqlite] Can't create empty database

2012-06-25 Thread Patrik Nilsson
sqlite3 test.db ""

It creates an empty file, zero bytes long.

On 06/25/2012 10:01 AM, L Anderson wrote:
> Googling on how to create a sqlite database (empty one) it appears
> I need only do 'sqlite3 test.db'.  However, when I try that I get:
> 
> ->sqlite3 test.db
> SQLite version 3.7.13 2012-06-11 02:05:22
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>
> 
> however, no database is created.  What am I doing wrong and what
> do I need to do to create an empty database 'test.db'?
> 
> Thanks,
> 
> LA
> 
> ___
> 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] Can't create empty database

2012-06-25 Thread L Anderson

Googling on how to create a sqlite database (empty one) it appears
I need only do 'sqlite3 test.db'.  However, when I try that I get:

->sqlite3 test.db
SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

however, no database is created.  What am I doing wrong and what
do I need to do to create an empty database 'test.db'?

Thanks,

LA

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