As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Question: Can WebFocus call an Oracle stored procedure that returns an Oracle NESTED TABLE containing a collection of Oracle RECORDS?
Business Background: We have a business requirement to order the results of a query in a way that is not possible using the ORDER BY clause in the query. The ordering is based on evaluating several attributes of our business objects in a decision tree. The decision tree is implemented as a “comparator” function, and our ordering implementation is based on a bubble sort that calls the “comparator” function.
--Here's a sample script you can run in an SQLNavigator editor to test the procedure.
--Be sure to turn the “Server Output” on. DECLARE
my_inv_table wmgappl.inv_sort.inv_table_type; --The return type is an Oracle NESTED TABLE.
temp_inv_rec wmgappl.inv_sort.inv_rec_type; --The RECORD type that is in the table.
i NUMBER;
tableSize NUMBER;
BEGIN
--Calling the sorting procedure example implementation.
--We need to be able to call this from inside a .fex. (And possibly hold in a HOLD TABLE?)
wmgappl.inv_sort.sort_inv_by_query(
place_holder1=>'x',
v_inv_table=>my_inv_table
);
i:=0;
tableSize:=my_inv_table.COUNT;
WHILE i<tableSize LOOP
i:=i+1;
temp_inv_rec := my_inv_table(i);
DBMS_OUTPUT.put_line('INV_TABLE('||i||'): hlPk='||temp_inv_rec.hl_pk
||', woPk='||temp_inv_rec.wo_pk
||', legNum='||temp_inv_rec.leg_n
||', frTo='||temp_inv_rec.fr_to_x
||', prevHlpk='||temp_inv_rec.prev_hl_pk
||', nextHlpk='||temp_inv_rec.next_hl_pk
||', cmpltDate='||temp_inv_rec.cmplt_t
||', tkId='||temp_inv_rec.tk_id
);
END LOOP;
END;
This message has been edited. Last edited by: Kerry,
This looks like a more involved issue, so the best channel for assistance would be to open a case with Customer Support Services. Please call at 1-800-736-6130, or access online at InfoAssist.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
Posts: 1948 | Location: New York | Registered: November 16, 2004
prodrigu, as far as I now all WebFOCUS expects when querying an Oracle stored procedure is a REF CURSOR it can fetch from, so you'll have to handle this within the stored procedure itself.
One idea that comes to mind would be to assign your NESTED TABLE structure to the "returning" REF CURSOR in your stored procedure.
You'll have to check Oracle's documentation on that for particular details and examples but this is usually the way a collection object is assigned to a cursor in Oracle PL/SQL:
OPEN my_ref_cursor FOR
SELECT * FROM TABLE(CAST(my_collection AS my_collection_type));
Once your data is wrapped by the REF CURSOR, WebFOCUS will just "see" it.
We decide to use a Web Service Call. Now we are using a FILEDEF to call a HTTP Web Service which runs a query in JAVA and sorts it then returns the data in XML. Then we use a XML adapter to convert the XML data into a temp Master Table which then we can TABLE FILE the data out.