Red Gate forums :: View topic - double not null constraints
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Source Control for Oracle
Source Control for Oracle forum

double not null constraints

Search in Source Control for Oracle forum
Post new topic   Reply to topic
Jump to:  
Author Message
sfrade



Joined: 17 Dec 2013
Posts: 6

PostPosted: Wed Dec 18, 2013 8:22 am    Post subject: double not null constraints Reply with quote

Hi

the code generated by Source control create a constraint NOT NULL and a CHECK (xxx IS NOT NULL) for the same field.

see the field titi_name in the code below
Code:

CREATE TABLE unified.titi (
  titi_id RAW(16) DEFAULT SYS_GUID() NOT NULL,
  titi_name VARCHAR2(50 BYTE) NOT NULL CONSTRAINT nn_titi_tina CHECK ("TITI_NAME" IS NOT NULL),
  CONSTRAINT titi_pk PRIMARY KEY (titi_id)
);


Seb
Back to top
View user's profile Send private message
eddie davis



Joined: 14 Jun 2006
Posts: 940
Location: Red Gate Software

PostPosted: Thu Dec 19, 2013 3:10 pm    Post subject: Reply with quote

Hi

I understand the problem, I believe it to be caused in the method that Oracle creates the metadata information.

Although you create your SQL script as follows:
Code:

CREATE TABLE TITI
(
TITI_ID RAW(16) DEFAULT SYS_GUID(),
TITI_NAME VARCHAR2(50 BYTE) CONSTRAINT NN_TITI_TINA NOT NULL,
CONSTRAINT TITI_PK PRIMARY KEY (TITI_ID)
);


Oracle is storing the metadata information as follows:
Code:

CREATE TABLE unified.titi (
titi_id RAW(16) DEFAULT SYS_GUID() NOT NULL,
titi_name VARCHAR2(50 BYTE) NOT NULL CONSTRAINT nn_titi_tina CHECK ("TITI_NAME" IS NOT NULL),
CONSTRAINT titi_pk PRIMARY KEY (titi_id)
);


As Source Control for Oracle will read how the table is created from the metadata, hence the difference.

Does this cause a problem for you?

A support ticket has been created for you HERE.

Many Thanks
Eddie
_________________
Eddie Davis
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group