Questions tagged as 'constraint'

1
answer

Error creating foreign key

I'm creating two foreign key references pointing to two different tables, but I'm getting an error creating one.    There are no primary or candidate keys in the referenced table   'dbo.TB_PODERES' that match the referencing column list in th...
asked by 22.01.2018 / 14:39
1
answer

MySQL error "Can not add foreign key constraint"

I'm starting in the SQL language. I'm having the following error: Table 'linces.controlos' doesn't exist I have not found the solution yet, can anyone help? Drop Database if Exists Linces; Create Database Linces; Use Linces; Create Table...
asked by 31.05.2016 / 01:32
1
answer

PostgreSQL constraint error

I have a code that is giving the following error:    there is no unique constraint matching given keys for referenced table   "schedule" Code: CREATE TYPE weekday AS ENUM ('Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sab...
asked by 13.02.2015 / 20:49
1
answer

How to change a primary key for constraint Auto_increment

I've created the following table create table if not exists cursos( nome varchar (30) not null unique, descicao text, carga int unsigned, totaulas int, ano year default '2018' )default charset = utf8; After adding a PK alter table curs...
asked by 28.11.2018 / 13:46
1
answer

Can not add foreign key constraint! however syntax and pks are correct

I'm trying to create an FK for a table, I do not understand syntax error, but TOAD returns me the message that FK can not create. The tables are created in the database, and the PKs are right. ALTER TABLE minsarh.perguntas ADD CONSTRAINT fk_pe...
asked by 25.04.2018 / 18:32
2
answers

How to add a unique constraint on a column without deleting the table or column

This is the sample table create table usuario( id serial primary key not null, nome varchar(100), email varchar(100), login varchar(100), senha varchar(100), tipo varchar(50), status varchar(30) ) I used this cod...
asked by 01.03.2018 / 03:43
1
answer

How to store the PxFixedJoint class in a vector

I'm trying to store the PxFixedJoint class in a std::vector with the push_back method. But the vector is always empty, it just does not add anything. Down the code. // C++ // Declaração do vector para armazenar os joint...
asked by 02.08.2014 / 19:57