Db2 Sql Error 310
on select statement? IBM's flagship relational database management system Post a reply Previous topic • Next topic • 4 posts • Page 1 of 1 SQLCODE -310 on select statement? by fornanthakumar » Tue Jan 04, 2011 7:27 am Hi,I have an query in my application program like below,Select allEXEC SQL SELECT CENTR_NAME_X, CENTR_TYPE_C, HMLN_RGION_N INTO :CENTR-NAME-X, http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/n310.html :CENTR-TYPE-C, :HMLN-RGION-N FROM HMLN.ONLIN_CENTR WHERE CENTR_IBT_N = :DCLHMLN-RGSTN.RGION-IBT-N WITH UR http://www.ibmmainframeforum.com/db2/topic5027.html END-EXEC. both CENTR_IBT_N and DCLHMLN-RGSTN.RGION-IBT-N declared as decimal (5,0) not null. The actual value of DCLHMLN-RGSTN.RGION-IBT-N is 00000.While the program was executing, i have got an ABEND with SQLCODE is -31} (-310). Which is DECIMAL HOST VARIABLE OR PARAMETER number CONTAINS NON-DECIMAL DATA. I was puzzled here because while i execute the same query in spufi like belowSelect allSELECT CENTR_NAME_X, CENTR_TYPE_C, HMLN_RGION_N FROM HMLN.ONLIN_CENTR WHERE CENTR_IBT_N = 00000;I have got an empty result set.Someone please help out on this.? Regards,Nanthu.Y. fornanthakumar Posts: 70Joined: Fri Oct 22, 2010 1:58 pm Hasthanked: 0 time Beenthanked: 0 time Top Re: SQLCODE -310 on select statement? Top Re: SQLCODE -310 on select statement? by dick scherrer » Tue Jan 04, 2011 11:39 am Hello,The literal 00000 is valid - the host variable is not. . .How is this defined and what value is in this variable when the problem occurs? Hope this helps,d.sch. dick scherrer Global moderator Posts: 6308Joined: Sat Jun 09, 2007 8:58 am Hasthanked: 3 times Beenthanked: 90 times Top Re: SQLCODE -310 on select statement? by fornanthakumar » Sat Jan 08, 2011 11:27 pm Hi,Both the predicate CENTR_IBT_N and the host varibale :DCLHMLN-RGSTN.RGION-IBT-N defined as DECIMAL ( 5 , 0). I moved
MainFrame >> DB2 Suggest New Category How to resolve SQL Code -310. The db table feild is http://www.allinterview.com/showanswers/61936/how-to-resolve-sql-code-310-the-db-table-feild-is-declared-as-decimal-7-2.html declared as Decimal(7,2). Question Posted / nitin 2 Answers 19205 Views IBM, Infosys, I also Faced E-Mail Answers Answers were Sorted based on User's Feedback Answer / ashu Check https://sites.google.com/site/indusitfactory/db2-sql-return-codes your program and make sure that the data you are passing to this host variable do not contain NON-DECIMAL value. Is This Answer Correct ? 26 Yes 1 No Answer / db2 sql satty its just like your soc7 error... check your decimal data... whether it is decimal or not Is This Answer Correct ? 0 Yes 8 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 What does the REORG Utility db2 sql error do? 2 Answers What is sqlcode -922 ? 2 Answers how can we retrieve the 100 records of the file ? 2 Answers IBM, What is the FREE command? 1 Answers I am getting a error multiple row fetched while executing a Cobol-DB2 program.How can I solve it without using a cursor. 8 Answers How to handle null values in db2 4 Answers What is a synonym ? 2 Answers What is the purpose of the WHENEVER statement? 1 Answers What's the maximum number of volumes that can be added to a STOGROUP? 1 Answers Q3. How will you fetch duplicate values from a DB2 table? 2 Answers RBS, what is difference between Static call and Dynamic call? How does it function? 1 Answers Syntel, What is a composite index and how does it differ from a multiple index? 1 Answers For more DB2 Interview Questions Click Here Copyright Policy | Terms of Service | Site Map | Contact Us Copyright © 2016 ALLInterview.com. All Rights Reserved.
UTILITIESDB2 Utilities in DB2 verision 9.1DB2/SQL Return CodesFile Status CodesIMS Abend CodesIMS DB/DC Interview QuestionsISPF Commands / TSO CommandsJCL Course ContentsJCL Interview QuestionsMainframe TutorialsPL/I Interview QuestionsSamplesamplesampleadsSQL Error CodesVSAM Interview QuestionsSitemap DB2/SQL Return Codes About Us Services Courses Case Studies Mainframe Forum Mainframe Jobs Contact Us Mainframe Connectivity Tutorials: DB2 Tutorial CICS Tutorial VSAM Tutorial COBOL Tutorials JCL Tutorial Tools: Xpediter for Batch File Aid Tutorial Utilities: JCL Utilities Sort Utility Compile JCL's Abend Codes File Status Codes JCL ABEND Codes CICS ABEND Codes DB2/SQL Return Codes Questions: COBOL FAQ CICS FAQ JCL FAQ VSAM FAQ DB2 FAQ Frequently faced mainframes Errors / Abdends and Complete List follows SQL Return Codes Complete List: SQLCODE +100 SQLSTATE 02000 Row not found or end of cursor SQLCODE -102 String constant is too long SQLCODE -117 The number of values you are trying to INSERT does not match the number of columns SQLCODE -180 SQLSTATE 22007 Bad data in Date/Time/Timestamp String representation of DATE, TIME, TIMESTAMP is invalid SQLCODE -181 SQLSTATE 22007 Bad data in Date/Time/Timestamp Value for DATE, TIME, TIMESTAMP is invalid SQLCODE -199 Illegal use of the specified keyword. SQLCODE -204 Object not defined to DB2 SQLCODE -205 Column name not in specified table SQLCODE -206 Column does not exist in any table in the SELECT SQLCODE -216 You need to use the same number of expressions on both sides of the comparison. when using multiple operands in a comparison, Correct example: WHERE (E.SALARY, E.COMM) IN (SELECT S.PAY, S.COMMISSION Incor