View BC item from the ref cursor oracle

Is there an easy way to jdev 11.1.1.4 to create a view based on a ref cursor oracle object?

It's in the docs http://docs.oracle.com/cd/E21043_01/web.1111/b31974/bcadvvo.htm#sm0341 search for 'How to create a display on a REF CURSOR object'
An example can be found here http://adfpractice-fedor.blogspot.de/2011/01/adf-bc-programmatically-populated-vo.html

Timo

Tags: Java

Similar Questions

  • How to start the view off of the ref cursor Oracle as input/output param

    Hello world

    We use JDev 11.1.2.3 WL 10.3.6 and Java 7.

    We are at the beginning of our transition from Oracle Forms to ADF.  We have a very large forms that uses many store procedures that have IN/OUT ref Cursor parameters and tables plsql.  I tried to find information on best practices to achieve, but only seemed to find tutorials on SEO of the Oracle ref Cursor return functions.  I hope we don't have to rewrite our code of database to work with ADF.

    This is an example of a proc currently a block on a form based on directly

    The ref cursor parameter is input/output to satisfy the way the form handles this type of paradigm.

    ADF we want I hope to reuse these procs existing (without the need to wrap/overload them) on the basis of the display objects.

    Example:

    / * my record type which houses the information I want to go back * /.

    TYPE rec_hist_vacpac_status IS RECORD)

    rec_order NUMBER (5),

    rec_rownum NUMBER (5),

    return_column SAM_VACPAC.vacpac_status%TYPE,

    rec_login_id SAM_VACPAC.ins_user%TYPE,

    status_date SAM_VACPAC.status_date%TYPE

    );

    / * Sets the ref cursor type * /.

    TYPE lcur_hist_vacpac_status IS REF CURSOR;

    / * This is a procedure that would take some info link go / return

    Return the ref cursor of this information as an in / out * /.

    PROCEDURE prc_myinfo_refcur)

    pnum_identify_seq_id in NUMBERS

    pcur_myinfo IN OUT lcur_hist_vacpac_status);

    Can anyone point me in the right direction on documentation on this?

    Thank you!

    Hi Cemerson:

    See this example:

    1. 1. create a TYPE as an object

    CREATE OR REPLACE

    TYPE GOTYOB_EQUI

    AS AN OBJECT

    (

    CDELEM VARCHAR2 (50).

    TIELEM VARCHAR2 (2)

    );

    1. 2. create a TABLE TYPE AS

    CREATE OR REPLACE

    TYPE GOTYTA_EQUI

    AS THE GOTYOB_EQUI TABLE;

    1. 3 create a function, it returns the TYPE of the TABLE

    FUNCTION fn_equiposarriba)

    pa_cdelem IN VARCHAR2,

    pa_nucomp in NUMBERS

    pa_anperi in NUMBERS

    pa_meperi in NUMBERS

    )

    Gotyta_equi RETURN PIPELINED IS

    CURSOR trae_equimani (va_cdelem VARCHAR2) IS

    SELECT cdelem, tielem, cdelempadr,

    (SELECT cdequi

    Of evm_alim

    WHERE anperi = eq.anperi

    AND meperi = eq.meperi

    AND nucomp = eq.nucomp

    AND cdalim = eq.cdalim) cdalim

    Of evm_equimani eq

    WHERE anperi = pa_anperi

    AND meperi = pa_meperi

    AND nucomp = pa_nucomp

    AND cdelem = va_cdelem

    AND cdelempadr <> cdelem

    AND tielem <> 'A ';

    equimani trae_equimani % ROWTYPE;

    va_cdalim VARCHAR2 (100);

    BEGIN

    -Loading los equipos aguas arriba

    WHILE equimani.cdelempadr IS NOT NULL LOOP

    OPEN trae_equimani (equimani.cdelempadr);

    equimani: = NULL;

    SEEK trae_equimani INTO equimani;

    CLOSE Trae_equimani;

    IF equimani.cdelem IS NOT NULL THEN

    PIPE ROW (gotyob_equi (equimani.cdelem, equimani.tielem));

    END IF;

    END LOOP;

    RETURN;

    END;

    1. 4 SQL Query with the help of the function... you can use this SQL in a display object

    SELECT

    *

    Of

    TABLE (gopq_eventos.fn_equiposarriba (' F-SCZ-043-103', '))

    1,

    2013,

    6

    )

    )

    Best regards, Marcelo

  • Report regions - use of the Ref Cursor?

    APEX 4.2

    See http://mikesmithers.wordpress.com/2012/02/22/getting-apex-to-play-with-ref-cursors

    The above article is older than 2 years. The techniques shown in the link above still valid today if we want to create a report region in the APEX are based on a function that returns a Ref Cursor? Are there improvements in this area for the next APEX 5.0 and/or database Oracle 12 c?

    Thank you

    HELEN wrote:

    APEX 4.2

    See http://mikesmithers.wordpress.com/2012/02/22/getting-apex-to-play-with-ref-cursors

    The above article is older than 2 years. The techniques shown in the link above still valid today if we want to create a report region in the APEX are based on a function that returns a Ref Cursor?

    If the function returns the ref cursor is the only point of access that you have data then Yes, it probably is. If you have direct access to the underlying database objects and the function does not have something very complicated, then you are probably better off creating your own body of the function returning SQL query data source.

    Everything about the dynamics of ref Cursor now I divided in 2 layers, with a function for generating the dynamic SQL and another for bind parameters open the ref cursor. APEX apps can then reuse the functions of SQL query in function body return SQL query data sources (if you take a bit of care to keep the bind variable names vaguely APEX-point-friendly).

    Are there improvements in this area for the next APEX 5.0 and/or database Oracle 12 c?

    See this for the technical background on why APEX is not yet support ref Cursor and this for more information of the Oracle team on the possibility of future support. Obviously, he did not he in 4.1. I suspect that data REF CURSOR region sources depended on a minimum requirement of DB of the 11.1.0.6 (where was introduced support for the conversion of the REF CURSOR in the cursors DBMS_SQL). As minimum DB for APEX 5.0 version is 11.1.0.7, it would be a possible feature for 5.0, but it is not classified as one.

  • Fetch the Ref Cursor several times

    create or replace 
    PROCEDURE refcursor1
    AS
    TYPE r_cursor IS REF CURSOR;
    rcv_emp r_cursor;
    TYPE rec_emp IS record
    (
    empno NUMBER,
    ename VARCHAR2(20 CHAR),
    deptno number
    );
    recv_emp rec_emp;
    recv_emp2 rec_emp;
    -------------------------------------------------------
    PROCEDURE printemployeedetails AS
    BEGIN
      loop
      fetch rcv_emp INTO recv_emp;
      exit WHEN rcv_emp%notfound;
        dbms_output.put_line(recv_emp.empno||'-'||recv_emp.ename||'-'||recv_emp.deptno);
      END loop;
    END;
    -------------------------------------------------------
    PROCEDURE printemployeedetails2(p_emp r_cursor) IS
    BEGIN
      loop
      fetch p_emp INTO recv_emp2;
      exit WHEN p_emp%notfound;
        dbms_output.put_line(recv_emp2.empno||'-'||recv_emp2.ename||'-'||recv_emp2.deptno);
      end loop;
    END;
    -------------------------------------------------------
    BEGIN
      FOR i IN (SELECT deptno FROM dept order by deptno)
      loop
        OPEN rcv_emp FOR SELECT empno,ename,deptno FROM emp WHERE deptno=i.deptno;
        dbms_output.put_line(i.deptno);
        dbms_output.put_line('--------------------');
        dbms_output.put_line('calling printemployeedetails');
        printemployeedetails;
        dbms_output.put_line('                    ');
        dbms_output.put_line('calling printemployeedetails2');
        dbms_output.put_line('                    ');
        printemployeedetails2(rcv_emp);
        CLOSE rcv_emp;
      END loop;
    end;
    

    Output:

    10
    --------------------
    calling printemployeedetails
    7839-KING-10
    7782-CLARK-10
    7934-MILLER-10
                        
    calling printemployeedetails2
                        
    20
    --------------------
    calling printemployeedetails
    7566-JONES-20
    7788-SCOTT-20
    7902-FORD-20
    7369-SMITH-20
    7876-ADAMS-20
                        
    calling printemployeedetails2
                        
    30
    --------------------
    calling printemployeedetails
    7698-BLAKE-30
    7499-ALLEN-30
    7521-WARD-30
    7654-MARTIN-30
    7844-TURNER-30
    7900-JAMES-30
                        
    calling printemployeedetails2
                        
    40
    --------------------
    calling printemployeedetails
                        
    calling printemployeedetails2
                        
    
    

    Hi all

    If I open a cursor once can I collect the elements of a cursor n times as above? I see one of these procedures to print the details, but not both.

    Wonder why that I'm passing same ref cursor to a second procedure.

    It doesn't throw me an error indicating that the elements of the ref cursor is already read.

    Thank you.

    Your condition is not clear. Cursor is a pointer. He points to the result set of your query. At the time wherever you collect once, it advances the pointer to the next line and so on. I wonder if the pointer can return to the previous line once you recovered.

  • Initialize the Ref Cursor to avoid ORA-01001: Invalid cursor

    Hello

    I write a stored procedure that returns a REF CURSOR. However, there are times when the cursor is not open if certain conditions are not met, so I wonder if there is a way to initialize the REF CURSOR so that the appellant does not receive the "ORA-01001: Invalid cursor" error when you try to work with the cursor, if it has not been opened.

    Any help is greatly appreciated...

    Thank you
    Christine

    cad0227 wrote:
    Hello

    I write a stored procedure that returns a REF CURSOR. However, there are times when the cursor is not open if certain conditions are not met, so I wonder if there is a way to initialize the REF CURSOR so that the appellant does not receive the "ORA-01001: Invalid cursor" error when you try to work with the cursor, if it has not been opened.

    Any help is greatly appreciated...

    Thank you
    Christine

    The most appropriate way would be the caller to handle the situation. The caller must capture the exception of INVALID_CURSOR and do what is necessary.

    Other suggestions like having a separate Pavilion or a model select all will lead the appellant to act to the particular situation, that slider is not being opened. What is the case with the exception of INVALID_CURSOR raised by oracle.

    All the need for the appellant to do is manage the exception of INVALID_CURSOR and you should be good. And also INVALID_CURSOR is not a mistake, it's an exception that has a special meaning for her. In the case you sense it takes the condition when not together to return a cursor.

  • What is the difference between the ref cursor and the sys_refcursor.

    create or replace procedure GetEmployeesInDept (c sys_refcursor)

    Hello


    I have a query related to the above stored procedures.
    When you set the cursor, we mentioned as sys_refcursor and in some US sites I saw him as a REF CURSOR as shown

    create or replace procedure GetEmployeesInDept (Ref Cursor c)


    Please tell me what is the difference between the ref cursor and the sys_refcursor.

    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/tuning.htm#sthref2376

    Concerning

    Etbin

  • help how to extract the ref cursor in the table field

    Hello.


    I have a query similar to the following:
    select department_id, cursor (select employee_id from employees where department_id = d.department_id)
      from departments d
    Expecting to get several lines, I want this select this option to be in bulk sampled in a table variable nested (of another type of nested table) which is copied to an out parameter in a procedure. I have some doubts:
    1 should. what I create the column in the inner nested table that will keep the result of the ref cursor? Ref cursor colunm? A sort of column Adrien?
    2. If the column in the nested table inside that will keep the result of the ref cursor is another array, how can I write the result of the entire query in a single volume?

    (I want to bulk collect everything in a single query, I know how to do with pl/sql do not inflate but using two nested for loops, that's what I try to avoid).


    Thanks in advance.

    It would be simpler:

    declare
        type dep_emp_list_tbl_type
          is table of sys.OdciVarchar2List;
        v_dep_emp_list_tbl dep_emp_list_tbl_type;
        v_dep_id_tbl sys.OdciNumberList;
    begin
        select  department_id, cast(multiset(select employee_id from hr.employees where department_id = d.department_id) as sys.OdciVarchar2List)
          bulk collect into v_dep_id_tbl,v_dep_emp_list_tbl
          from hr.departments d;
    end;
    /
    

    SY.

  • How print/store in the ref cursor block pl/sql folder?

    How print/store in the ref cursor block pl/sql folder?

    return to the SQL * the method I showed above:

    SQL> create or replace procedure test (p_refcur out sys_refcursor)
      2  is
      3  begin
      4    open p_refcur for select * from dual union all select * from dual;
      5  end test;
      6  /
    
    Procedure created.
    
    SQL> var r refcursor;
    SQL> begin
      2    test(:r);
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> print r;
    
    D
    -
    X
    X
    
    2 rows selected.
    
  • Is it possible to combine dynamic &amp; static queries in the ref cursor?

    Hi all

    I was wondering if it is possible to combine dynamic & static queries in the ref-cursor?
    CREATE OR REPLACE FUNCTION dynamic_static_kk
       RETURN sys_refcursor
    AS
       o_cursor   sys_refcursor;
    BEGIN
      open 'select 1 fom dual'
           union
           select 2 from dual;
    
       RETURN o_cursor;
    END;
    In the existing code, the two parts of the query are static, but I need to improve & replacement of part would do the trick.

    So, I was wondering if it is possible to keep the static part 2. Of course, do both dynamic parts seems the only possible treatment for me.

    So, I was wondering if it is possible to keep the static part 2.

    No, you can't.

    Of course, do both dynamic parts seems the only possible treatment for me.

    Yes, it's the only way.

  • Automator: using a text file to set several items from the finder?

    Hello

    what I would do:

    I have a text file that contains multiple entries for files and folders, each on a separate line. I want to dragndrop this file on an automator action, he should ask me a destination folder and then copy all the files and folders in this folder.

    I have my action, automator, set up like this:

    Elements of the open Finder

    Get the content of the TextEdit Document

    Copy to the Clipboard (I have not found another way to keep my text sort file values and let it not be crushed by the following, but it works)

    Quit the Application (TextEdit)

    Ask the Finder items (this requires a destination folder)

    Set the value of the Variable (Destination)

    Get the contents of the Clipboard

    Copies the items from the Finder (at Destination)

    It all works, but only when there is 1 entry in my text file. As soon as I have 2 lines of text, I get the following error message:

    The action "copy Finder items" has not provided with the required data.

    How can I make this work with multiple entries?

    The problem is that you only pass the only element to the copy action (you have copied text), instead of an element for each line (paragraph) in the text.  The solution is to use the action filter paragraphs to break up along the borders of paragraph text, which will give you a list of items.  In addition, you do not necessarily have to use TextEdit or the Clipboard - If you already have a file somewhere, you can simply use the action to combine text files to read the text.

    With the above modifications, your workflow should look like:

    Ask the Finder items  (ask for a destination folder)

    Set the value of the Variable  (Destination)

    Ask the Finder items  (Download text files) - set the action to ignore the entry

    Combine text files  (read the text files)

    Filter paragraphs  (paragraphs which are not empty return)

    Copy the items to the Finder  (at Destination)

  • Safari now load of items from the new york times or IRS Web site

    Safari now load of items from the new york times or IRS Web site

    I tried to change the notifications including to get rid of all the

    I encouraged webgl and plug-ins

    In your Safari menu bar, click Safari > Preferences then select the Privacy tab, then click: delete all data Web site

    Quit and then relaunch Safari a try these Web sites.

  • I use Homeshare to watch downloaded movies on my computer and then visible on my TV via Apple TV, but I how remove items from the library of movies on Apple TV when I looked at the

    I use Homeshare to watch movies downloaded on my computer and made visible on my TV via Apple TV. How to remove items from the show announced on television through homeshare /AppleTV when I looked at them?

    You must delete the contents of iTunes on the computer to remove it from the list of content on Apple TV.

  • It is usually safe to remove items from the user / local/temp file? I want to free up space.

    Original title: local/temp folder files

    It is usually safe to remove items from the user / local/temp file?  I want to free up space.

    Clean the system (compensation to all temp/tmp folders and included all the content offline, the tif browser, delete the cookies of compensation.)

    Do a disk cleanup. Click the Start button. in the search box, type Disk Cleanup, and then in the list of results, click Disk Cleanup.

    Delete your temp files where a large number of software malware installers cache and or CCleaner for a more thorough cleaning.

    Download the basic version (slim) via

    http://www.CCleaner.com/download/builds.aspx>

    The basic version (slim) does not contain the toolbar disgusted

    Cleaning DO NOT USE ANY Advanced options. DO NOT TOUCH THE REGISTRY OR TOOLS. At least not for now.
    Reset

    UTC/GMT is 04:20 on Thursday, January 5, 2012

  • Retrieve items from the Recycle Bin?

    OK, so I'm a newbie in this thing whole smartphone?  Just got my Droid X last Friday and always try to understand everything - it's a bit overwhelming!

    I tried to drag something from one home to another screen (easier said than done) and I accidentally threw it in the trash CAN.  (I'm not sure that the app was, but it looked a little like a media player).

    Is it possible to retrieve items from the Recycle Bin?  I can't find any info on the trash anywhere.

    BTW - I tried to go to the application menu and pressing applications to reinstall, but, again, I don't know yet what app it was!

    Thanks for the help!

    BubbaCat wrote:Ok, could have been.  But how do I get it back on the home screen?  I've tried holding down on the screen until the menu pops up, select Motorola Widgets, and then select photo slide show. But it doesn't install a widget on the home screen.  It just takes me into the gallery. Maybe I'm doing something wrong, or maybe there is another way??
    

    No, it's not as intuitive as it could be. You are on the right track. When you enter in your gallery, select an image. Which end the putting in place and he must then take you back to the home screen where your widget must be loaded. Good comments!

  • Windows Live Movie Maker 2011 - how to remove items from the recent projects list

    Windows Live Movie Maker 2011

    I have duplicates on my list of recent projects.

    How to remove items from the numbered list of recent projects?  What are the (thumb)

    bugs used for?  Thank you.

    Hello

    The question you have posted is related to Windows Live Movie Maker and would be better suited in the Windows Live Solution Center. Please visit the link below to find a community that will provide the best support.

    http://www.windowslivehelp.com/product.aspx?ProductID=5

    Amrita M

    Microsoft Answers Support Engineer

Maybe you are looking for