473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Cannot create procedure with create cluster index in it

I am trying to create a store proc that contain a create index with
the cluster option and I receive

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0623N A clustering index already exists on table "PGIR.TF_RRCE".
LINE
NUMBER=35. SQLSTATE=55012

I did try to use
CALL SET_ROUTINE_OPTS('DYNAMICRULES RUN VALIDATE RUN')
before calling the create store proc but I still get the error.

If I skip the cluster option in the create index, then the create proc
work!!!

Any idea how to create the store proc in db2 without object
validation?

Thanks in advance

$ db2level
DB21085I Instance "db2dev6" uses "64" bits and DB2 code release
"SQL08024"
with level identifier "03050106".
Informational tokens are "DB2 v8.1.1.104", "s060120", "U805924", and
FixPak
"11".
Product is installed at "/usr/opt/db2_08_FP11".

Feb 2 '07 #1
4 3718
On Feb 2, 8:06 am, "JohnnyDeep" <jean-guy....@desjardins.comwrote:
I am trying to create a store proc that contain a create index with
the cluster option and I receive

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0623N A clustering index already exists on table "PGIR.TF_RRCE".
LINE
NUMBER=35. SQLSTATE=55012

I did try to use
CALL SET_ROUTINE_OPTS('DYNAMICRULES RUN VALIDATE RUN')
before calling the create store proc but I still get the error.

If I skip the cluster option in the create index, then the create proc
work!!!

Any idea how to create the store proc in db2 without object
validation?

Thanks in advance

$ db2level
DB21085I Instance "db2dev6" uses "64" bits and DB2 code release
"SQL08024"
with level identifier "03050106".
Informational tokens are "DB2 v8.1.1.104", "s060120", "U805924", and
FixPak
"11".
Product is installed at "/usr/opt/db2_08_FP11".
Hi, Johnny:

I'm sure you're aware that only one clustering index can exist on a
table at any one time. There's no way around this. So, is there a step
in your procedure where you're deleting this "other" clustering index
first, and your issue/question is really one of timing? Are you
getting the error when trying to create (as opposed to run) the SP?

--Jeff

Feb 2 '07 #2
On Feb 2, 1:27 pm, "jefftyzzer" <jefftyz...@sbcglobal.netwrote:
On Feb 2, 8:06 am, "JohnnyDeep" <jean-guy....@desjardins.comwrote:


I am trying to create a store proc that contain a create index with
the cluster option and I receive
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0623N A clustering index already exists on table "PGIR.TF_RRCE".
LINE
NUMBER=35. SQLSTATE=55012
I did try to use
CALL SET_ROUTINE_OPTS('DYNAMICRULES RUN VALIDATE RUN')
before calling the create store proc but I still get the error.
If I skip the cluster option in the create index, then the create proc
work!!!
Any idea how to create the store proc in db2 without object
validation?
Thanks in advance
$ db2level
DB21085I Instance "db2dev6" uses "64" bits and DB2 code release
"SQL08024"
with level identifier "03050106".
Informational tokens are "DB2 v8.1.1.104", "s060120", "U805924", and
FixPak
"11".
Product is installed at "/usr/opt/db2_08_FP11".

Hi, Johnny:

I'm sure you're aware that only one clustering index can exist on a
table at any one time. There's no way around this. So, is there a step
in your procedure where you're deleting this "other" clustering index
first, and your issue/question is really one of timing? Are you
getting the error when trying to create (as opposed to run) the SP?

--Jeff- Hide quoted text -

- Show quoted text -
Hi Jeff,

I am receiving the error while trying to create the store procedure.

I am aware that only one cluster index should be create for a table.
I just want to create the store procedure without dropping the index
first.

The funny part is that if I create the store procedure containing a
create index on a table currently having the index, it work. It`s only
the cluster option that seem to be validate at the creation of the
store procedure (and not the fact that the index already exists)

There should be a way to create a store procedure without checking the
status of the objects within the store procedure at bind time. I just
can find the way to solve that issue.

Regards,
Feb 5 '07 #3
On Feb 5, 7:29 am, "JohnnyDeep" <jean-guy....@desjardins.comwrote:
On Feb 2, 1:27 pm, "jefftyzzer" <jefftyz...@sbcglobal.netwrote:


On Feb 2, 8:06 am, "JohnnyDeep" <jean-guy....@desjardins.comwrote:
I am trying to create a store proc that contain a create index with
the cluster option and I receive
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0623N A clustering index already exists on table "PGIR.TF_RRCE".
LINE
NUMBER=35. SQLSTATE=55012
I did try to use
CALL SET_ROUTINE_OPTS('DYNAMICRULES RUN VALIDATE RUN')
before calling the create store proc but I still get the error.
If I skip the cluster option in the create index, then the create proc
work!!!
Any idea how to create the store proc in db2 without object
validation?
Thanks in advance
$ db2level
DB21085I Instance "db2dev6" uses "64" bits and DB2 code release
"SQL08024"
with level identifier "03050106".
Informational tokens are "DB2 v8.1.1.104", "s060120", "U805924", and
FixPak
"11".
Product is installed at "/usr/opt/db2_08_FP11".
Hi, Johnny:
I'm sure you're aware that only one clustering index can exist on a
table at any one time. There's no way around this. So, is there a step
in your procedure where you're deleting this "other" clustering index
first, and your issue/question is really one of timing? Are you
getting the error when trying to create (as opposed to run) the SP?
--Jeff- Hide quoted text -
- Show quoted text -

Hi Jeff,

I am receiving the error while trying to create the store procedure.

I am aware that only one cluster index should be create for a table.
I just want to create the store procedure without dropping the index
first.

The funny part is that if I create the store procedure containing a
create index on a table currently having the index, it work. It`s only
the cluster option that seem to be validate at the creation of the
store procedure (and not the fact that the index already exists)

There should be a way to create a store procedure without checking the
status of the objects within the store procedure at bind time. I just
can find the way to solve that issue.

Regards,- Hide quoted text -

- Show quoted text -
One thing you might want to try is to rewrite the CREATE INDEX
statement in the stored proc as dynamic SQL.

--Jeff

Feb 5 '07 #4
This error is produced when DB2 compiles /(checks the correctness of)
the stored procedure. It notices that you already have a clustered
index on the table, and tells you so.
Like Jeff mentioned, if you turn the CREATE INDEX statement into
dynamic SQL then you shouldn't have a problem.
Feb 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Philip Yale | last post by:
I'm probably going to get shot down with thousands of reasons for this, but I've never really heard or read a convincing explanation, so here goes ... Clustered indexes are more efficient at...
0
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
2
by: Adam Kavan | last post by:
I have a table that II am constantly inserting into (around 10 times a second right now but hope to increase latter). I hold these rows for a week then summarize and delete them. During that week...
6
by: Robin Lawrie | last post by:
Hi, Looking for some help here! I'm adding records to a SQL 2000 DB using the objRS.AddNew and objRS.Update methods. What I'd like to do is determine the new primary key value of the added...
1
by: Dhruba Bandopadhyay | last post by:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm....
1
by: dunleav1 | last post by:
The table is a many row and many column table that is in a 16K page size. I am running row compression on the table. A have an index that over time have come to have a low index cluster ratio. ...
2
by: dunleav1 | last post by:
I have a many row and many column table that is in a 16K page size. I have four indexes on the table. I am running row compression on the table. The table does not have a primary key. The table...
1
by: rdsandy | last post by:
Hi, I have a table Risk, a table Mitigation and a table RiskArchive. I am taking the RiskID, Criticality and MitigationPlan fields from Risk, and MitigationActionID from Mitigation and inserting...
10
by: Ian | last post by:
Henry J. wrote: MDC *guarantees* clustering, whereas a table with a clustering index will eventually require maintenance (a.k.a. reorg) to maintain the cluster ratio. That's not to say that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.