Reputation: 363
I want to use cursor logic inside the data model's script in order to select some data from tables based on different conditions, but I can't do it from the data model's query script also I can't invoke already stored procedure from db, is there any better option to accomplish this
here are options that I have already tried but got some errors:
DECLARE type refcursor is REF CURSOR; xdo_cursor refcursor; BEGIN OPEN :xdo_cursor FOR FOR c IN (select t.* from test t where t.VERSION=2) LOOP FOR d in (select c.* from record d where CONNECT_BY_ISLEAF = 0 start with d.id. = c.id connect by prior d.id = c.id) loop select * test where id=d.id end loop; END LOOP; END;
when i trying to run this i am getting similar errors:
Please share your thoughts/Ideas
Thanks
Upvotes: 0
Views: 939
Reputation: 1954
https://docs.oracle.com/cd/B19306_01/appdev.102/b14289/dcitblfns.htm
If you can get away with just doing select statements with unions and where clause filters, that may be the cleanest way to go.
I'm not sure what the end goal is, but the grouping functionality for templates may help you. There's quite a bit of documentation in the user guides. look for for-each-group
in the guide. It's used to take a single flat series of rows/elements, and then create a hierarchy of them, on the fly.
Upvotes: 1