如何BOOLEAN
在 12c 中传递给 Oracle 程序?
听说在12c之前是不可能的,但是我在12c还是做不到。
// https://docs.oracle.com/cd/A91202_01/901_doc/appdev.901/a89852/d_metad8.htm
// PROCEDURE set_transform_param (
// transform_handle IN NUMBER,
// name IN VARCHAR2,
// value IN BOOLEAN DEFAULT TRUE,
// object_type IN VARCHAR2 DEFAULT NULL);
var cmd = new OracleCommand();
cmd.Connection = new OracleConnection(this.scon);
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "DBMS_METADATA.SET_TRANSFORM_PARAM";
cmd.BindByName = true;
cmd.Parameters.Add("transform_handle", OracleDbType.Int64).Value = -1;
cmd.Parameters.Add("name", OracleDbType.Varchar2).Value = "STORAGE";
cmd.Parameters.Add("value", "N");
cmd.Connection.Open();
cmd.ExecuteNonQuery();
我尝试了以下方法,但出现错误。
"0", "F", "N", '0', 'F', 'N'
错误:
ORA-31600: invalid input value "0" for parameter STORAGE in function SET_TRANSFORM_PARAM
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA_INT", line 8680
ORA-06512: at "SYS.DBMS_METADATA_INT", line 10027
ORA-06512: at "SYS.DBMS_METADATA", line 7458
ORA-06512: at line 1