Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Strange error message

    Posted 08/15/23 12:26 PM

    Greetings.

    I'm running Version 14.10.FC9W1 on Linux.

    I tried this for fun:

    create table t1 (f1 char(100));
    create index my_ix on t1 (f1[1,10]);
    
    26601: Cannot define a partial-column index on the non-character column, (f1).
    

    $ finderr 26601
    -26601    Cannot define a partial-column index on the non-character column,
    column-name.

    You can specify a substring size in the CREATE INDEX statement only for
    columns of character data types, such as CHAR, LVARCHAR, NCHAR, NVARCHAR,
    or VARCHAR.
    For the specified column, the index key must be the entire column value.

    Remove the substring size value that follows the column name and rerun
    the statement.

    The error message implies that this should work.

    Best regards,

    -Snorri



    ------------------------------
    Snorri Bergmann
    ------------------------------


  • 2.  RE: Strange error message

    Posted 08/15/23 12:28 PM
    Create an SPL that returns f1[1,10] and use that in the index definition

    On 8/15/2023 11:25 AM, Snorri Bergmann via IBM TechXchange Community wrote:
    01000189fa04a82f-f7cf21db-1fad-4ea0-8525-c72c39123aa2-000000@email.amazonses.com">
    Greetings. I'm running Version 14.10.FC9W1 on Linux. I tried this for fun: create table t1 (f1 char(100)); create index my_ix on t1 (f1[1,10]...
    IBM TechXchange Community

    Informix

    Post New Message
    Strange error message
    Reply to Group Reply to Sender
    Snorri Bergmann
    Aug 15, 2023 12:26 PM
    Snorri Bergmann

    Greetings.

    I'm running Version 14.10.FC9W1 on Linux.

    I tried this for fun:

    create table t1 (f1 char(100)); create index my_ix on t1 (f1[1,10]); 26601: Cannot define a partial-column index on the non-character column, (f1).

    $ finderr 26601
    -26601    Cannot define a partial-column index on the non-character column,
    column-name.

    You can specify a substring size in the CREATE INDEX statement only for
    columns of character data types, such as CHAR, LVARCHAR, NCHAR, NVARCHAR,
    or VARCHAR.
    For the specified column, the index key must be the entire column value.

    Remove the substring size value that follows the column name and rerun
    the statement.

    The error message implies that this should work.

    Best regards,

    -Snorri



    ------------------------------
    Snorri Bergmann
    ------------------------------
      Reply to Group Online   View Thread   Recommend   Forward   Flag as Inappropriate  



     
    You are subscribed to "Informix" as paul@oninit.com. To change your subscriptions, go to My Subscriptions. To unsubscribe from this community discussion, go to Unsubscribe.

    --  Paul Watson Oninit www.oninit.com Tel: +1 913 364 0360 Cell: +1 913 387 7529  Oninit® is a registered trademark of Oninit LLC  If you want to improve, be content to be thought foolish and stupid Failure is not as frightening as regret





  • 3.  RE: Strange error message

    Posted 08/15/23 12:47 PM

    Thanks Paul.

    I know I can use a functional index but then sql-statements need to be modified accordingly :)

    Regards,

    -Snorri



    ------------------------------
    Snorri Bergmann
    ------------------------------