what is wrong here?
ALTER TABLE valoare_lucrari(
ADD CONSTRAINT fk_oferta
FOREIGN KEY (id_ofertant,id_proiect)references(id_ofertant,id_proiect))
you have not closed the braces properly
I can not see that.
I removed the first brace but know It tell me that I have a sintax error at line 3
ALTER TABLE valoare_lucrari
ADD CONSTRAINT fk_oferta
FOREIGN KEY (id_ofertant,id_proiect)references(id_ofertant,id_proiect)
after 'ALTER TABLE valoare_lucrari' you have opened a beace '(' but you din't close it.
ALTER TABLE valoare_lucrari(
ADD CONSTRAINT fk_oferta
FOREIGN KEY (id_ofertant,id_proiect)references(id_ofertant,id_proiect))
use the above query
this problem is solved but the command did not altered table at all
]ALTER TABLE valoare_lucrari
ADD CONSTRAINT fk_oferta
FOREIGN KEY (id_ofertant,id_proiect)references valoare_lucrari(id_ofertant,id_proiect)
syntax:
ALTER TABLE valoare_lucrari(
ADD CONSTRAINT fk_oferta
FOREIGN KEY ('you need to spicify only one fiedd') references valoare_lucrari('target_field')
add one more ')' at the end
but I have two columns from I wish to establish a composite foreign key
with this
ALTER TABLE valoare_lucrari
ADD CONSTRAINT id_oferta
FOREIGN KEY (id_ofertant,id_proiect)references valoare_lucrari(id_ofertant,id_proiect)
it sais" your query executed ok ",
but no modification in the 'valoare_lucrari' table
do you know how can I generate a composite foreign key ?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.