Db2 Sql Error 23503
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Db2 Sql Error: Sqlcode=-803, Sqlstate=23505, Sqlerrmc=1
of this site About Us Learn more about Stack Overflow the company Business sqlstate: 23502 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges foreign key violation Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n530.html Sign up Why do I get SQL state:23503 when I try to add a constraint to an existing table in Postgres? up vote 0 down vote favorite I have table Advisor which is a special Userand contains only id and user_id (for now!) and I'm trying to make user_id a foreign key with the following script: ALTER TABLE advisor ADD CONSTRAINT advisor_user_id_fkey FOREIGN http://stackoverflow.com/questions/19641739/why-do-i-get-sql-state23503-when-i-try-to-add-a-constraint-to-an-existing-table KEY (user_id) REFERENCES "user" (id); Which I think should work, however I get this error: ERROR: insert or update on table "advisor" violates foreign key constraint "advisor_user_id_fkey" SQL state: 23503 Detail: Key (user_id)=(44) is not present in table "user". I thinks this is weird because I'm saying it should refer to user.id and not user.user_id, but obviously I'm doing something wrong. Does anyone have any idea about this? Thanks. update: if anyone is wondering why "user" and not user, well pgAdmin doesn't like user, because it thinks it's the owner of the database. sql postgresql foreign-keys constraints share|improve this question asked Oct 28 '13 at 17:54 Loolooii 2,504104071 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted "user" is a reserved word, that's why pgadmin is having trouble with it. If you have the ability to change that, I recommend it. See reserved words at: http://www.postgresql.org/docs/current/static/sql-keywords-appendix.html. Your error message clearly states that you have an entry in your "advisor" table (44) which does not exist in your "user" table. Your Foreign Key is defined on "advisor" and stipulates t
posts / 0 new Log in or register to post https://forums.activiti.org/content/integrity-constraint-violation-updating-actruvariable comments Last post Tue, 04/30/2013 - 21:02 #1 mindcrime Offline Last seen: 3 years 3 months ago Joined: 03/01/2013 - 20:39 Posts: 35 Integrity Constraint Violation updating ACT_RU_VARIABLE Hey gang, we're getting the following error using Activiti 5.10. This seems to be happening when we try to db2 sql update / insert variables in a service task, after returning from a web service call. The only real clue I have right now, that might point to the cause, is this stacktrace, and word from the development team that the web-service in question takes a LONG db2 sql error time to return... on the order of 3-4 minutes (I know, I know). Any thoughts on what, exactly, would be going on here? ### Error updating database. Cause: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the FOREIGN KEY "ACTDB01_UCB.ACT_RU_VARIABLE.ACT_FK_VAR_PROCINST" is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.64.82 ### The error may involve org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance-Inline ### The error occurred while setting parameters ### SQL: insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ### Cause: com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: The insert or update value of the FOREIGN KEY "ACTDB01_UCB.ACT_RU_VARIABLE.ACT_FK_VAR_PROCINST" is not equal to any value of the parent key of the parent table.. SQLCODE=-530, SQLSTATE=23503, DRIVER=3.64.82 at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147) at org
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 06 Oct 2016 07:42:49 GMT by s_hv997 (squid/3.5.20)