Forum Discussion

CDurkin's avatar
CDurkin
Contributor
13 years ago

Calling a Oracle Stored Proc with a BOOLEAN param

I have been unable to call a Oracle StoredProc with a boolean parameter, without it causing a excepetion.  Try ftBoolean first,  then  adBoolean neither worked.  Then I tried a brute force attempt where I tried ever datatype from 0 to 300.  None would work.



Can anyone help?


var SProc = null, Rtn, Param;

function TEXT_BOOL(value)

//FUNCTION TEXT_BOOL(p_BOOL IN BOOLEAN) RETURN VARCHAR2; 

    if (SProc == null)

    {

        SProc = ADO.CreateADOStoredProc();    

        SProc.ConnectionString = SQLHelper.getConnectionString();

        SProc.ProcedureName = "TEXT_BOOL";

        Rtn = SProc.Parameters.CreateParameter("RETURN_VALUE", DB.ftFixedChar, DB.adParamReturnValue, 1024, null);

        Param = SProc.Parameters.CreateParameter("p_BOOL", DB.ftBoolean, DB.adParamInput, 1024, null);

    }

    Param.Value = value;

    SProc.ExecProc();    

    return Rtn.Value;

}


SProc = , Rtn, Param; TEXT_BOOL(value){  (SProc == )    {        SProc = .CreateADOStoredProc();            SProc.ConnectionString = SQLHelper.getConnectionString();        SProc.ProcedureName = "TEXT_BOOL";        Rtn = SProc.Parameters.CreateParameter("RETURN_VALUE", .ftFixedChar, .adParamReturnValue, 1024, );        Param = SProc.Parameters.CreateParameter("p_BOOL", .ftBoolean, .adParamInput, 1024, );    }    Param.Value = value;    SProc.ExecProc();     Rtn.Value;}

1 Reply

  • This is what I found out...



    "Unfortunately an Oracle Boolean is a special data type that is understood only by Oracle. You would have to evaluate it in PL/SQL and return it as another data type, such as a number."