Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    2

    Question Unanswered: Using functions within an index

    I'm using AS/400 DB2 V2R5 (I think). Our AS/400 is old, but still beefy and fast. I'm not an expert on the AS/400 but have a lot of experience with SQL.

    I want to create an index as follows:

    create index <some index file name> on <some PF>
    (policy, effdte, coverg, prmste, aslob, burlin,
    int(substr(char(effdte),1,4)))

    I get error: "Token ( was not valid. Valid tokens: ) ,. " because it doesn't seem to like the function within an index. Is there another way to accomplish this? I have a 100,000,000 record file and need a summarization that takes less than 6 hours to run.

    Thanks,
    Mark

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I'm not sure about AS/400 but you could try creating a "computed" column and include it into the index.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •