On Mon, 31 Jan 2011 11:05:13 -0500, Simon Slavin <[email protected]>
wrote:
> In the definition given in the original post, which I quoted, the table
> was defined as follows:
>
>> CREATE VIRTUAL TABLE Directors USING fts3(id INTEGER PRIMARY KEY NOT
>> NULL, first_name TEXT NOT NULL, last_name TEXT NOT NULL,
>> show_last_name_first INTEGER DEFAULT 0, normalised_name TEXT NOT NULL,
>> sort_name TEXT NOT NULL, fanships_count INTEGER, image_url
>> VARCHAR(255));
>
> Under this situation, would SQLite not use 'id' as an alias to rowid ?
Ah yes, you are correct. Evidence, using sqlite3 shell compiled with FTS3:
sqlite> CREATE VIRTUAL TABLE "Test" USING fts3(
...> "id" INTEGER PRIMARY KEY NOT NULL,
...> "Content" TEXT);
sqlite> INSERT INTO "Test" ("id", "Content") VALUES(
...> 101,
...> 'This is a test.');
sqlite> .mode line
sqlite> SELECT typeof("id"), typeof("Content") FROM "Test";
typeof("id") = integer
typeof("Content") = text
Continuing on, to address the original poster’s question:
sqlite> SELECT * FROM "Test" WHERE "id" = 101;
id = 101
Content = This is a test.
sqlite> SELECT * FROM "Test" WHERE "id" = '101';
sqlite>
You were right; I was wrong. I saw FTS3 and somehow missed the PK
definition.
Of course, this still does not answer why the OP observed different
results on different platforms.
Very truly,
Samuel Adam <[email protected]>
763 Montgomery Road
Hillsborough, NJ 08844-1304 • United States
http://certifound.com/
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users