117 Error Db2
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
Sqlcode=-104
of this site About Us Learn more about Stack Overflow the company Business db2 sql error: sqlcode=-530, sqlstate=23503 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask sqlcode=-206 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: Sign http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n117.html 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 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 http://stackoverflow.com/questions/873828/inserting-a-row-into-db2-from-a-sub-select-null-error 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 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
Programmers For Administrators For DBA Managers PRODUCTS Products Overview TestBase TestBase Slice Batch Healthcare - Attach Facility Batch Healthcare - Attach Facility's MRF Feature Batch Healthcare - Batch Analyzer Batch Healthcare - https://www.softbase.com/error_codes.php Checkpoint Facility Batch Healthcare - Deadlock Advisor SoftDate RESOURCES Resources Overview DB2 SQL http://anuhelps.blogspot.com/2007/04/sqlcode-117.html Error Codes White Papers Case Studies Educational Videos PARTNERS Partners Overview Partner List Becoming a Partner Register a Prospect NEWS News Releases SUPPORT Support Overview Support Login Product Compatibility BLOG Baseline Posts Baseline Videos ABOUT US About SoftBase People Careers Legal Privacy Area Info Contact Info Contact Us Home Resources sql error DB2 SQL Error Codes DB2 SQL Error Codes SQL return codes provided by DB2 UDB for OS/390 and z/OS can be confusing and often reference manuals are not available or close at hand when you really need them. This reference will review SQL return code processing and common SQL error condition codes you may encounter in DB2. SQL Error Code Lookup Retrieving SQL db2 sql error Return Code Information & Messages COBOL programs executing SQL statements communicate with DB2 via a Working Storage area called the SQL Communications Area (SQLCA). When DB2 executes SQL statements, it returns the results of the operation into the SQLCODE and SQLSTATE fields in the SQLCA. SQLCODE provides key information about the success or failure of SQL statement execution. If the SQLWARNO field in the SQLCA contains 'W', DB2 has set at least one of the SQL warning flags (SQLWARN1 through SQLWARNA). These flags provide additional info about execution of specific types of SQL. Prior to DB2 V8, COBOL programs could call a subroutine called DSNTIAR that would convert a SQLCODE in the SQLCA into more a detailed text message with diagnostics about the return code. New with DB2 V8, COBOL programs can now execute a GET DIAGNOSTICS statement that will return all previous SQLCA values and provide additional information about new DB2 V8 extended object names and new SQL functions. The new GET DIAGNOSTICS function replaces existing SQLCA processing now found in most DB2 COBOL programs. GET DIAGNOSTICS also passes a text message about SQLCODE directly to prog
Home Subscribe to: Post Comments (Atom) Blog Archive ► 2009 (5) ► December (1) ► September (1) ► July (3) ► 2008 (4) ► November (1) ► August (2) ► January (1) ▼ 2007 (29) ► December (4) ► November (1) ► October (1) ► August (4) ► July (5) ► June (1) ► May (2) ▼ April (5) SQLCODE = -180 SQLSTATE= 22007 SQLCODE = -117 SQLCODE = -102 DB2: How does DB2 store NULL physically? Common abends ► January (6) ► 2006 (34) ► November (2) ► October (1) ► September (1) ► August (2) ► July (1) ► June (27) About Me Anu This is a civil engineer plunged into Software.. Growing with IBM India since I boarded my professional life View my complete profile