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 sqlerrmc=tbspaceid=2 or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x db2 sql error sqlcode=-407 sqlstate=23502 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 sqlcode=-407 sqlstate=23502 only 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 sqlcode 407 another 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
Db2 Sql Error Sqlcode 407 Sqlstate 23502
following 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.4k2173120 +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 E
360 games PC games
Db2 Sql Error Codes
Windows games Windows phone games Entertainment All Entertainment db2 sql error sqlcode 440 sqlstate 42884 Movies & TV Music Business & Education Business Students & educators db2 sql error sqlcode list 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
New Topic programming forums Java Java JSRs Mobile Certification Databases https://coderanch.com/t/305350/JDBC/databases/SQL-Error Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: JDBC and Relational Databases On SQL Error 407 Deena https://bugzilla.redhat.com/show_bug.cgi?id=1030407 Raj Greenhorn Posts: 7 posted 9 years ago I am getting SQLException with error code 407 when trying to insert value to a db2 sql table. I do not know the values in the insert query (it is in the production environment) so I cant figure out value which is null. The exception trace is : DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=9, TABLEID=5, COLNO=24. From this statement can i db2 sql error find out the column which is causing the issue (the column which is null). Does COLNO=24 indicate that the 24th column in the insert query was null? Jan Cumps Bartender Posts: 2602 13 I like... posted 9 years ago In general, this error does indeed indicate that column #24 was null, but needs a value. It can also be caused by a known program error. Regards, Jan OCUP UML fundamental and ITIL foundation Post Reply Bookmark Topic Watch Topic New Topic Similar Threads Hibernate mapping no good? SQL Error!! Hibernate: Default Binding of database field insert data into 2 tables using HQL problem with SQL query.... All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter Contact Us | advertise | mobile view | Powered by JForum | Copyright © 1998-2016 Paul Wheaton
[x] | Forgot Password Login: [x] Format For Printing -XML -Clone This Bug -Last Comment First Last Prev Next This bug is not in your last search results. Bug1030407 - SqlIntegrityConstraintViolationException when duplicating workspace on IBM DB2 9.7 Summary: SqlIntegrityConstraintViolationException when duplicating workspace on IBM DB... Status: CLOSED CURRENTRELEASE Aliases: None Product: JBoss BPMS Platform 6 Classification: JBoss Component: BAM (Show other bugs) Sub Component: --- Version: 6.0.0 Hardware: Unspecified Unspecified Priority medium Severity high TargetMilestone: ER6 TargetRelease: 6.0.0 Assigned To: Roger MartÃnez QA Contact: Jan Hrcek Docs Contact: URL: Whiteboard: Keywords: Depends On: Blocks: Show dependency tree /graph Reported: 2013-11-14 06:31 EST by Jan Hrcek Modified: 2014-08-06 16:10 EDT (History) CC List: 1 user (show) pzapataf See Also: Fixed In Version: Doc Type: Bug Fix Doc Text: Story Points: --- Clone Of: Environment: Last Closed: 2014-08-06 16:10:29 EDT Type: Bug Regression: --- Mount Type: --- Documentation: --- CRM: Verified Versions: Category: --- oVirt Team: --- RHEL 7.3 requirements from Atomic Host: Cloudforms Team: --- Attachments (Terms of Use) Server log with UNEXPECTED ERROR (102.19 KB, text/x-log) 2013-11-14 06:31 EST, Jan Hrcek no flags Details Add an attachment (proposed patch, testcase, etc.) Groups: None (edit) Description Jan Hrcek 2013-11-14 06:31:10 EST Created attachment 823893 [details] Server log with UNEXPECTED ERROR Description of problem: When you try to duplicate workspace there is an unexpected error and the workspace is not duplicated. Version-Release number of selected component (if applicable): BPMS 6.0.0 ER4 IBM DB2 9.7 configured as datasource How reproducible: Always Steps to Reproduce: 1. Login with admin user and navigate to workspace Showcase 2. In administration bar click 'Duplicate workspace' Actual results: Unexpected error dialog appears. The exception is com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502,