none
return the value of an integer parameter from an oracle procedure in c# RRS feed

  • Question

  • Dear all,
    I need a help to the following  issue

    this is a part of my code

     cmd.CommandText =String.Format(
                          "DECLARE  \r" +
                              "v1 integer;\r" + 
                            "BEGIN \r" +
                          "\r"+
                                "UPDATE CUSTOMERS \r" +
                                "set SAPUID  = {0}, \r"+
                                "CUSTOMERNAME = {2}, \r"+
                           "where  CUSTOMERCODE = {1};  \r"+
                         "if  SQL%NOTFOUND THEN \r" +
                            "INSERT INTO \r" +
                            "CUSTOMERS (SAPUID, \r" +
                                       "CUSTOMERCODE, \r" +
                                       "CUSTOMERNAME, \r" +
                            "VALUES  ( {0},{1},{2});\r" +
                           "v1:= 1;\r" +
                                  "else\r" +
                "v1:= 0;\r" + 
                               "END IF; \r" +
                             "END;"
                              , adDBUtils.DBCNum(r[0])
                             , adDBUtils.DBCNum(r[1])
                              , adDBUtils.DBCNum(r[2])
                             , adDBUtils.DBCNum(r[3])

                           );
             int rval = (int)cmd.ExecuteNonQuery();  


    what i want is to read the return value of v1
    in order to use it later  in if clause  like if v1 =0 .... else ....


    please help
    thanks in  Advance!


    Thursday, December 11, 2008 3:46 PM

All replies