Hi,

your select statement does not include a "where"  or "order by" - clause 
for which the index can be used, which is the cause of the error.
If you want to select "the records by their index sequence", you should use

Select * From "APPLE" ORDER BY "MySurname";

The index will then be used automatically.

Also, i see that you enclose column names and table names by double 
quotes. This is not necessary.

HTH
Martin

ggcoo...@clearmail.com.au wrote:
> Hi
> I am trying to select (list) records by their index sequence BUT keep
> getting the SQL error.
>
> "SQL error can't use index: Surname"
> . Indices showes the index
>
> ;----------------------------------------------------------------
> ;Sample INDEX program
> ;
> CREATE TABLE "APPLE" ("MyName", "MySurname", "MyAge", PRIMARY KEY ("MyAge"));
> CREATE INDEX "Surname" on "APPLE" ("MySurname");
>
> INSERT INTO "APPLE" VALUES ('Greg','Hooper', 54);
> INSERT INTO "APPLE" VALUES ('Daniel','Hooper', 30);
> INSERT INTO "APPLE" VALUES ('Nicole','Lvester', 32);
> INSERT INTO "APPLE" VALUES ('Rhonda','Grin', 50);
>
> Select * From "APPLE" INDEX BY "Surname";
>
>
>
> Regards Greg.
>
> _______________________________________________
> 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

Reply via email to