+ Reply to Thread
Results 1 to 6 of 6

Thread: UCASE as an index?

  1. #1
    Guest.Visitor Guest

    Default UCASE as an index?

    Tom,
    I haven't used this before, but in theory it should work:
    Use the TRNTBL() keyword on the appropriate field and specify the QSYS/QSYSTRNTBL as the table to use. It's purpose is to translate lower to upper case.
    Bill
    I have a field that contains upper and lower case (it may not much longer if this keeps up.) When this data was on the PC they were able to search on smith' and find smith', Smith', SMITH', or any other variation. I can do the same thing in SQL by using UCASE on what the search string as well as the field coming from the PF. But it's slow. I can't find any way to simulate UCASE in a DDS key field and UCASE either can't be used with SQL create index or I'm not getting the syntax down. Can anyone help?

  2. #2

    Default UCASE as an index?

    Look at the SRTSEQ parameter in the CRTLF command, specifically SRTSEQ(*LANGIDSHR). This little-known keyword will do exactly what you want.

  3. #3
    Guest.Visitor Guest

    Default UCASE as an index?

    Thanks guys. I tried both techniques and they both seem to give identical results. Joe - You must have done some serious digging to find that one. I had a hard time finding a decent description - http://publib.boulder.ibm.com/cgi-bi...6.2#TBLENGSORT - even after I knew what I was looking for! Tom McQuinn

  4. #4
    Guest.Visitor Guest

    Default UCASE as an index?

    I have a field that contains upper and lower case (it may not much longer if this keeps up.) When this data was on the PC they were able to search on smith' and find smith', Smith', SMITH', or any other variation. I can do the same thing in SQL by using UCASE on what the search string as well as the field coming from the PF. But it's slow. I can't find any way to simulate UCASE in a DDS key field and UCASE either can't be used with SQL create index or I'm not getting the syntax down. Can anyone help? FWIW, if there's an easier way than using a derived field as an index or forcing everything to upper case at entry time than I prefer that shortcut. Tom McQuinn

  5. #5
    Guest.Visitor Guest

    Default UCASE as an index?

    In SQL the function upper(column) converts characters ti UCASE

  6. #6

    Default UCASE as an index?

    The nice thing about the *LANGIDSHR technique is that it works with European languages, sorting character with umlauts and tildes into their appropriate canonical positions. Joe

+ Reply to Thread

Similar Threads

  1. SQL Index
    By Guest.Visitor in forum Application Servers
    Replies: 5
    Last Post: 07-22-2004, 07:47 AM
  2. array index (*)
    By Guest.Visitor in forum Application Software
    Replies: 2
    Last Post: 09-27-2000, 10:03 AM
  3. search index
    By Guest.Visitor in forum Programming
    Replies: 3
    Last Post: 08-19-1999, 08:43 AM
  4. Old Issue Index
    By Guest.Visitor in forum Analysis
    Replies: 4
    Last Post: 08-05-1999, 01:34 PM
  5. View vs Index??
    By Guest.Visitor in forum Analysis
    Replies: 5
    Last Post: 07-06-1999, 06:34 PM

Posting Permissions

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