snippetjournal

– notes, snippet codes, and my journal

Archive for January 2016

[Oracle] ORA-02292 : Mencari Table Constraints dengan Constraints Name

leave a comment »

mencoba mengupdate salah satu column pada row, tetapi terkena error seperti ini :

update auth_users set username = ‘user1@test.co.id’ where name = ‘user@test.co.id’
Error report –
SQL Error: ORA-02292: integrity constraint (ADMIN.FK_2TUB76GCBJC6VCSO1FBE15L3P) violated – child record found
02292. 00000 – “integrity constraint (%s.%s) violated – child record found”
*Cause: attempted to delete a parent key value that had a foreign
dependency.
*Action: delete dependencies first then parent or disable constraint.

 

maka kita dapat mencari tahu, constraints name itu milik table siapa (FK_2TUB76GCBJC6VCSO1FBE15L3P). gunakan syntax berikut :

select table_name from user_constraints where constraint_name=’FK_2TUB76GCBJC6VCSO1FBE15L3P’;

Advertisements

Written by snippetjournal

January 4, 2016 at 10:26 am

Posted in Programming

Tagged with ,