Sunday, February 7, 2021

How to fix invalid character in XML Error in Oracle apps R12

Hi, this post shows how to fix the invalid character in XML data error that may occur sometimes in RDF reports in Oracle apps. To fix the error, follow the below enlisted steps.

1) Run following query to determine the characterset:

select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET'

2) Set profile option FND: NATIVE CLIENT ENCODING to same value as the output of query in step 1.
--FND: NATIVE CLIENT ENCODING for XML data generation

If browser is not responding when loading XML data, recheck RDF then try fetching less data from query. If that works, recheck with all the data.

Cheers!!

Friday, January 29, 2021

Calling a procedure from a function in Oracle apps R12

Hi, this post will give you an idea on how to call a PL/SQL procedure from a PL/SQL function in Oracle apps R12.

In this example, the function named demo_function calls the procedure demo_procedure and returns procedure's output.

Procedure to return a value:
CREATE OR REPLACE PROCEDURE demo_procedure (p_output OUT VARCHAR2)
AS
l_dummy VARCHAR2(20);
BEGIN
SELECT dummy INTO l_dummy FROM dual;
IF l_dummy IS NOT NULL THEN
p_output := 'YES';
ELSE
p_output := 'NO';
END IF;
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line('An unknown exception occurred '||sqlerrm);
END;
/

Checking the output of the demo_procedure:
DECLARE
l_op VARCHAR2(20);
BEGIN
demo_procedure(l_op);
dbms_output.put_line(l_op);
END;
/

Function to call the demo_procedure:
CREATE OR REPLACE FUNCTION demo_function
RETURN VARCHAR2 AS
l_op VARCHAR2(10);
BEGIN
demo_procedure(l_op);
RETURN l_op;
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line('Error in executing procedure demo_procedure '||sqlerrm);
END;
/

Output:
SELECT demo_function FROM dual;

So, this is how a procedure can be called from a function.

Cheers!!

Featured Posts

Sample Real Time Assignment in Oracle SOA