PreviousNext
Help > Easycom .NET > System.Data.EasycomClient namespace > EacCommand > Example 2: call a stored procedure
Example 2: call a stored procedure

 

Into this example, we execute a stored procedure: CR/CUST12.

The CR/CUST12 procedure has been created on IBMi by the following way, by using IBM I Access Client Solution:

 

CREATE PROCEDURE CR.CUST12 ( )

              LANGUAGE SQL

              SPECIFIC CR.CUST8

              NOT DETERMINISTIC

              MODIFIES SQL DATA

              CALLED ON NULL INPUT

              SET OPTION  ALWBLK = *ALLREAD ,

              ALWCPYDTA = *OPTIMIZE ,

              COMMIT = *CHG ,

              DFTRDBCOL = *NONE ,

              DYNDFTCOL = *NO ,

              DYNUSRPRF = *USER ,

              SRTSEQ = *HEX 

              P1 : BEGIN ATOMIC

              UPDATE EASYCOMXMP.SP_CUST SET LASTNAME= 'AURA2' WHERE FIRSTNAME= 'Ted' ;

END P1  ;

 

 

     EacCommand sqlCommand = ConnectionIBM.CreateCommand();

           

            sqlCommand.CommandText = "CR/CUST12";

            sqlCommand.CommandType = CommandType.StoredProcedure;

 

            sqlCommand.Prepare();

           sqlCommand.ExecuteNonQuery();