Error Db2 Sql Error Sqlcode=-407
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 of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers db2 sql error sqlcode 407 sqlstate 23502 or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Db2 Sql Error Codes
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 db2 sql error sqlcode 440 sqlstate 42884 takes a minute: Sign up Inserting a row into DB2 from a sub-select - NULL error up vote 4 down vote favorite I am trying to insert a row into a table, using a value that is derived from another db2 sql error sqlcode list table. Here is the SQL statement that I am trying to use: INSERT INTO NextKeyValue(KeyName, KeyValue) SELECT 'DisplayWorkItemId' AS KeyName, (MAX(work_item_display_id) + 1) AS KeyValue FROM work_item; So, I am trying to create a row in NextKeyValue that has 'KeyName' of 'DisplayWorkItemId' and 'KeyValue' of one more than the maximum value in work_item.work_item_display_id. The SELECT statement in the above query returns the expected result, when I run it on its own. The whole SQL query is giving me the following
Db2 Sql Error Sqlcode 305
error, though: Error: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=75, COLNO=2, DRIVER=3.50.152 SQLState: 23502 ErrorCode: -407 What does this mean, and what is wrong with my query? sql db2 share|improve this question edited May 17 '09 at 17:29 asked May 17 '09 at 3:13 pkaeding 18.5k2173120 +1 I suggest you change the title of the question to something like "Inserting a row from sub-select - NULL error", and add "SQL" tag, since this problem is generic and not DB2-specific. –Roee Adler May 17 '09 at 5:59 good idea. I just did it. –pkaeding May 17 '09 at 17:29 add a comment| 1 Answer 1 active oldest votes up vote 10 down vote accepted The most probable explanation is that you have additional columns in NextKeyValue table that can't accept NULL values, and this INSERT statement is "trying" to put NULL in them. Is that the case by any chance? share|improve this answer answered May 17 '09 at 5:12 Roee Adler 13.1k2283120 Yup, that was it. There were a bunch of other columns in that table that were not nullable that I forgot about. Thanks! –pkaeding May 17 '09 at 5:42 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By p
360 games PC games db2 sql error sqlcode 440 sqlstate 42884 stored procedure Windows games Windows phone games Entertainment All Entertainment db2 sql error sqlcode 804 Movies & TV Music Business & Education Business Students & educators
Db2 Sql Error Sqlcode 204 Sqlstate 42704
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/873828/inserting-a-row-into-db2-from-a-sub-select-null-error Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/330369 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
View Site Leaders Advanced Search Forum Pentaho Users Pentaho Data Integration [Kettle] Error inserting rows in a table If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to http://forums.pentaho.com/showthread.php?77825-Error-inserting-rows-in-a-table register before you can post: click the register link above to proceed. To start viewing messages, https://forum.hibernate.org/viewtopic.php?f=1&t=946973&view=next select the forum that you want to visit from the selection below. Results 1 to 5 of 5 Thread: Error inserting rows in a table Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 08-11-2010,03:15 PM #1 omm View Profile View Forum Posts Private Message Senior Member Join Date db2 sql Jun 2010 Posts 114 Error inserting rows in a table : Not null constraint I am trying to upload data from an excel sheet to a table. Since my target table has all the columns as not null, I have replaced all the null values with some default values using replace null value step. But still, I am getting the error below. DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=6, TABLEID=260, COLNO=1, DRIVER=3.50.152 To double check, I have kept only one row db2 sql error in the excel sheet and have checked the values passed in the stream after the replace null value step. Everything looks fine. I should be missing something. Could there be any chance that the error could be thrown for any other reason other than the one related to Null values? Last edited by omm; 08-12-2010 at 11:54 AM. Thanks, Om ---------------------- Spoon version -4.4.0 Reply With Quote 08-11-2010,04:54 PM #2 cboyden View Profile View Forum Posts Private Message Pentaho Developer Join Date Mar 2008 Posts 140 Things to try I have never used DB2 and Google says that -407 is a null value going into a column with a not null constraint, so... The three things I would try: 1) Replace "Table output" step with a "Dummy" step and preview it. To see what is coming out of your transformation. 2) Replicate the data using a "Row Generator" step and push data into the table to make sure there is not something strange going on with DB2 and that table. (Maybe the -407 is for something else) 3) Replace the "Table Output" step with another table output step to another database (like mysql) and see if that works. It could be a driver issue or something similar. If nothing else you might find your problem along the way. If you have more info please post it. I hope this helps, -Curtis Reply With Quote 08-12-2010,11:42 AM #3 omm View Pr
Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.