Application Process return output to Javascript
646109Jan 2 2009 — edited Jan 2 2009I am currently work on an APEX application with an attempting to intergrate APEX and AJAX. I have defined a Function to return XML from a function. The function return the correct values. When I attempt to call it from APEX I get get an error regarding it is not a procedure. So I created a procedure that called the function. Can someone please explain how I can get the output from the PL/SQL procedure back to my javascript. Here is the stored proc:
CREATE OR REPLACE PROCEDURE GET_TREEGRID_XMLST IS
results2 CLOB;
BEGIN
--This will return a clob containing XML
SELECT GETRNC_CONFIG_TREEGRID_XML2 into results2 from dual;
-- I get and error here because the contain is more than 32K
-- error ORA-06502: PL/SQL: numeric or value error
htp.prn(results2);
END GET_TREEGRID_XMLST;
/
How can I just return the XML object?
Here is the call from javascript:
var getit = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=GET_TREEGRID_XMLST',0);
alert(getit);
gReturn = getit.get();
-- This produces nothing..... (null)
Can anyone help. To sum everything up:
1. I query a set of table and generate a XML tree and return that in a function call.
2. I want to pass those result back to APEX
3. Display the result in a javascript function
I am using Oracle 10.2.0.4, APEX 3.1.2.