IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference between in DB2 UDB & DB2 for Z/os


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
razesh84

New User


Joined: 05 Apr 2010
Posts: 41
Location: Kolkata,India

PostPosted: Mon Sep 12, 2011 4:35 pm
Reply with quote

Hi,

I was going thru DB2-730 study material where i found that in a DDL if some column is specified with primary key or unique constraint then DB2 creates an unique index on it automatically.

I was pretty sure that until & unless you define an unique index, uniqueness can not be achieved. Fortunately in my new shop i had authority to create test tables. I created tables in both ways [primary key & unique constraint]....ddl ran fine but coundnt find any index attached with the tables. when I try to insert records on it i'm getting the following error

Code:

SQLCODE = -540, ERROR:  THE DEFINITION OF TABLE RAJESH.EMP_TEST_CHK
IS INCOMPLETE BECAUSE IT LACKS A PRIMARY INDEX OR A REQUIRED UNIQUE
INDEX                                                               


So, i guess an unique index explicitly requires for DB2 z/os.
Is there any other similar variation for DB2 z/os version.can anyone share a link.

Thanks,
Rajesh
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Sep 12, 2011 5:02 pm
Reply with quote

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z9.doc.sqlref/src/tpc/db2z_sql_createtable.htm#db2z_sql_createtable__impidx

Quote:
The table is marked as unavailable until its primary index is explicitly created unless the CREATE TABLE statement is processed by the schema processor or the table space that contains the table is implicitly created. In that case, DB2 implicitly creates an index to enforce the uniqueness of the primary key and the table definition is considered complete. (For more information about implicitly created indexes, see Implicitly created indexes.)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
No new posts Difference between CEE3250C and CEE3204S COBOL Programming 2
Search our Forums:

Back to Top