locked
Extended indicator variable value for item &1 not RRS feed

  • Question

  • I need to connect to  AS400 ISeries using .NetFramework.

    I have installed IBM Client Solutions to bring down the driver needed.

    I am using the Oledbcommand to invoke the procedure/library in JDE.

    SQL state error code is 22010 and native error -363.

    This code is being used by BizTalk and perfectly working for them. I need to replace the BizTalk component with the .Net program. The only difference between BizTalk implementation and my implementation is they are using IBM i Access for Windows software to get the drivers and I am using IBM Client Solutions as IBM I Access for windows is no more supported by IBM. 

    Can some one please help me as this has been an issue for me for the last 2 weeks. I have tried several different ways and non of the steps I have taken worked.

    If I give the incorrect library name or incorrect parameter name/incorrect number of parameters while calling, all these are giving me the errors that I am supposed to. Connection is successfully getting opened, but error is while executing the command. Please let me know if you need any other information

    The IBM site has the error description as follows

    SQL0363 Message Text: Extended indicator variable value for item &1 not valid. Cause Text: The value of the extended indicator variable for item &1 was not within the range of acceptable values. The value must be positive or in the range of 0 to -7 inclusive. Recovery Text: Change the value of the extended indicator variable to one which is allowed for the statement or context in which it was used. Try the request again. SQLCODE or SQLCODEs: -363 SQLSTATE or SQLSTATEs: 22010

    //using (OleDbConnection connection = new OleDbConnection("Provider=IBMDA400.Datasource; User ID=XXX; Password=XXX; Data Source=XXX; "))
                {
                    // set the connection
                        
                        // create an OleDbCommand to execute the stored proc
                        try
                        {

                            connection.Open();

                           string sSQL = "{" + String.Format("CALL {0}.{1} {2}", "JD79999", CompletionOrder_ProgramApplication, BuildSPParmPlaceholder()) + "}";

                  
                          

                          

                            using (OleDbCommand oCommand = new OleDbCommand(sSQL, connection))
                            {
                                oCommand.CommandType = System.Data.CommandType.Text;

                                
                                // populate the parameter list
                                foreach (OleDbParameter par in paramList)
                                {
                                    oCommand.Parameters.Add(par);
                                }
                               
                                // execute the proc and return the number of rows effected
                                int xy = oCommand.ExecuteNonQuery();
                            }
                        }
                        catch (OleDbException ex)
                        {
                        }
                }
            }

    Sunday, June 3, 2018 5:53 PM

All replies

  • I'm not familiar with IBM stuff so I can only answer in regards to how ADO.NET works.

    1. You are specifying a command of text which means your CALL... stuff is a direct database call, not a stored procedure call. Is that correct or do you need to call a stored procedure?

    2. It appears you are trying to pass parameters to the command with your foreach statement. But your command doesn't appear to support any parameters as you're building up a raw query yourself. Are you passing parameters? If so then your command doesn't seem to need them.

    3. On the first line you have commented out the using statement (//). Was that a paste issue or is that line commented out. If it is then where is the connection coming from.

    4. In your catch block dump the entire exception block including the callstack. It may provide more information. Note there may be an inner exception with even more information.


    Michael Taylor http://www.michaeltaylorp3.net

    Monday, June 4, 2018 3:09 PM
  • Look at this page here

    https://www.connectionstrings.com/as-400/

    It also has a link for AS400 connection problems. 

    On the other hand, when you use OleDB, you use Open standards not special for IBM. 
    Your SQL string contains then the name of the SP. 

    However, most of all, please don't show here ostrich programming style with a modern way of resume on error. Beside that you never know what went wrong, it will stop probably anyhow somewhere because of a program overflow. 

    You was certainly made aware that your way of setting parameters is wrong. 

    https://msdn.microsoft.com/en-us/library/system.data.oledb.oledbparametercollection.addwithvalue(v=vs.110).aspx


    Success
    Cor


    Monday, June 4, 2018 3:37 PM
  • Hi SATDOT,

    From your description, the question is more related to third party. you should post the question in IBM Forum. The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Dolen


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 5, 2018 3:17 AM