Skip to content

Issue with BCRYPT_MATCHES.sql returning boolean, resulting in ORA-00902: invalid datatype #1

@locustyo

Description

@locustyo

I encountered while using the BCRYPT_MATCHES.sql function in Oracle version 19c. When executing the following SQL statement:
SELECT BCRYPT_MATCHES(PWD, BCRYPT_PWD) FROM DATABASE ;

I encountered the following error:
[Error] Execution (31: 8): ORA-00902: invalid datatype

To address this issue, I made the following modification to the code:
CREATE OR REPLACE FUNCTION SYSTEM.BCRYPT_MATCHES(p_string VARCHAR2, p_string2 VARCHAR2)
RETURN NUMBER
AS
LANGUAGE JAVA
NAME 'BCryptPasswordEncoder.matches( java.lang.String,java.lang.String ) return java.lang.boolean';

Although it is not entirely accurate Boolean, the modified code is able to produce a result of 1 or 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions