Error in calling external procedure
From: Lisa Tang <ltang7_at_yahoo.com>
Date: 18 Feb 2004 23:03:46 -0800
Message-ID: <cc133b78.0402182303.30ac160c_at_posting.google.com>
Hi,
RETURN PLS_INTEGER
IS EXTERNAL
Date: 18 Feb 2004 23:03:46 -0800
Message-ID: <cc133b78.0402182303.30ac160c_at_posting.google.com>
Hi,
I am trying to call a C function from PL/SQL and I encounter "ORA-06525 Length Mismatch for CHAR or RAW data". Following is the information:
C function in util.dll:
INT Scramble(BYTE *input,
BYTE *key, INT which, BYTE *output);
I create the library and PL/SQL body using the following script:
CREATE OR REPLACE LIBRARY util
AS
'E:\Develop\test\util.dll';
CREATE OR REPLACE FUNCTION Scramble
(plaintext IN RAW, key IN RAW, which IN PLS_INTEGER, ciphertext IN OUT RAW)
RETURN PLS_INTEGER
IS EXTERNAL
LIBRARY util NAME "Scramble" LANGUAGE C;
When I test the above function Scramble using the following PL/SQL, I receive the error at the beginning of this message.
DECLARE
rvalue PLS_INTEGER;
plaintext RAW(8); key RAW(16); which PLS_INTEGER; ciphertext RAW(8); BEGIN plaintext := '12345678'; key := '1234567812345678'; which := 0;
- SQL error at the following line!!!!!
- "ORA-06525 Length Mismatch for CHAR or RAW data" rvalue := SCRAMBLE(plaintext, key, which, ciphertext); END;
Cheers,
LTANG7
Received on Thu Feb 19 2004 - 08:03:46 CET