Re: [sqlite] Ghost index?

2013-11-12 Thread SongbookDB
Thanks Kees - I managed to get it working.


On Tue, Nov 12, 2013 at 11:49 PM, Kees Nuyt  wrote:

> On Tue, 12 Nov 2013 15:00:36 +1100, SongbookDB
>  wrote:
>
> >Ahh - ok. I was typing sqlite3 db.3sdb IN sqlite3, not command prompt.
> >
> >I can load and search the db now.
> >
> >So to drop the index 'index1' for the table 'table1', do I just type DROP
> >INDEX IF EXISTS 'index1'; ? Doing so still shows the index when I load the
> >database in SQLite Administrator.
>
> What operating system are we talking about?
>
> What is the exact full path to the database file?
>
> --
> Groet, Cordialement, Pozdrawiam, Regards,
>
> Kees Nuyt
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-12 Thread Kees Nuyt
On Tue, 12 Nov 2013 15:00:36 +1100, SongbookDB
 wrote:

>Ahh - ok. I was typing sqlite3 db.3sdb IN sqlite3, not command prompt.
>
>I can load and search the db now.
>
>So to drop the index 'index1' for the table 'table1', do I just type DROP
>INDEX IF EXISTS 'index1'; ? Doing so still shows the index when I load the
>database in SQLite Administrator.

What operating system are we talking about?

What is the exact full path to the database file?

-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

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


Re: [sqlite] Ghost index?

2013-11-12 Thread Kees Nuyt
On Tue, 12 Nov 2013 15:10:16 +1100, SongbookDB
 wrote:

>I've notices if I make a mistake, the prompt turns to ...>, and then
>legitimate commands no longer work. Is there a way to get back to the
>normal prompt?

The  .h  command tells you what you can do there.


-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 4:00am, SongbookDB  wrote:

> Ahh - ok. I was typing sqlite3 db.3sdb IN sqlite3, not command prompt.
> 
> I can load and search the db now.
> 
> So to drop the index 'index1' for the table 'table1', do I just type DROP
> INDEX IF EXISTS 'index1'; ? Doing so still shows the index when I load the
> database in SQLite Administrator.

No need to use single quotes around entity names.  In fact, it's incorrect to 
do so.  Single quotes are for strings.

Apart from that, yes, you can type any SQL command, end it with a semi-colon, 
then hit return and the shell tool will execute the command.  This includes 
SELECT commands.  You can split a command onto many lines.  The shell tool is 
looking for that semi-colon before it thinks you've finished the command.

The SQLite shell tool is written by the SQLite team and if it disagrees with 
any other SQLite program, the shell tool is probably the correct one.  As I've 
proved with my own programming errors many times.

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


Re: [sqlite] Ghost index?

2013-11-11 Thread SongbookDB
I've notices if I make a mistake, the prompt turns to ...>, and then
legitimate commands no longer work. Is there a way to get back to the
normal prompt?


On Tue, Nov 12, 2013 at 2:42 PM, Simon Slavin  wrote:

>
> On 12 Nov 2013, at 2:49am, SongbookDB 
> wrote:
>
> > I've named it db.s3db, run the shell, type sqlite3 db, then select * from
> > songs; and it gives the error "Error: near "sqlite3": syntax error.
>
> as a command to your operating system
>
> sqlite3 db.s3db
>
> then once you're in the program type SQL commands or things like
>
> .schema
> SELECT * FROM sqlite_master;
> DROP INDEX fred;
> SELECT * FROM sqlite_master;
> .quit
>
> .quit to exit.  For further information
>
> 
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-11 Thread SongbookDB
Ahh - ok. I was typing sqlite3 db.3sdb IN sqlite3, not command prompt.

I can load and search the db now.

So to drop the index 'index1' for the table 'table1', do I just type DROP
INDEX IF EXISTS 'index1'; ? Doing so still shows the index when I load the
database in SQLite Administrator.


On Tue, Nov 12, 2013 at 2:42 PM, Simon Slavin  wrote:

>
> On 12 Nov 2013, at 2:49am, SongbookDB 
> wrote:
>
> > I've named it db.s3db, run the shell, type sqlite3 db, then select * from
> > songs; and it gives the error "Error: near "sqlite3": syntax error.
>
> as a command to your operating system
>
> sqlite3 db.s3db
>
> then once you're in the program type SQL commands or things like
>
> .schema
> SELECT * FROM sqlite_master;
> DROP INDEX fred;
> SELECT * FROM sqlite_master;
> .quit
>
> .quit to exit.  For further information
>
> 
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 2:49am, SongbookDB  wrote:

> I've named it db.s3db, run the shell, type sqlite3 db, then select * from
> songs; and it gives the error "Error: near "sqlite3": syntax error.

as a command to your operating system

sqlite3 db.s3db

then once you're in the program type SQL commands or things like

.schema
SELECT * FROM sqlite_master;
DROP INDEX fred;
SELECT * FROM sqlite_master;
.quit

.quit to exit.  For further information



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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 2:46am, SongbookDB  wrote:

> Does the shell expect a certain filename extension on the database file? I
> can't get mine to open.

It will open whatever file you tell it to.  You must type the full name 
including the extension, but you can use any extension you like, or none.

sqlite3 filename.ext

Simon.

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


Re: [sqlite] Ghost index?

2013-11-11 Thread SongbookDB
I've named it db.s3db, run the shell, type sqlite3 db, then select * from
songs; and it gives the error "Error: near "sqlite3": syntax error.


On Tue, Nov 12, 2013 at 1:26 PM, Simon Slavin  wrote:

>
> On 12 Nov 2013, at 1:50am, SongbookDB 
> wrote:
>
> > I've downloaded and run the shell tool - re opening a database, where do
> > base dir paths start from? I have the sqlite3.exe in a dir called test in
> > my downloads folder, and the test database is called db.sbdb - typing
> > sqlite3 db.sbdb doesn't open it.
>
> Paths start from your current directory.  The one you'd see if you typed
> DIR or ls.
>
> Or you could try specifying a full path.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-11 Thread SongbookDB
Does the shell expect a certain filename extension on the database file? I
can't get mine to open. Thanks Simon.


On Tue, Nov 12, 2013 at 1:26 PM, Simon Slavin  wrote:

>
> On 12 Nov 2013, at 1:50am, SongbookDB 
> wrote:
>
> > I've downloaded and run the shell tool - re opening a database, where do
> > base dir paths start from? I have the sqlite3.exe in a dir called test in
> > my downloads folder, and the test database is called db.sbdb - typing
> > sqlite3 db.sbdb doesn't open it.
>
> Paths start from your current directory.  The one you'd see if you typed
> DIR or ls.
>
> Or you could try specifying a full path.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 1:50am, SongbookDB  wrote:

> I've downloaded and run the shell tool - re opening a database, where do
> base dir paths start from? I have the sqlite3.exe in a dir called test in
> my downloads folder, and the test database is called db.sbdb - typing
> sqlite3 db.sbdb doesn't open it.

Paths start from your current directory.  The one you'd see if you typed DIR or 
ls.

Or you could try specifying a full path.

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


Re: [sqlite] Ghost index?

2013-11-11 Thread SongbookDB
Thanks Simon

I'm not sure how to set up logging when using SQLite with as3 AIR - I'll
check in with the Adobe community.

I've downloaded and run the shell tool - re opening a database, where do
base dir paths start from? I have the sqlite3.exe in a dir called test in
my downloads folder, and the test database is called db.sbdb - typing
sqlite3 db.sbdb doesn't open it.


On Tue, Nov 12, 2013 at 12:14 PM, Simon Slavin  wrote:

>
> On 12 Nov 2013, at 1:07am, Simon Slavin  wrote:
>
> > On 12 Nov 2013, at 12:51am, SongbookDB 
> wrote:
> >
> >> The process works fine at first - first time around, the index is
> dropped
> >> (this takes about 20 seconds on my test database). On subsequent loads,
> no
> >> dropping occurs.
> >
> > Are you logging the result code returned from your "DROP INDEX" command
> ?  Does it always return SQLITE_OK ?
>
> I forgot to mention that 20 seconds for any SQLite command is very
> unusual.  I suspect database locking, database corruption, or some other
> weirdness.  Therefore make sure your operations are doing what you think
> they're doing.
>
> You can check what's happening using the SQLite shell tool which you can
> download from the SQLite site.  Try the DROP INDEX command with that
> instead.  If it doesn't take 20 seconds then there's something wrong with
> your other method.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 1:07am, Simon Slavin  wrote:

> On 12 Nov 2013, at 12:51am, SongbookDB  wrote:
> 
>> The process works fine at first - first time around, the index is dropped
>> (this takes about 20 seconds on my test database). On subsequent loads, no
>> dropping occurs.
> 
> Are you logging the result code returned from your "DROP INDEX" command ?  
> Does it always return SQLITE_OK ?

I forgot to mention that 20 seconds for any SQLite command is very unusual.  I 
suspect database locking, database corruption, or some other weirdness.  
Therefore make sure your operations are doing what you think they're doing.

You can check what's happening using the SQLite shell tool which you can 
download from the SQLite site.  Try the DROP INDEX command with that instead.  
If it doesn't take 20 seconds then there's something wrong with your other 
method.

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


Re: [sqlite] Ghost index?

2013-11-11 Thread Simon Slavin

On 12 Nov 2013, at 12:51am, SongbookDB  wrote:

> The process works fine at first - first time around, the index is dropped
> (this takes about 20 seconds on my test database). On subsequent loads, no
> dropping occurs.

Are you logging the result code returned from your "DROP INDEX" command ?  Does 
it always return SQLITE_OK ?

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