Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using @NamedPLSQLStoredFunctionQuery with boolean IN param, 'SYS.SQLJUTL' not installed(Unable to convert boolean to INT without 'SYS.SQLJUTL' installed !!!)
icon8.gif  Using @NamedPLSQLStoredFunctionQuery with boolean IN param, 'SYS.SQLJUTL' not installed [message #1698568] Tue, 16 June 2015 12:49
Jan Horyna is currently offline Jan HorynaFriend
Messages: 3
Registered: June 2015
Junior Member
Hi,

Environment
- JavaSE 6, Oracle 11, WebSphere 7, eclipseLink 2.5.2

Use case
We'd like to to use
@NamedPLSQLStoredFunctionQuery
like this:

@NamedPLSQLStoredFunctionQuery(name = "convertToString", functionName = "my_schema.my_package.convert_to_string", parameters = { @PLSQLParameter(name = "p_boolean", databaseType = "BOOLEAN") }, returnParameter = @PLSQLParameter(name = "RESULT", databaseType = "VARCHAR_TYPE"))


We execute then the functions like this:

Query query = em.createNamedQuery("convertToString");
        query.setParameter("p_boolean", true);
        Object result = query.getSingleResult();
        System.out.println("result=" + result);


and/or

Query query = em.createNamedQuery("convertToInteger");
        query.setParameter("p_boolean", true);
        Object result = query.getSingleResult();
        System.out.println("result=" + result);


Our Oracle function implementations is as follows:

CREATE OR REPLACE package body my_schema.my_package
as
    /**
    * Converts the given boolean into an integer (true: 1, false: 0).
    * @param p_boolean boolean value to convert to an integer
    */
    function convert_to_integer
    (
        p_boolean   in boolean
    )
        return integer
    is
    begin
        if (p_boolean = true) then
            return isac_api.api_boolean_constants_pg.integer_true;
        end if;

        return isac_api.api_boolean_constants_pg.integer_false;
    end;

    /**
    * Converts the given boolean into a string (true: 'true', false: 'false').
    * @param p_boolean boolean value to convert
    */
    function convert_to_string
    (
        p_boolean   in boolean
    )
        return varchar2
    is
    begin
        if (p_boolean = true) then
            return isac_api.api_boolean_constants_pg.string_true;
        end if;

        return isac_api.api_boolean_constants_pg.string_false;
    end;
end;


It doesn't really work.

Questions

- What is the problem?
- What can we do if we are not allowed to install 'SYS.SQLJUTL' on the database BUT eclipseLink seems to use it for conversions?

Regards
Jan
Previous Topic:CDI injection in an entity listener using Tomcat and Weld doesn't appear to work
Next Topic:EclipseLink 2.6: Authentication issue with MongoDB 3.0.2
Goto Forum:
  


Current Time: Mon Dec 09 17:53:35 GMT 2024

Powered by FUDForum. Page generated in 0.03145 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top