Advertisement

09.03.2008 at 03:16PM PDT, ID: 23700962
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

SQL0117 Error on AS400

Asked by Jeanniem in AS / 400, Programming for iSeries / AS400

Tags:

I am having trouble reading some data from a data file and writing it out to another file using SQL/400.  I am getting the following error message when I "RUNSQLSTM"

SQL0117 30 1  Statement contains wrong number of value

 where 30 is the severity level and 1 is the line number that the error usually occurs on  but line 1 is not helpful to debug this issue.

 The only thing that I can find when I google this error number is the idea that I am trying to insert X number of items into a table with Y columns defined - I have double checked and I don't think this is the case.   I would really appreciate help.  
The SQL reads as follows:  (and is also attached as a word document if you prefer that)


0001.00  CREATE PROCEDURE PDCMNTX                      
0002.00  LANGUAGE SQL                                  
0003.00  MODIFIES SQL DATA                              
0004.00  BEGIN                                          
0005.00  DECLARE HSPV DEC(3,0);                        
0006.00  DECLARE ACCTV DEC(7,0);                        
0007.00  DECLARE CDT DEC(6,0);                          
0008.00  DECLARE CTM DEC(4,0);                          
0009.00  DECLARE ACD CHAR(2);                          
0010.00  DECLARE SHORTTEXT CHAR(30);                    
0011.00  DECLARE SECURTYCD CHAR(4);                    
0012.00  DECLARE LOGNUMV DEC(7,0);                      
0013.00  DECLARE FLUPDT DEC(6,0);                      
0014.00  DECLARE LGNUM DEC(7,0);                        
0015.00  DECLARE CEN DEC(2,0);                          
0016.00  DECLARE CEN2V DEC(2,0);                        
0017.00  DECLARE LONGTXT CHAR(60);                      
0018.00  DECLARE PLANV DEC(2,0);                        
0019.00  DECLARE REPV  CHAR(2);                        
0020.00  DECLARE RQSV DEC(9,0);                                                      
0021.00  DECLARE EOF_COND CHAR(1) DEFAULT '0';                                      
0022.00  DECLARE NOT_FOUND CONDITION FOR SQLSTATE '02000';                          
0023.00  DECLARE SQLSTATE CHAR(5);                                                  
0024.00  DECLARE MSGTEXT CHAR(70);                                                  
0025.00  DECLARE APCEN DEC(2,0);                                                    
0026.00  DECLARE APCTXT CHAR(60);                                                    
0027.00  DECLARE APPLAN DEC(2,0);                                                    
0028.00  DECLARE APPREP CHAR(2);                                                    
0029.00  DECLARE APRQS DEC(9,0);                                                    
0030.00  DECLARE CEN2 DEC(2,0);                                                      
0031.00  DECLARE CSR1 CURSOR FOR                                                    
0032.00    SELECT HSP, ACCT, CMDT, CEN1,CMTM,AC,SHRTXT,FOLUPDT,CEN2,SECCD,LNGTXT,    
0033.00    LOGNUM,PLAN,PREP,RQS#                                                    
0034.00           FROM JEANNIE/COMNT;                                                
0035.00   DECLARE CONTINUE HANDLER FOR NOT_FOUND SET EOF_COND = '1';                
0036.00   OPEN CSR1;                                                                
0037.00   RPT: REPEAT                                                                
0038.00                                                                              
0039.00      FETCH CSR1 INTO HSPV, ACCTV, CDT,CEN,CTM,ACD,SHORTTEXT,FLUPDT,  
0040.00         CEN2V,SECURTYCD,LONGTXT,LOGNUMV,PLANV,REPV,RQSV;                          
0041.00     INSERT INTO TSTBSYDTAT/BSYTAPCN VALUES(HSPV, ACCTV, CDT,CEN,CTM,              
0042.00       ACD,SHORTTEXT,FLUPDT, CEN2V,SECURTYCD,LONGTXT,LOGNUMV,PLANV,REPV,RQSV);    
0043.00   UNTIL EOF_COND = '1'                                                            
0044.00   END REPEAT RPT;                                                                
0045.00                                                                                  
0046.00      CLOSE CSR1;                                                                  
0047.00      END;                                                                        
       

Start Free Trial
Attachments:
 
SQL SOURCE
 
[+][-]09.03.2008 at 03:45PM PDT, ID: 22382760

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 04:00PM PDT, ID: 22382862

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 04:48PM PDT, ID: 22383091

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: AS / 400, Programming for iSeries / AS400
Tags: SQL/400
Sign Up Now!
Solution Provided By: daveslash
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.03.2008 at 04:50PM PDT, ID: 22383103

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 04:55PM PDT, ID: 22383131

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2008 at 04:57PM PDT, ID: 22383148

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628