Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
primary key of an integer column desc |
Thu, Jan 24 2013 11:23 PM | Permanent Link |
Xiannong Chen | I have a table with an integer column as the primary index. I want to make it DESC sorting order. I don't see a way to change this using the db manager. I created a secondary index against the same column with DESC sorting order, when I have the " order by ... DESC" in sql, the query is very slow, it seems the secondary index is not used. Thanks, Paul
|
Fri, Jan 25 2013 4:07 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Xiannong Chen or Paul
Could you please post the SQL statement and the table structure (fields/indexes) and someone in NG can help you Eduardo |
Fri, Jan 25 2013 2:10 PM | Permanent Link |
Xiannong Chen | Here is the SQL script to generate the column:
EXECUTE IMMEDIATE 'CREATE TABLE "bib" ( "Ref_ID" INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "Authors" VARCHAR(250) COLLATE "UNI", ... Here is the SQL script to generate the constraint: EXECUTE IMMEDIATE 'ALTER TABLE "bib" ADD CONSTRAINT "PrimaryKey" PRIMARY KEY ("Ref_ID")'; Thanks, Paul |
Sat, Jan 26 2013 4:16 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Xiannong
ElevateDB currently creates unidirectional indices. What you need is to add a descending index CREATE INDEX "Downwards" ON "bib" ("RefID" DESC) In EDBManager go to the table and in the left hand pane double click it, click Indexes and then select Create New Index in the Tasks panel. You can then add an index or you can use the SQL above. Roy Lambert [Team Elevate] |
Sat, Jan 26 2013 10:17 AM | Permanent Link |
Xiannong Chen | Roy, Thank you. I remember with DBISAM, I can change the direction of primary index from ASC to DESC. It seems that is not possible in ElevateDB. Your suggestion works. Thanks, Paul
|
This web page was last updated on Saturday, April 27, 2024 at 08:52 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |