Looks then that doing the table creation with INTEGER PRIMARY KEY
Is the way to go, but as always it will come down to a lot of testing.

As to quotes etc.
As my code works fine as it is I probably will leave this as the double
quotes look ugly and it will be a reasonably big job to alter all this.
Did I get you right that the only benefit of doing create "table1" etc.
is compatibility with running sqlite with SQLite.exe?

RBS

-----Original Message-----
From: Dennis Cote [mailto:[EMAIL PROTECTED] 
Sent: 27 March 2007 23:41
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Difference in these indices?

RB Smissaert wrote:
> Is it right that this won't affect the speed of any subsequent inserts or
> deletes?
>   
Well inserts will be done in id order. If you have predefined ids 
assigned by some outside source and specify them when you insert into 
sqlite, it will have to insert at random location in the btree. This 
will take longer than always appending at the end of the btree. If you 
let sqlite assign the ids, or the ids are in order, then this is not an 
issue. If you are always going to create the external index afterwards 
anyway, it will also probably not make much difference (you would have 
to test it each way).
> About the single quotes etc:
> This is VB code, so I can't do:
> Create table "table1"("ID" INTEGER PRIMARY KEY)
>
> I can do:
> Create table table1(ID INTEGER PRIMARY KEY)
>
> As the table and the columns are often variables it will be something
like:
>
> strTable = "table1"
> strColumn = "ID"
>
> strSQL = "create " & strTable & "(" & strColumn & " INTEGER PRIMARY KEY)"
>
>
>   
VB and SQL both use the same technique of escaping quotes embedded in 
strings using a pair of quotes back to back.

In VB

    print "Test ""quoted"" strings." 

will output

    Test "quoted" strings.

You can do the same with the strings you are building to send to SQLite. 
Using the following VB statement

    strSQL = "create """ & strTable & """(""" & strColumn & """ INTEGER 
PRIMARY KEY)"

will produce a strSQL that contains the string

    create "table1"("ID" INTEGER PRIMARY KEY)

HTH
Dennis Cote



----------------------------------------------------------------------------
-
To unsubscribe, send email to [EMAIL PROTECTED]
----------------------------------------------------------------------------
-




-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to