Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Clustered Index with UCASE Key Expression: SQL-Code -628

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Auryn

New User


Joined: 11 Jan 2006
Posts: 40
Location: Lower Saxony (DE)

PostPosted: Mon Feb 02, 2015 8:00 pm    Post subject: Clustered Index with UCASE Key Expression: SQL-Code -628
Reply with quote

Hello there,

I'd like to create a clustered index that contains the in upper cases transformed data of a column (table / tablespace in encoding schema Unicode, column item_id VARCHAR(20) FOR SBCS DATA, DB2 v10 z/OS).
Code:
CREATE        INDEX                 my_clust_fct_ix
                    ON                     my_table
                    (  UCASE(   item_name
                             , 'UNI'        )   ASC
                     , item_id                  ASC)
                       USING STOGROUP      teststog
                       PRIQTY                   720
                       SECQTY                   720
                       ERASE                     NO
                       FREEPAGE                   0
                       PCTFREE                   10
                       GBPCACHE             CHANGED
                                            CLUSTER
                       COMPRESS                  NO
                       BUFFERPOOL              BP30
                       CLOSE                    YES
                       COPY                      NO
                       DEFER                     NO
                       DEFINE                   YES
                       PIECESIZE                2 G

But the result is SQL-Code -628 / SQL-State 42613

Because the Column is VarChar but FOR SBCS DATA, I tried to create the index using the UPPER function without the locale-name option. But the result was the same.

There are other indexes created, especially a unique index for the pk col item_id. But all of them are defined as NOT CLUSTER.

I was able to find several restrictions using key-expressions. And I know there must be max. one clustered index.
But I did not find any hints saying the index option CLUSTER is not allowed to be combined with key-expressions.

Can you please give me some information if I made some mistakes in the create statement above or if this is a not allowed (and a not very well documented) combination or in which other way I should try to create this index.
Back to top
View user's profile Send private message

Auryn

New User


Joined: 11 Jan 2006
Posts: 40
Location: Lower Saxony (DE)

PostPosted: Tue Feb 03, 2015 1:33 pm    Post subject: Re: Clustered Index with UCASE Key Expression: SQL-Code -628
Reply with quote

Auryn wrote:
Hello there,

I'd like to create a clustered index that contains the in upper cases transformed data of a column (table / tablespace in encoding schema Unicode, column item_id VARCHAR(20) FOR SBCS DATA, DB2 v10 z/OS).
(...)

Sorry, made a mistake discribing the column(s):
    item_name VARCHAR(20) FOR SBCS DATA,
    item_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue Feb 03, 2015 6:36 pm    Post subject:
Reply with quote

"A CREATE INDEX or ALTER INDEX statement attempted to specify either CLUSTER, PARTITION BY or both for an XML index or an extended index."

an index on a scalar function is an extended index!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us