Using boolean DbType in OracleCommand

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
rishi_invar
Posts: 1
Joined: Tue 30 Sep 2008 11:18

Using boolean DbType in OracleCommand

Post by rishi_invar » Tue 30 Sep 2008 12:02

Hi,

I am trying to execute a stored procedure using an OracleCommand, the stored procedure is as follows:

create or replace
PROCEDURE "INSERT_CUSTOMTABLEMETADATA"
(
"TABLENAME" IN VARCHAR2,
"TABLETYPE" IN VARCHAR2,
"COLUMNNAME" IN VARCHAR2,
"SEQUENCE" IN NUMBER,
"SYSTEMCOLUMN" IN NUMBER,
"DATATYPE" IN VARCHAR2,
"REQUIRED" IN NUMBER,
"PARAMETER1" IN VARCHAR2,
"PARAMETER2" IN VARCHAR2,
"PARAMETER3" IN VARCHAR2,
"PARAMETER4" IN VARCHAR2,
"PARAMETER5" IN VARCHAR2,
"SELECTIONTYPE" IN VARCHAR2,
"ID" OUT NUMBER
) AS
BEGIN
INSERT INTO "CUSTOMTABLEMETADATA"(
"TABLENAME",
"TABLETYPE",
"COLUMNNAME",
"SEQUENCE",
"SYSTEMCOLUMN",
"DATATYPE",
"REQUIRED",
"PARAMETER1",
"PARAMETER2",
"PARAMETER3",
"PARAMETER4",
"PARAMETER5",
"SELECTIONTYPE"
) VALUES
(
"TABLENAME",
"TABLETYPE",
"COLUMNNAME",
"SEQUENCE",
"SYSTEMCOLUMN",
"DATATYPE",
"REQUIRED",
"PARAMETER1",
"PARAMETER2",
"PARAMETER3",
"PARAMETER4",
"PARAMETER5",
"SELECTIONTYPE"
) RETURNING ID INTO "ID";
END;

The REQUIRED column is of type Number(1,0).

I create an OracleCommand to call this procedure for the "REQUIRED" parameter I set it as a boolean DBType with a boolean value. Then on executing the command I get the following error:

PLS-00306: wrong number or types of arguments in call to 'INSERT_CUSTOMTABLEMETADATA'

I have tried to use the ParameterCheck option and this results in the same error.

Is there no automatic conversion of boolean dbtypes to their correct database equivalent.

Any help regarding this issue would be much appreciated.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 02 Oct 2008 16:27

The OracleDbType.Boolean parameter type is used for support of stored procedures with PL/SQL BOOLEAN parameter. Therefore, we recommend you to follow one of these ways:
1. To use OracleDbType.Number.
2. To create procedure with BOOLEAN parameter.
3. To type manually the function call in CommandText explicitly:
BEGIN insert_customtablemetadata(:ID, :REQUIRED);END;

Post Reply