SQLTeam.com | Weblogs | Forums

ODBC Stored Procedure in Oracle

private void OtherStoredProcedure()
{
OdbcConnection conn = new OdbcConnection();
OdbcCommand cmd = new OdbcCommand();
DataSet ds = new DataSet();

        conn.ConnectionString = @"DSN=****;" +
                                "Uid=***" +
                                "Pwd=******;";

        cmd.Connection = conn;
        cmd.CommandType = System.Data.CommandType.Text;
        cmd.CommandText = "DECLARE user_name VARCHAR(250); "
            + "EXEC GETUSERNAME p_userid:=?, l_user_name:=user_name OUT; ";
        cmd.Parameters.Add("p_userid", OdbcType.VarChar).Value = "jdoe";

        OdbcDataAdapter da = new OdbcDataAdapter (cmd);
        da.Fill(ds);
        MessageBox.Show(ds.Tables[0].ToString ());
        conn.Close ();
    }

I get the following error:

{"ERROR [HY000] [Oracle][ODBC][Ora]ORA-06550: line 1, column 50:\nPLS-00103: Encountered the symbol "P_USERID" when expecting one of the following:\n\n := . ( @ % ; not null range default character\nORA-06550: line 1, column 75:\nPLS-00103: Encountered the symbol "=" when expecting one of the following:\n\n in out \n table ... columns long double ref char time timestamp\n interval date binary national character nchar\n"}

This is a Microsoft sql server forum but someone else might be able to help

Thank you for your help