Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
subsequent add versioning results SQL-Code -766...

 
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: 63
Location: Lower Saxony (DE)

PostPosted: Thu Apr 17, 2014 6:02 pm    Post subject: subsequent add versioning results SQL-Code -766...
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

Senior Member


Joined: 21 Sep 2010
Posts: 2264
Location: NY,USA

PostPosted: Fri Apr 18, 2014 12:11 am    Post subject:
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    Post subject:
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    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 proc step return code to override in ... Aaryaa JCL & VSAM 3 Tue Aug 20, 2019 4:32 pm
No new posts Difference between GE and GB return c... Poha Eater IMS DB/DC 8 Fri Jul 12, 2019 12:59 pm
No new posts S0C4 Reason Code 10 cz016m COBOL Programming 1 Thu May 02, 2019 7:13 am
No new posts IEFSJREQ or SWBREQTU following SSI Fu... sidinpsl PL/I & Assembler 0 Tue Jan 08, 2019 1:20 am
No new posts calling java code(on mainframe from c... elixir1986 COBOL Programming 1 Fri Nov 30, 2018 1:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us