[SOLVED] Creating and index on a numeric/integer field lazarus / 16-Databases ---------------------------------------------------------------------- 1HuntnMan · 2023-11-19 21:45 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',[i xCaseInsensitive]);      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 · 2023-11-19 23:01 Quote from: 1HuntnMan on November 19, 2023, 10:45:36 pmResearching 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',[i xCaseInsensitive]);      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? 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Clients.AddIndex('CNTKIDNO', 'CNTKID', []); It already knows the type for the underlying field. ---------------------------------------------------------------------- 1HuntnMan · 2023-11-20 11:50 Tks DSiders, that was too easy... ---------------------------------------------------------------------- 1HuntnMan · 2023-11-20 12:01 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 · 2023-11-20 12:37 Quote from: 1HuntnMan on November 20, 2023, 01:01:26 pmHow 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? "Modify" your first post, and edit the Subject-Line with "[SOLVED] ....."