Print Thread
[D6] Problem with TOraclePackage
#2764 11/16/01 10:37 PM
Joined: Sep 2000
Posts: 9
S
sparis Offline OP
Member
OP Offline
Member
S
Joined: Sep 2000
Posts: 9
With Delphi5 with DOA 3.45 compos (for D5), I'm able to execute the next code:

procedure TForm1.Button1Click(Sender: TObject);
begin
if pkgTest.CallBooleanFunction
('TEST_DOA_INT_RET_BOOL', ['p_int', 0])
then
Edit1.Text := 'True'
else
Edit1.Text := 'False';
end;

But with Delphi6 with DOA 3.45 compos (for D6), I have the message:

Project Project1.exe raised exception class Exception with message
'Byte parameters can only be used for output parameter types'.
Process stopped. Use Step or Run to continue.

If I use the next code, it works:
procedure TForm1.Button1Click(Sender: TObject);
var
wkInt : Integer;
begin
wkInt := 0;
if pkgTest.CallBooleanFunction
('TEST_DOA_INT_RET_BOOL', ['p_int',
wkInt])
then
Edit1.Text := 'True'
else
Edit1.Text := 'False';
end;

Why???

---------------------------------------------
Here it's the code of my package:
CREATE OR REPLACE PACKAGE TEST IS
FUNCTION TEST_DOA_INT_RET_BOOL(p_Int IN PLS_INTEGER) RETURN BOOLEAN;
END TEST;
/

CREATE OR REPLACE PACKAGE BODY TEST AS

FUNCTION TEST_DOA_INT_RET_BOOL(p_Int IN PLS_INTEGER) RETURN BOOLEAN IS
BEGIN
IF p_Int = 0 THEN
RETURN False;
ELSE
RETURN True;
END IF;
END TEST_DOA_INT_RET_BOOL;

END TEST;
/
---------------------------------------------

Re: [D6] Problem with TOraclePackage
#2765 11/19/01 04:52 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
The 0 constant is treated as a Byte in Delphi 6, whereas it was treated as an integer in Delphi 5 and earlier. We will have a Delphi 6 specific patch available shortly. Until then you can use the work around you mentioned.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.084s Queries: 13 (0.038s) Memory: 2.4966 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-05-05 07:41:13 UTC
Valid HTML 5 and Valid CSS