Questions tagged as 'constraint'

1
answer

How to fix rigid "bodies" using PhysX

How can I fix two hard or dynamic "bodies" in a way that where one goes the other goes as close as possible to PhysX . I'm using the PxFixedJoint class but it did not please me. Asyoucanseeintheprintabove,thereisa"belly" curve in t...
asked by 31.07.2014 / 19:59
2
answers

CONSTRAINT that adds parameter to FOREIGN KEY?

I have the following code for creating tables: CREATE TABLE pessoa ( cod_pessoa int NOT NULL IDENTITY PRIMARY KEY, nm_pessoa varchar (50) NOT NULL, tp_pessoa char(1) NOT NULL, endereco_pessoa varchar(50) NOT NULL, CONSTRAINT pessoa_tipo CHECK...
asked by 26.11.2014 / 18:10
1
answer

When should I create a constraint as DEFERRED?

As far as I know, creating a constraint (such as a foreign key or a check) as DEFERRED causes it to only be validated at the end of the transaction. Why is this used? And when should it not be used?     
asked by 18.03.2015 / 13:24
1
answer

How to create a single index based on two columns?

I have a table with these columns: ip nome email I want ip and email to be a single pair. The same value of ip can contain multiple records and a same email can also contain. But the same ip and even em...
asked by 17.10.2017 / 21:48
1
answer

Problems with Constraints in PostgreSQL

I'm having a problem with PostgreSQL, 8.1. Adding constraints returns the same error: SQL error:    ERROR: there is no unique constraint matching given keys   referenced table " Here is the code I'm using: CREATE TABLE "adminis...
asked by 14.09.2014 / 20:54
1
answer

SQL Constraints fits as DML or as DDL?

DDL - Data definition language: is used to create and change tables (CREATE, ALTER, etc.), right? DML - Data manipulation language: is used for data manipulation of tables (INSERT, UPDATE, DELETE, SELECT). Do CONSTRAINTS fall into the DDL...
asked by 22.02.2018 / 17:08
1
answer

How to create a named Primary Key constraint in Postgres?

I'm continuing to create a primary keyless table initially. Then I add a id field of serial type and try to create the constraint for the Primary Key (PK): create table macaco( nome varchar(50), idade integer ); --adicionando o id do...
asked by 16.08.2018 / 17:22
0
answers

Does CPF Hibernate Constraint not accept valid CPF?

I'm trying to run the Hibernate CPF validation constraint, but it just seems to reject valid CPF. The same test using the Email constraint normally works : EmailValidator validator = new EmailValidator(); validator.isValid("[email protected]", n...
asked by 26.01.2018 / 12:07
0
answers

Error Code: 1452. Can not add or update child row: a foreign key constraint fails

I would like to ask a question, or just show me the way. There is a table called Questionnaire from it I get the records in a procedure and organize the data in it. Here is my code: CREATE DEFINER='myroot'@'%' PROCEDURE 'SP_OrganizaEnvio...
asked by 16.11.2015 / 14:58
1
answer

How to disable a constraint in ORACLE?

I have a table where two specific fields together can not have the same values. BELIEVE what they are: NUM_DIVISION COD_INDICATOR Assuming I have this data: NUM_PERIODO_LANCAMENTO = 1 , COD_INDICADOR = 1 , COD_CR_PERIODO = 1 NUM...
asked by 02.06.2014 / 17:05