Db2 Error Code Sqlcode 803
Contents |
here for a quick overview of the site Help Center Detailed answers
Sqlcode=-803 Sqlstate=23505 Db2
to any questions you might have Meta Discuss the workings db2 sql error sqlcode=-811 and policies of this site About Us Learn more about Stack Overflow the company Business db2 sql error sqlcode=-805 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n803.html 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: Sign up DB2 SQL-Error: -803 when inserting into two related tables up vote 2 down vote favorite I have two tables which are created with http://stackoverflow.com/questions/21479931/db2-sql-error-803-when-inserting-into-two-related-tables this statements: CREATE TABLE Behandlungsvorgang ( patientId SMALLINT NOT NULL REFERENCES Patient(id), datum DATE NOT NULL, notizen VARCHAR(100), PRIMARY KEY (patientId, datum) ); CREATE TABLE behandelt ( arztLogin VARCHAR(50) NOT NULL REFERENCES Arzt(login), behandlungsDatum DATE NOT NULL, behandlungsPatientId SMALLINT NOT NULL, medikamntPzn SMALLINT NOT NULL REFERENCES Medikament(pzn), krankheitName VARCHAR(50) NOT NULL REFERENCES Krankheit(name), PRIMARY KEY (arztLogin, behandlungsDatum, behandlungsPatientId, medikamntPzn, krankheitName), FOREIGN KEY (behandlungsDatum, behandlungsPatientId) REFERENCES Behandlungsvorgang(datum, patientId) ); And I have a method which should insert data into this tables. It always inserts new data so before inserting into behandelt I have to insert into Behandlungsvorgang to fulfill the foreign key requirements. The method looks like this: public void add(TreatmentProcess tp) throws StoreException { try { PreparedStatement psBehandlungsvorgang = connection.prepareStatement("INSERT INTO Behandlungsvorgang (patientId, datum, notizen) VALUES (?, ?, ?)"); psBehandlungsvorgang.setInt(1, tp.getPatientId()); psBehandlungsvorgang.setDate(2, tp.getDate()); psBehandlungsvorgang.setString(3, tp.getNotes()); psBehandlungsvorgang.executeUpdate(); PreparedStatement psBehandelt = connection.prepareStatement("INSERT INTO behandelt (arztLogin, behandlungsDatum, behandlungsPatientId, medikamntPzn, krankheitName) V
for empty file If the VSAM is empty then copy job abends Copying files from Tapes to DASD Low values to Spaces http://mainframewizard.com/content/sql-code-803 using SORT Difference Between Catalog and Instream Procs Maximum Exec Statements http://www.allinterview.com/showanswers/89062/how-to-resolve-803-sql-code-in-db2.html in a JCL COBOLSmallest Program RENAME CLAUSE REDEFINE CLAUSE EDITED PICTURE ACCEPT and DISPLAY ADD VERB SUBTRACT VERB MULTIPLY VERB DIVIDE VERB Initialize a filler in cobol COBOL Allowed Moves COBOL PERFORM PARA EVALUATE ARITHMETIC EXPRESSION EVALUATE CONDITIONAL EXPRESSION EVALUATE FALSE EVALUATE IDENTIFIER EVALUATE LITERAL db2 sql EVALUATE TRUE EVALUATE TRUE ALSO TRUE GO TO DEPENDING ON INLINE PERFORM INSPECT REPLACING ALL SPACES BY LITERAL INSPECT REPLACING CHARACTERS BY LITERAL BEFORE INITIAL LITERAL INSPECT REPLACING LEADING SAPCES BY LITERAL INSPECT TALLYING FOR ALL IDENTIFIER INSPECT TALLYING FOR ALL LITERAL INSPECT TALLYING FOR ALL SPACES INSPECT TALLYING FOR CHARACTER INSPECT TALLYING FOR CHARACTER AFTER INITIAL db2 sql error SPACES INSPECT TALLYING FOR CHARACTER BEFORE INITIAL SPACES INSPECT TALLYING FOR LEADING SPACES INSPECT TALLYING FOR LEADING ZEROES JUST RIGHT CLAUSE PERFORM THRU PERFORM TIMES PERFORM UNTIL PERFORM VARYING UNTIL PERFORM WITH TEST BEFORE PERFORM WITH TEST AFTER DIFFERENCE BETWEEN STRING and MOVE STRING DELIMITED BY IDENTIFIER STRING DELIMITED BY LITERAL STRING DELIMITED BY SIZE STRING DELIMITED ON OVERFLOW STRING DELIMITED WITH POINTER UNSTRING DELIMITED BY IDENTIFIER UNSTRING DELIMITED BY LITERAL UNSTRING DELIMITED ON OVERFLOW UNSTRING DELIMITED WITH POINTER OPTION COBOL TO RECEIVE DATA FROM JCL DIFFERENCE BETWEEN SEARCH AND SEARCH ALL DB2DB2 query to select first or last N rows Description of a DB2 Table Difference in number of days CONTOKEN Verification Update Table using other Table Update a column using other column in Table Adding Primary Key on exisitng DB2 Table Alias of DB2 Table Changing the primary key on existing DB2 Table Compile and Link JCL for COBOL Create a DB2 Table Creating Primary Key while creating DB2 Table Delete Duplicate Rows from DB2 Table
MainFrame >> DB2 Suggest New Category How to resolve -803 sql code in DB2? Question Posted / vikram and mangesh 3 Answers 27939 Views Cap Gemini, I also Faced E-Mail Answers Answers were Sorted based on User's Feedback Answer / lakshmi This error is thrown when you try to insert a row with existing primary key i.e.Duplicate. If you want to insert the row either you should delete the already existing row and insert the new row or update the same row with the new values for other fields Is This Answer Correct ? 22 Yes 8 No Answer / venkata sastry The SQL - 803 error occurs on the violation of a UNIQUE constraint. Update the record if it already exists rather inserting new one. Is This Answer Correct ? 15 Yes 6 No Answer / lu Before to insert, it's better to select(retrieve),test sqlcode when 100 insert when 00 update whenever send message and abend...You don't have an heache.... Is This Answer Correct ? 5 Yes 3 No Post New Answer Categories COBOL (884)JCL (728)CICS (459)DB2 (684)IMS (80)IDMS (42)Natural (43)ADABAS (9)REXX (23)Assembler (31)CLIST (6)QMF (30)MVS (12)OS390 (8)OS 2 (6)VSAM (177)QSAM (4)Sysplex (5)IBM MainFrame AllOther (160) More DB2 Interview Questions Are views updatable ? 4 Answers what is the maximum number of tables that can be joined ? 8 Answers TCS, How do you prepare a COBOL + DB2 program from coading till execution ? 1 Answers Xansa, Amdocs, How to test SQL -911 error while developing COB-DB2 program 1 Answers Satyam, Explain what a plan is? 3 Answers CTS, what is the use of cursors? 3 Answers iGate, In db2, how do you insert multiple rows in 1 query using a.) Cursors, b.) Normal query?? Give syntax for both. 5 Answers CTS, Describe the elements of the SELECT query syntax? 3 Answers What does it mean if the null indicator has -1, 0, -2? 1 Answers Can we use select query in a loop to fetch multiple rows in a COBOL PROGRAM? If so, what is the advantage of cursor? 1 Answers UST, what are extents? 5 Answers What is tablespace? 3 Answers For more DB2 Interview Questions Click Here Cop