How to get the record set into array?

Hi,
I want to get the record set into array in the procedure and do the processing of the array later in procedure.
below is the stored procedure i am working on:
procedure bulk_delete_group(p_group_id in Array_GroupListID) as
begin
for i in p_group_id.first..p_group_id.last loop
--Here I have to get the list of user id before deleting group
SELECT user_id into *<SOME ARRAY>* FROM group_members WHERE group_id = p_group_id(i);
DELETE group WHERE group_id = p_group_id(i);
--Process the user id array after group deletion..
end loop;
end bulk_delete_group;
Thanks in advance
Aditya

Something like this ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.20
satyaki>
satyaki>
satyaki>select * from emp;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
      7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       7000                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
13 rows selected.
Elapsed: 00:00:02.37
satyaki>
satyaki>create type np is table of number;
  2  /
Type created.
Elapsed: 00:00:03.32
satyaki>
satyaki>Create or Replace Procedure myProc(myArray np)
  2  is
  3    i   number(10);  
  4    rec emp%rowtype;  
  5  Begin  
  6    for i in 1..myArray.count
  7    loop  
  8      select *  
  9      into rec 
10      from emp 
11      where empno = myArray(i); 
12     
13      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename); 
14    end loop; 
15  End myProc;
16  /
Procedure created.
Elapsed: 00:00:00.88
satyaki>
satyaki>
satyaki>declare
  2    v np:=np(9999,7777);  
  3  begin  
  4    myProc(v);  
  5  end;
  6  /
Employee No:9999 Name:SATYAKI
Employee No:7777 Name:SOURAV
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.30
satyaki>Regards.
Satyaki De.

Similar Messages

  • How to get the records which has a specified x/y coordinates

    Hi,
    How to get the records which has a specified x/y coordinates. I have a table which has street data. And another table has a point data. Now I just want to get the records from street data which includes the points in the point data table. Can any one give your suggestions
    Thanks and Regards
    Aravindan

    Aravinda,
    If you want to find the line segments which intersect the given
    set of points, you can do that with SDO_RELATE.
    siva

  • How to get the records of the particluar day when delta laod failed (Urgent

    Hello  BW Gurus,
    We are  facing one serious issue. Here is the scenario.
    1st time the Delta was init and for next consective two  loads delta ran sucessfully... then next time delta got failed and the status is in red..... even though system started next delta loading and it has fetched the records and status is in green but not activated ,,,,,its happening  still past one month so almost there are 20 requests which are to be get activatetd.
    How to resolve this issue.
    <b>And how to get the records of the partilcular day when the delta got failed.
    </b>
    Anyone have come across with this strange issue then help me out and i will rewarrd the points.
    Urs,
    Raki.

    Hi
    Can you provide more details about your extractor and data targets.
    Are you loading delta to an ODS ??
    If you are loading to an ODS, The only solution i can see is to get the missing delta records via FULL UPDATE. Because if you delete the error request from ODS it will also delete the 20 successful requests above it.
    Cheers
    Praveen
    null

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • How to get the result set in batches

    I have a query which results into large data. This data i want to display in a group of 20. After every 20 records i want to add header and footer to it.
    Is it possible to get the result set data into batch of 20 ? means can i specify start and end index of query ?
    regards
    Manisha

    What I am saying is that a big query with lots of
    joins will probably be slow, and as such would be a
    ripe candidate for batching the responses, if it were
    not possible to speed/optimize it. Batching is nice
    to look at for the user, but is not a solution for
    performance problems. In essence it is irrelevant
    that it adds a little performance deficit, as it
    appears to be running a lot quicker, and gives more
    feedback to the user.Then let me say it again....
    - "Join" is a term that applies to a method of doing queries in the database....
    - Query 1 which uses a join and returns 15 rows
    - Query 2 which does not use a join and returns 1500 rows.
    Given the above then Query 1 will provide better overall performance for the system than Query 2 in a properly configured database.
    If it doesn't then the database is not set up correctly.
    And again this will be irrespective of whether the query is scrollable or not.

  • How to get the tag name into javascript

    Hi,
    Is there any way to get the tag name into java script when user clicks on.
    For eg: if i use netui:anchor tag, how can I pass the tag id to the javascript when user clicks on the link using onClick attribute. This tag id needs to be evaluated at run time.
    Ex code is given below.
    function fun1(){
    // how to get the tag name;
    <%
    String st="hai";
    %>
    <netui:anchor action="x" onClick="fun1()" tagId="<%=st%>>
    I want to get this tagId (st) to the java script function fun1() when user clicks on this link. How can I do that. can you please help in this issue.
    Thanks,
    Satish.

    Hi,
    You can set the java variable as a js variable at run time:
    <script>
    var anchorName = <%=getNetuiTagName%>;
    function fun1()
    var anchorID = getNetuiTagName(anchorName);
    alert(anchorID);// this will show the rendered ID for the anchor specified
    </script>
    this works because the jsp variable will be rendered before the js.
    Thanks,
    Steve

  • How to get the section value into configurator developer page

    Hi,
    I am working on configurator developer, Can I get the section value into the configurator developer page by any setup. If possible means please help me on that.
    Thanks advance,
    Gopi

    I thought the same.Thanks for confirming...I tried with loop approach.but i am unable to get decimal part...
    eg if my values are 12.25 and 123.12....my below code ignores decimal points..i know since i am using Number, it is happening..but could you please let me know how can i get decimal values also..
    OAViewObject vo = (OAViewObject) am.findViewObject("XXXXInvDistributionsVO1");
    vo.first();
    Number grossamount = 0;
    for (int i=0;i< vo.getRowCount();i++) {
    // BigDecimal grossamount1 = new BigDecimal((vo.getRowAtRangeIndex(i).getAttribute("Amount")));
    grossamount = ((oracle.jbo.domain.Number)vo.getRowAtRangeIndex(i).getAttribute("Amount")).intValue();
    System.out.println("grossamount "+grossamount); // it ignores and prints decimal points
    BigDecimal grossamount1 = new BigDecimal(grossamount.intValue());
    System.out.println("grossamount1 "+grossamount1); // it ignores and prints decimal points
    vo.next();
    Thanks
    Raj

  • How To Get The Smart Form Into The PDF File

    Hello Friends,
    Can Any One Tell How To Get Smart Form in PDF.
    I used this RSTXPDFT4 Program.
    It is asking The Spool Number.
    How to get the Spool Number.

    the steps are
    SmartForms Output to PDF
    There is a way to download smartform in PDF format.
    Please do the following:
    1. Print the smartform to the spool.
    2. Note the spool number.
    3. Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4 and entering the
    noted spool number.
    how  to get spool number
    The simplest method is to read the spool table directly, table TSP01
    example code
    REPORT zsuresh_test.
    * Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    * Internal tables declaration
    * Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    * Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    * Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    * This function module call is used to retrieve the name of the Function
    * module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    * VARIANT = ' '
    * DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Calling the SMARTFORM using the function module retrieved above
    * GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    * format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
                                                        " for print preview
    w_cparam-getotf = 'X'.
    * Printer name to be used is provided in the export parameter
    * OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    * ARCHIVE_INDEX =
    * ARCHIVE_INDEX_TAB =
    * ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    * MAIL_APPL_OBJ =
    * MAIL_RECIPIENT =
    * MAIL_SENDER =
    output_options = w_outoptions
    * USER_SETTINGS = 'X'
    IMPORTING
    * DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    * JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    t_otf[] = t_otf_from_fm-otfdata[].
    * Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    * ARCHIVE_INDEX = ' '
    * COPYNUMBER = 0
    * ASCII_BIDI_VIS2LOG = ' '
    * PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    * BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    * EXPORTING
    * WINDOW_TITLE =
    * DEFAULT_EXTENSION =
    * DEFAULT_FILE_NAME =
    * FILE_FILTER =
    * INITIAL_DIRECTORY =
    * WITH_ENCODING =
    * PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    * USER_ACTION =
    * FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    * presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    * APPEND = ' '
    * WRITE_FIELD_SEPARATOR = ' '
    * HEADER = '00'
    * TRUNC_TRAILING_BLANKS = ' '
    * WRITE_LF = 'X'
    * COL_SELECT = ' '
    * COL_SELECT_MASK = ' '
    * DAT_MODE = ' '
    * CONFIRM_OVERWRITE = ' '
    * NO_AUTH_CHECK = ' '
    * CODEPAGE = ' '
    * IGNORE_CERR = ABAP_TRUE
    * REPLACEMENT = '#'
    * WRITE_BOM = ' '
    * TRUNC_TRAILING_BLANKS_EOL = 'X'
    * WK1_N_FORMAT = ' '
    * WK1_N_SIZE = ' '
    * WK1_T_FORMAT = ' '
    * WK1_T_SIZE = ' '
    * IMPORTING
    * FILELENGTH =
    tables
    data_tab = T_pdf_tab
    * FIELDNAMES =
    * EXCEPTIONS
    * FILE_WRITE_ERROR = 1
    * NO_BATCH = 2
    * GUI_REFUSE_FILETRANSFER = 3
    * INVALID_TYPE = 4
    * NO_AUTHORITY = 5
    * UNKNOWN_ERROR = 6
    * HEADER_NOT_ALLOWED = 7
    * SEPARATOR_NOT_ALLOWED = 8
    * FILESIZE_NOT_ALLOWED = 9
    * HEADER_TOO_LONG = 10
    * DP_ERROR_CREATE = 11
    * DP_ERROR_SEND = 12
    * DP_ERROR_WRITE = 13
    * UNKNOWN_DP_ERROR = 14
    * ACCESS_DENIED = 15
    * DP_OUT_OF_MEMORY = 16
    * DISK_FULL = 17
    * DP_TIMEOUT = 18
    * FILE_NOT_FOUND = 19
    * DATAPROVIDER_EXCEPTION = 20
    * CONTROL_FLUSH_ERROR = 21
    * OTHERS = 22
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Do reward if helpful
    Edited by: sharad narayan on Apr 4, 2008 2:14 PM
    Edited by: sharad narayan on Apr 4, 2008 2:18 PM

  • How to get the record count printed for the report in the Dashboards

    Hi,
    I would like to get the record count printed at the bottom of every dashboard report like:
    < 1 - 25 of 6300 > instead of < 1 - 25 >
    Any help is appreciated
    Regards
    B

    I have tried the following formula which identifies the lowest grain but it does not seem to give me correct result.. I am not getting the correct count. I am getting as 3.A work order can be updated only once at one point of time.hence the formula
    MAX(RCOUNT(CAST("SR Wo Fact"."Crm Wo Number" AS CHAR) ||CAST("SR Wo Fact"."PSC Timestamp" as char)))
    I tried only MAX(RCOUNT(1)), but I was able to get the record count as corect for Administrator but not for other users.
    Has anyone come across this scenario.
    Thanks Shravan
    Edited by: 786443 on Aug 19, 2010 10:22 AM

  • How to get the record of remote client ?

    Hi, all
    I has published front panel of a VI by using web publishing tool. I want to record the ip who has logined the page,and when does it login and log out. I know there is function in Web publishing tool to log the data into a file called'www'. But i dont want this one. I just want to log the data by writting another program Any one can give me idea about it? THANKS

    barry,
    It seems as if you can get the info you need if you poll the Connections output of the Remote Panel Client Connections method (that is, call that method repeatedly and keep track of the way the output changes between successive calls).
    When someone connects, you should see a new element/IP in the Connections array. When that person disconnects, you should be able to detect that his/her IP is no longer in the Connections array. It'll take a little bit over coding overhead, but if you want to build custom logging logic, it seems as if you have all the data you need.
    If this is still not on target, feel free to follow up with another reply.
    Regards,
    John

  • How to Get the Current data into Planning Layout from the Planning cube

    Hi,
    I have a problem in BPS.   I am selecting the data from cube based on Month org details but I want to see the latest data.   How can i get this data into planning cube.
    Like
    data
    Tran           cal month            org               amt
    1                 jan                        a                  100
    1                 feb                        a                   200
    if i want to read based on Tran org as input values I shoud get the below data but I am getting the previous data.   
    Tran           cal month            org               amt
    1                 feb                        a                   200
    Kindly help me in this regard
    Thanks
    Naveen

    Naveen,
        Are yo having issue when you save something in the layout, the data doesn't appear in the listcube ? Or do you have issue that the latest data you see in the cube doesn't appear in the layout ?
    For the former issue, please look at your selections of listcube and for the second issue, please check your planning level definition, make sure all the restrictions you have applied are valid for this latest data to be presented in the layout.
    Hope this helps.
    Cheers
    Srini

  • How to get the variable set by c:set in Scriptlet ?

    Hello,
    I set up some variables by <c:set> and struts tag <bean:size>, and the values should be considered as integers. How can I use the variables in math expression?
    When I try to use the variables in scriptlets, I got compile errors in the getAttribute lines.
    My code:
    <bean:size id="listSize" name="list" /> <c:set var="pageSize" value="${20}" />
    <c:set var="pageBegin" value="${param.pageBegin}" />
    <%
    int ls = (Integer)pageContext.getAttribute("listSize");
    int ps = (Integer)pageContext.getAttribute("pageSize");
    int totalPages = (int)Math.ceil((double)ls / ps);
    %>

    xiaoxuan_li wrote:Hello,
    I set up some variables by <c:set> and struts tag <bean:size>, and the values should be considered as integers. How can I use the variables in math expression?
    When I try to use the variables in scriptlets, I got compile errors in the getAttribute lines.
    My code:
    <bean:size id="listSize" name="list" />
    <c:set var="pageSize" value="${20}" />
    <c:set var="pageBegin" value="${param.pageBegin}" />
    <%
    bq. int ls = (Integer)pageContext.getAttribute("listSize"); \\ int ps = (Integer)pageContext.getAttribute("pageSize"); \\ int totalPages = (int)Math.ceil((double)ls / ps);
    %>I finally find the errors, I change the getAttribute() lines to the following, and the program runs well, although I'm still curious of if there is a better way to get the value of totalPages by using JSTL tags, instead of scriptlets.
    <%
    bq. {color:#ff0000}Number {color}ls = {color:#ff0000}(Number){color}pageContext.getAttribute("listSize"); \\ {color:#ff0000}Number {color}ps = {color:#ff0000}(Number){color}pageContext.getAttribute("pageSize");
    %>

  • How to get the entire result into an XMLDocument??

    Hello,
    I would like to get the result of a DB Query as XMLDocument. Here's the code I use:
    ResultSet rset = stmt.executeQuery();
    OracleResultSet orset = (OracleResultSet) rset;
    while (orset.next()) {
    XMLType poxml = XMLType.createXML(orset.getOPAQUE(1));
    Document doc = poxml.getDOM();
    The problem is, that I can only get a XMLDocument per table row, but not an XMLDocument of the entire result.
    Regards,
    Dominik

    I got the answer myself:
    In the xsql-query, use the xmlagg() function to group the all records into one record.
    Use the same Java code.
    Regards,
    Dominik

  • How to get the record selected in ztable based record in the output of alv

    Hi All,
    I have developed a report, it is displaying the output in ALV format.The list contained some 20 fields along with MATERIAL and BATCH. I have provided menu bar as extras -> ztable(it also contained MATERIAL and BATCH). But I have some issue when I select any record in the output then go to
    path extras -> ztable, it has to select the record in ztable based MATERIAL and BATCH which i have selected in the output, then can you please provide solution for the above problem.
    Thanks in advance

    Hi Dolly,
    you can do this by,
    data: index_rows type lvc_t_row,
          index like line of index_rows.
    * Get Selected rows from alv grid
      clear index_rows.  refresh index_rows.
    "When you choose extras->ztable
      call method alv_grid->get_selected_rows
               importing
                     et_index_rows = index_rows.
    * Now delete those rows from the ALV grid
      loop at index_rows into index.
        read table itab index index-index. "Lets say itab is the table you are displaying
        if sy-subrc = 0.
         perform bdc_sm30. "do simple bdc for sm30 with tab name and selected values
        endif.
      endloop.
    Regards,
    Manoj Kumar P
    Edited by: Manoj Kumar on Feb 23, 2009 2:49 PM

  • How to get the HPX files into Final Cut Pro 7?

    Hey.
    I have a small crisis. Hope someone can help as quickly as possible?! Thank you
    I'm working on my bachelor project, and has borrowed a Panasonic HPX 170, and will cut in Final Cut Pro 7. Now I have all the files on a hard drive, and they are MFX files.
    - How do I get them into FCP?
    Many thanks for all your help!

    Thanks
    But what if the clips are already on my iMac via the hard disk? What you write, is through the camera right?
    I've tried to get the files by the camera into FCP, but it did not. It can not find the camera.
    Thanks for your answer

Maybe you are looking for