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

subsequent add versioning results SQL-Code -766...


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

New User


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

PostPosted: Thu Apr 17, 2014 6:02 pm
Reply with quote

Hi there,

some months ago I created a set of tables (in one tablespace).
After having loss of data we cannot figure out, we'd like to migrate these to temporal tables (on DB2 v10.? z/OS).
I created a similar history table (currently the only one in it's tablepace) including the same columns as the base table and the three necessary timestamp cols.
After that, I added the timestamp cols (including the NOT NULL GENERATED ALWAYS AS ... clauses) to the base table as well as the PERIOD SYSTEM_TIME option.
When trying to ADD VERSIONING USE HISTORY TABLE, I receive the SQL-code -766 / SQL-State 560A4 which says "THE OBJECT OF A STATEMENT IS A TABLE FOR WHICH THE REQUESTED OPERATION IS NOT PERMITTED"
My german manual (basing on v9.0 z/OS) points out the statement references a auxiliary table.
But both, the prepared history table as well as the base table do not contain any LOB- or XML-columns.
Before executing the Alter Table Add Versioning statement, in SysTalbles the history table is marked as a ordinary table.

I've got two ideas what could be the reason for this problem. But in order to leave you unprejudiced, today I don't talk about them.

I'd be very thankful for any hints solving my problem.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Apr 18, 2014 12:11 am
Reply with quote

Hello,

Are you compliant to below clauses,(though few of them you listed above)?

Table with system-period data versioning
A table with system-period data versioning must be the only table in the table space, and it must not be any of the following types of tables:
•An incomplete table
•An auxiliary table
•A clone table or a table with a clone defined on it
•A table that was implicitly created for an XML column
•A table that contains a security label column

A security label column cannot be added to a system-period temporal table.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Apr 18, 2014 1:51 pm
Reply with quote

Quote:
A table with system-period data versioning must be the only table in the table space

This means the base table as well!
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top