Re: Help! IN BOOLEAN in Call procedure failed

From: Valeri Sorokine <vsorokin_at_dd.ru>
Date: Tue, 28 Mar 2000 14:42:34 +0400
Message-ID: <38E08C9A.461B9B40_at_dd.ru>


Hi Titou,

It seems that BOOLEAN in Java is an one-bit datatype, but in PL/SQL it is one-byte datatype...

At least TRUE in PL/SQL "is no less a value than the number 25" (PL/SQL User's Guide and Reference Release 2.3).

It's why you got 'PLS–00306 wrong number or types of arguments in call to name'

Try to use NUMBER datatype instead of BOOLEAN in your PL/SQL function, if you wish to call it from Java...

Or you can write your own PL/SQL procedure which uses the old one:

create or replace procedure MY_TEST is (data1 IN NUMBER, data2 IN   VARCHAR2, data4 OUT VARCHAR2) is
begin
  IF data1 = 1 THEN
    TEST(TRUE, data2, data4);
  ELSE
    TEST(FALSE, data2, data4);
  END IF;
end;

Hope that helps.

Titou wrote:
>
> Hi,
> I have a problem when i call a procedure with an boolean type.
> My procedure :
>
> create or replace procedure TEST is (data1 IN BOOLEAN, data2 IN
> VARCHAR2,data4 OUT VARCHAR2) is
> begin
> data4 := 'TEST';
> end;
>
> My java code :
> proc = conn.prepareCall("{call TEST(?,?,?)}");
> proc.setBoolean(1,true);
> proc.setString(2,"TEST");
> proc.registerOutParameter(3,java.sql.Types.VARCHAR);
> proc.execute();
> This error code is generated :
> ORA-06550
> PLS-00306
> I'm sure than this problem come with boolean because when i replace by
> String
> in my procedure and java code, it's OK!
> Can you help me on this type boolean?
> Thank's in advance.

-- 
Valeri Sorokine
Oracle Certified Application Developer, Rel.2
ProSoft, Russia, Moscow, Information Systems Division
Phone: +7 (095) 234 0636 ; FAX: +7 (095) 234 0640
E-mail: vsorokin_at_dd.ru   ; http://www.dd.ru
Received on Tue Mar 28 2000 - 12:42:34 CEST

Original text of this message