Forum > Databases
[SOLVED] Creating and index on a numeric/integer field
(1/1)
1HuntnMan:
Researching and can't seem to find how to create an index on a integer field. See the snipet below:
Clients.Open;
{Add the primary index}
Clients.AddIndex('CUSTID','CUSTNO',[ixPrimary, ixUnique]);
{Add a secondary indexes}
Clients.AddIndex('CUSTNAME','CUSTOMER',[ixCaseInsensitive]);
==> Clients.AddIndex('CNTKIDNO','CNTKID',[ixInteger]); // Error here on ixInteger!!!!
Clients.AddIndex('CITYSTCTRY','CITYTOWN+STATEPROVINCE+COUNTRY',[ixCaseInsensitive]);
Clients.AddIndex('TYPECUST','CUSTTYPE',[ixCaseInsensitive]);
Clients.Close;
Trying to find all the ix's that can be used Adding Indexes:
ixPrimary, ixUnique, ixCaseInsensitive and what else. How would you create an index on an integer field?
dsiders:
--- Quote from: 1HuntnMan on November 19, 2023, 10:45:36 pm ---Researching and can't seem to find how to create an index on a integer field. See the snipet below:
Clients.Open;
{Add the primary index}
Clients.AddIndex('CUSTID','CUSTNO',[ixPrimary, ixUnique]);
{Add a secondary indexes}
Clients.AddIndex('CUSTNAME','CUSTOMER',[ixCaseInsensitive]);
==> Clients.AddIndex('CNTKIDNO','CNTKID',[ixInteger]); // Error here on ixInteger!!!!
Clients.AddIndex('CITYSTCTRY','CITYTOWN+STATEPROVINCE+COUNTRY',[ixCaseInsensitive]);
Clients.AddIndex('TYPECUST','CUSTTYPE',[ixCaseInsensitive]);
Clients.Close;
Trying to find all the ix's that can be used Adding Indexes:
ixPrimary, ixUnique, ixCaseInsensitive and what else. How would you create an index on an integer field?
--- End quote ---
Valid index options are: https://dsiders.gitlab.io/lazdocsnext/fcl/db/tindexoptions.html.
You should not need anything other than the name for the index and the name of the field:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Clients.AddIndex('CNTKIDNO', 'CNTKID', []);
It already knows the type for the underlying field.
1HuntnMan:
Tks DSiders, that was too easy...
1HuntnMan:
How do you label a subject SOLVED? I see this throughout the system on questions that were SOLVED. Do you just add the word SOLVED to the Subject?
Zvoni:
--- Quote from: 1HuntnMan on November 20, 2023, 01:01:26 pm ---How do you label a subject SOLVED? I see this throughout the system on questions that were SOLVED. Do you just add the word SOLVED to the Subject?
--- End quote ---
"Modify" your first post, and edit the Subject-Line with "[SOLVED] ....."
Navigation
[0] Message Index