Skip to Content

Import Oracle function problem [BOOLEAN not suported?]

Hello,

I have found a problem while importing an Oracle function.

Te Oracle function is like this:

FUNCTION my_oracle_dummie_function (...) RETURN BOOLEAN

While importing in DATASTORES --> Import by name, the problem found was:

Function <MY_ORACLE_DUMMIE_FUNCTION> could not be imported. Possible causes: (1) The return value of the function is not a Data Services supported data type; (2) The function name is not specified or is not a valid database stored procedure or function name; (3) The function is invalid; it has either compilation or authorization errors; (4) It is not supported by the version of the current repository.

How can I import this function? Is it possible import a function returning BOOLEAN?

Thanks in advance.

Enrique Jim Ruiz

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 30, 2015 at 06:26 PM

    There is no Boolean data type in DS. I would write a wrapper function in Oracle to return 1/0 or 'TRUE'/'FALSE'.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 01, 2015 at 09:28 AM

    Hi Enrique,

    Is your Function working @ the Oracle database level.

    As per my understanding it should not allow you to compile the function and it should return error like ORA-00904: "FALSE": invalid identifier'. Oracle function returns 0 or 1 only

    What you can do is add a conditional if then else logic in the function to return 0 or 1 and when you call the Function in Data services use something like below

    CREATE OR REPLACE FUNCTION func_bool (p_empid IN EMP_DATA.EMP_ID%TYPE)

    RETURN NUMBER

    AS

    l_var NUMBER;

    BEGIN

    SELECT count(*)

    INTO l_var

    FROM EMP_DATA

    WHERE EMP_ID = p_empid;

    IF l_var = 1

    THEN

    RETURN 1;

    ELSE

    RETURN 0;

    END IF;

    END;

    SELECT CASE func_bool(345)

    WHEN 1

    THEN 'TRUE'

    WHEN 0

    THEN 'FALSE'

    END

    FROM DUAL;

    SELECT CASE func_bool(emp_num)

    WHEN 1

    THEN 'TRUE'

    WHEN 0

    THEN 'FALSE'

    END RETURN_CODE

    FROM DUAL;

    Regards

    Arun Sasi


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2015 at 05:07 AM

    Hi Enrique,

    Any update. Did you try to implement the logic

    Regards

    Arun Sasi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.