How can i get select result in varray

Hi,
I am new in oracle. I have the following sproc it return around 500 records but OCCI takes long time to get all records due to one-by-one records fetch.
TYPE rec_type is record ( f1 integer, f2 integer, f3 integer,f4 integer );
TYPE id_rec_type IS REF CURSOR RETURN rec_type;
PROCEDURE get_s_data (
v_s IN VARCHAR2,
v_p IN INTEGER ,
v_d IN INTEGER ,
o_cd OUT NUMBER ,
o_id OUT id_rec_type ) IS
BEGIN
DECLARE
v_start_date DATE;
BEGIN
select get_start_date(TO_CHAR(SYSDATE,'DD-MON-YYYY') ,-1* v_d ) into v_start_date from dual;
OPEN o_id FOR
SELECT f1 , f2 , f3, f4
FROM T1
WHERE s1 = v_s
AND timestamp >= v_start_date;
END;
I want to convert above sproc in VARRAY/Table to utilize bulk fetch
I am not sure how to convert multicolumns select result in varray.
example in document use only one column in varray from select statement.
some exmple use cursor with bulk fetch but problem is cursor need to define in declare section.
I have one condition in where clause and get calculate in sproc.
any suggestion?

thanks for reply.
It doesn't work with ref cursor as output parameter in sproc.
Please see my post in OCCI forums.
Performance problem with sproc and out parameter ref cursor
after spending some time found one way.
prcedure p1 ( i1 IN integer , i2 IN integer, v1 OUT varray_type )
declare
cursor c1 is
select c1 , c2 , c3 , c4
from t1
where c1 > i1 and c2 > i2;
begin
open c1;
fetch c1 bulk collect into v1;
close c1;
end;
procedure p2 ( v1 OUT varry_type )
declare
i1 integer
i2 integer
begin
i1 := new_calculate_value(i2);
i3 := calculate_s(i2);
p1(i1,i3,v1);
end;
above method allow us to calculate where clause value before cursor define and get filter data.
I am working OCCI to get varray from above method.

Similar Messages

  • [SQL] how can i get this result....??(accumulation distinct count)

    [SQL] how can i get this result....??(accumulation distinct count)
    Hi everybody,
    pls tell me how can it possible to get result?
    ### sample data
    date visitor
    10-01 A
    10-01 A
    10-01 B
    10-01 B
    10-01 C
    10-01 C
    10-02 A
    10-02 C
    10-02 C
    10-02 D
    10-02 D
    10-03 B
    10-03 B
    10-03 B
    10-03 A
    10-03 A
    10-03 F
    10-04 A
    10-04 A
    10-04 F
    result that i want...like this.
    date date_unqiue_visitors acc_date_unique_visitors
    10-01 3 3
    10-02 3 4
    10-03 3 5
    10-04 2 5
    date distinct visitors : count(distinct visitor)
    but how can i get accumulation distinct visitor count???
    Thanks to every body..

    SQL> select dt,cnt,sum(cnt1) over(order by dt) cnt1
      2  from(
      3  select dt,count(distinct visitor) cnt,sum(flg) cnt1
      4  from
      5   (select dt,visitor,(select decode(count(*),0,1,0)
      6                           from test
      7                           where rowid < t.rowid
      8                           and visitor = t.visitor) flg
      9   from test t)
    10  group by dt);
    DT                CNT       CNT1
    10-01               3          3
    10-02               3          4
    10-03               3          5
    10-04               2          5
    Message was edited by:
            jeneesh
    Wrong...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Please Give me reply for this problem(How can I get the result)???

    Hello Friends,
    I have one table CXATCMS.Which has 3 columns and has the following data
    start_no end_no activity_date
    05001000001 05001000002 01-OCT-03
    05001000015 05001000016 01-OCT-03
    05001000017 05001000018 12-JUN-05
    05001000019 05001000020 12-JUL-06
    I have to create a report which lists the the specific range.
    If the next record's start_no is the immediate next number for the prevoius record's
    end_no .....then it has to display all those numbers in a range until it finds a number which is not next immediate number for the previous record's end number.
    like for example....if the user wants to see from 1 to 20 range.
    then the result must be like this........
    start_no end_no
    05001000001 05001000002-------there is no 05001000003 number in the
    05001000015 05001000020 start numbers so it has to stop its range by this number).
    How can i get this result........

    Hi,
    Try this. I am sure you know how to write procedure, I have skipped those obligations, anyway u can sense the absic way of working from here I think. Pls do the uppercase / lowercase adjustment as required by your operating system.
    Declare
    mnd CXATCMS.end_no%type;
    numRec CXATCMS.%rowtype;
    Cursor C is select * from CXATCMS where start_no between 1 and 20 order by start_no;
    begin
    select min(end_no)+1 into mnd from CXATCMS where start_no between 1 and 20;
    open C;
    Loop
    fetch C into numRec;
    DBMS_OUTPUT.putline(numRec);
    exit when mnd<>numrec.start_no;
    if mnd=numrec.start_no then
    mnd:=numRec.end_no + 1;
    end if;
    end loop;
    Exception
    when no_data_found raise application_error;
    end;
    gimme feadback pl,
    Pragati.

  • How can I get required result

    How can I get bellow result...
    For row 1 in Table X: There should be one row in result table.
    For row 2 in Table X: These should be 2 rows one for each package code
    For rows 3 and 4: The X table should be joined with Table Y and create the # of rows depending on the # of Section codes that are in the range of B01M-U01M and B04F-U04F. These are just some sample rows, they code be several rows with the above scenarios in those tables.
    Table X
    Grp_#
    Grp_Name
    Package num
    Product #
    111
    aaa
    123
    PPO
    222
    bbb
    002, 007
    EPO
    333
    ccc
    108-B01M-U01M
    CMM
    444
    ddd
    008, 128-B04F-U04F
    PPO
    Table Y
    ID
    Grp_#
    Pkg_cd
    Section_num
    1
    333
    108
    B01M
    2
    333
    108
    E01M
    3
    333
    108
    U01M
    4
    444
    008
    B04F
    5
    444
    008
    D04F
    6
    444
    008
    M04F
    7
    444
    008
    U04F
    8
    444
    128
    B04F
    9
    444
    128
    C04F
    10
    444
    128
    U04F
    11
    111
    123
    B01E
    12
    222
    002
    B01G
    13
    222
    007
    M04G
    Result Table
    Grp_#
    Grp_Name
    Package num
    111
    aaa
    123
    222
    bbb
    002
    222
    bbb
    007
    333
    ccc
    108-B01M
    333
    ccc
    108-E01M
    333
    ccc
    108-U01M
    444
    ddd
    008-B04F
    444
    ddd
    008-D04F
    444
    ddd
    008-M04F
    444
    ddd
    128-B04F
    444
    ddd
    128-C04F
    444
    ddd
    128-C04F
    444
    ddd
    128-U04F
    Thanks in advance.
    Thanks
    Pathan

    I am very sorry, please ignore this mail..... I have pasted more thread. I am unable to paste table format over here.
    Thanks
    Pathan

  • TS3198 i just unlocked my i phone 4s. how can i get that result?

    i just unlocked my i phone 4s. how can i get that result?

    1# Make sure you have an internet connection in iTunes.
    2# An AT&T Real MicroSIM(not one that has been cut down) must be in the phone.
    3# Restore in iTunes.
    Hope this helps!!

  • How can I get spool result for background mode AFAB

    Dear experts,
    Could you help me? My users run AFAB without run that in test mode. Therefore sometimes I have a difference in ledger (main book) and FI-AA. I am wanting to write coat for AFAB where I am runing programme in test mode and then run that in workering mode. AFAB run in background.
    How can I get result first (test) run from spool? Could you tell me any solutions for that problem?
    Thanks and Best Regards

    You can create one warpper program which can submit the report in the background job with option to send the output to MEMORY. You can use the JOB_OPEN and JOB_CLOSE FMs to schedule a background job.
    Than you can use the FM 'LIST_FROM_MEMORY'  to get the results from the memory.
    Like:
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT report EXPORTING LIST TO MEMORY
                  AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    Regards,
    Naimesh Patel

  • How can I get the result of web forms by mail ????

    Hi,
    please,
    can someone help me, I spent two days looking on internet to know what I need to install on the web server to get the result of web forms and send it by mail.
    I can't find anything and I don't know what I should look for too ?
    Thanks

    Hi,
    thanks for your answer but I was in fact trying to install Formication, I already opened a thread here :
    http://discussions.apple.com/thread.jspa?threadID=841656&tstart=0
    Can you help me with this one ?
    I installed the last release of FormMail and it start to work now but I'm more insterested in "Formication".
    I'm since two days trying to find documentation for this one and I finally decided to write directly to the author as I really can't find anything to install and use it.
    If you know how to install or have any direction to give me it would be really fine.
    Thanks

  • How can I get selection screen values from outside of program?

    Hi. all.
    Now. I'm developing moritoring systems and I have problems. for getting selection screen values in runtime. Is there any function, methods or structure to know this?
    I'd like to get selection screen values while several programs working in runtime and update these values to table to show current system's status and input values for users in real time.
    For example.
    Now. 3 PGMs are working on systems.
    each PGM is ZAAA01, ZAAA02, ZAAA03.
    and ZAAA01 needs input parameter P01, ZAAA02 needs input parameter P02, ZAAA03 needs input parameter P03.
    In this case, I have to know values of P01, P02 and P03.
    The mornitoring systems will show current working status of PGMs(ZAAA01~03)' and these PGMs' input values.
    As fas as I know, the structure 'SCREEN' can be used in each PGM for runtime. Is there any SAP system structure or something else for this purpose?
    I hope your hopeful repsponse.
    Thanks.

    Umm..I need to explain more about this.
    of course I know  SET, GET PARAMETERS.
    But I'd like to minimize coding for each PGM level.
    I have over hundreds PGMs and I have to develop the PGM(including tables and structures) that mornitor
    all of those PGMs on a report in real-time.
    This PGM is kind of  Process Manager.
    First I should know dialogue job PGM and background job that pass parameters using SAP(ABAP) Memory.
    And then I have to update those PGMs' input values via screens into tables in real-time.
    So, I couldn't use SET,GET PARAMETERS for this PGM.
    I want to know methods that can be used for getting information about runtime PGMs' selection screen field values in SAP systems wide.
    Please help me some one knows this.

  • How can i get this result?

    I want to make a menu bar like this:
    http://otn.oracle.com/tech/blaf/specs/tabs_nav/level2_tabs.gif
    Please help me.
    Thanks.

    You want to use a pageLayout with tabs and pageHeader filled with tabBar and globalHeader respectively. You can find information about pageLayout and these other components in the UIX Developer's Guide and the UIX Element Reference, available in JDeveloper's help system or online at: http://otn.oracle.com/jdeveloper/help
    You can also get this by using the wizard to create a UIX page with header, footer and navigation -- it will set this up for you.
    A simple example would be like this:
    <pageLayout>
    <tabs>
    <tabBar>
    <contents>
    <link text="Home" destination="#" />
    <link text="Shop" destination="#" selected="true" />
    <link text="Order History" destination="#" />
    </contents>
    </tabBar>
    </tabs>
    <pageHeader>
    <globalHeader>
    <contents>
    <link text="Catalogs" destination="#" selected="true" />
    <link text="Shopping Lists" destination="#" />
    <link text="Corporate Lists" destination="#" />
    </contents>
    </globalHeader>
    </pageHeader>
    <contents>
    <!-- main body of your page goes here -->
    </contents>
    </pageLayout>

  • How can you get selection info from air html component?

    In Air, I want to be able to have an html component that
    displays an htmltext string. When a button in pressed in the air
    app, I want to add highlight tags to the htmltext string around the
    text that has been selected by the user in the html component.
    The problem is, I have no idea how to get info about what
    text is selected in the html component. The way to get such info
    for other text display components is shown in
    http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_05.html#446003
    but that doesn't seem to work with html components.
    Can anyone point me to anything that shows how to get info
    from the htmlcomponent regarding the selected text?

    iCloud: Restore your iOS device from iCloud
    Note the iCloud backup does not included none iTunes purchases like music from CDs. Also, it does not include any photos synced to the iPod

  • How can I get selected EXCEL area using java script office API (v 1.0)

    Hello everyone,
    I need to get values of specified area in an excel sheet using java Script Office API. For an example,
    A1:A7 row load into array using JS. 

    And you posted to a C++ forum, not a JavaScript or Excel forum.... why? 
    Visual C++ MVP

  • How can i get value when the field name is user's defined

    Hi,
    I have a one java method:
    public ResultSet countUserDb(String id) {
    ResultSet rs = null;
    con = dbcon.connect();
    String queryString = ("select count as count from
    db_allocation where user_id='"+id+"'");
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    When i call it in a jsp file.
    ResultSet counter =db.countUserDb(request.getParameter("id"));
    if(counter.next())
    int x=rs.getInt("count");
    Tomcat said incorrect column name.How can i get the result set when the field name is user's defined.
    Best regards
    Ricky

    You should give the user defined name in the ResultSet.getXXX method to retrieve the column value.
    Example
    SQL:
    Select ename as employeename from emp;
    You should say :
    ResultSet.getString("employeename"); to get the value.
    Alternatively you can retrieve it using column number:
    ResultSet.getString(1);
    Chandar

  • How can i get the value when the field name is user defined

    Hi,
    I have a one java method:
    public ResultSet countUserDb(String id) {
    ResultSet rs = null;
    con = dbcon.connect();
    String queryString = ("select count(*) as count from
    db_allocation where user_id='"+id+"'");
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    When i call it in a jsp file.
    ResultSet counter =db.countUserDb(request.getParameter("id"));
    if(counter.next())
    int x=rs.getInt("count");
    Tomcat said incorrect column name.How can i get the result set when the field name is user's defined.
    Best regards
    Ricky

    Hi Ricky
    To access pseudo columns you can specify an alias or use the index on the column (e.g. getInt(1)).
    Chris
    NB: you should use bind variables instead of concatenating the id to the SQL statement.

  • How can i display the result of java class in InputText ?

    Hi all,
    How can i get the result of java class to InputText Or OutputText ???
    also can every one in the forum give me road map for dealing with java in oracle adf because i'm beginner in oracle adf
    i saw some samples in oracle adf corner but it's difficult for me.

    User,
    Always mention your JDev version, technologies used and clear usecase description (read through this announcement : https://forums.oracle.com/forums/ann.jspa?annID=56)
    How can i get the result of java class to InputText Or OutputText ???Can you elaborate on your requirement? Do you mean the return value of a method in a class as output text? Or an attribute in your class (bean?) as text field?
    -Arun

  • How can i get the external Sql result return data to abap?

    Dear All
             I have a problem to how to get the select  result data return abap.
    I used abap to run external SQL server. below is my code:
    ***in above ,abap has already connected external SQL.
    Sql = u2018select * from user01u2019
          CALL METHOD OF rec 'Open'
            EXPORTING #1 = sql
            #2 = con
            #3 = '1'.
          IF NOT sy-subrc = 0.
            MESSAGE e000 WITH 'run external sql error!'.
          ENDIF.
    ***now ,below code how can I get the select result to abap code?
    I know I can use native_sql  such as u2018OPEN CUR1 FOR SELECT * FROM user01 AND FETCH NEXT CUR1 INTO :WAu2019.
        Thanks for all
    Sun

    Thanks.
    it is okay now by myself.
    con_str = 'Provider=SQLOLEDB.1;Password=pwd;Persist Security Info=True;User ID=name;Initial Catalog=VTL_DEMO;Data Source=192.168.21.50'.
      CREATE OBJECT o_conn 'ADODB.Connection'.
      CREATE OBJECT o_rec 'ADODB.Recordset'.
      SET PROPERTY OF o_conn 'Provider' = provider.
      SET PROPERTY OF o_conn 'ConnectionString' = con_str.
      CALL METHOD OF o_conn 'Open'.
      sql_str = 'select *  from userh'.
      CALL METHOD OF o_conn 'Execute' = o_recordset
        EXPORTING
        #1 = sql_str.
       #2 = o_conn.
      GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      REFRESH itab.
      WHILE rs_eof NE 1.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 0.
        GET PROPERTY OF o_field 'Value' = itab-name.
        CALL METHOD OF o_recordset 'fields' = o_field
          EXPORTING
          #1 = 1.
        GET PROPERTY OF o_field 'Value' =  itab-cid.
        APPEND itab.
        CALL METHOD OF o_recordset 'MoveNext'.
        GET PROPERTY OF o_recordset 'EOF' = rs_eof.
      ENDWHILE.

Maybe you are looking for

  • HT1476 how do i fix my Ipod touch 4th gen when its not charging?

    No cable is working and i think it has something to do with my Ipod and not the charger.what do i do?

  • Cant resolve the host name in mac

    cant resolve your hostname then do the following work around: sudo vi /private/etc/hosts create the entry with IP and hostname ....no need of domain..

  • How to remove the "notch" from the light theme?

    Hello! I'm trying to remove the "notch" from the light standard theme of the lightTopLevelNavigationiView but it doesn't work. Setting the width of the element to size 0 doesn't work either. Has anyone a solution how to remove this notch?

  • How to create db instance and instance in another node?

    Hi, I have installed CRS and created database in node 1(rac1.domain.com).DB instance and ASM instances are running fine in NODE1. how to acceess database from NODE2(rac2.domain.com). CRS installed in NODE2. Thanks,

  • Status QM* for a work order from FM: STATUS_READ_MULTI.

    Hi All We are calling the function module CALL FUNCTION 'STATUS_READ_MULTI'      EXPORTING        client                     = sy-mandt        only_active                = 'X'        all_in_buffer              = 'X' *     GET_CHANGE_DOCUMENTS       =