How to specify dynamic cursorname in FETCH INTO statement

Hi there,
my pl/sql block is like below:
LOOP
FETCH pSnCur     INTO <variablevalue>
EXIT WHEN pSnCur%NOTFOUND;
end loop;
here after INTO i want to specify variable for cursorname because my cursorname is changing dynamically. Is it possible to do this? If yes then how.
Thanks,
Meghna.

Meghna,
it seems that the solution is working.
Here it is ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Elapsed: 00:00:00.02
satyaki>
satyaki>
satyaki>declare
  2    v_str varchar2(1000);
  3  begin
  4    v_str := 'declare
  5                cursor cur is
  6                  select ename from emp where rownum <=3;
  7                v_ename varchar2(30);
  8              begin
  9                open cur;
10                loop
11                  fetch cur
12                    into v_ename;
13                  exit when cur%notfound;
14                  dbms_output.put_line( v_ename );
15                end loop;
16              end;';
17  
18     Execute immediate v_str;
19  end;
20  /
WARD
MARTIN
SCOTT
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.06
satyaki>Can you post what you have tried so far?
Regards.
Satyaki De.

Similar Messages

  • Diference bte fetch into statement fetch bulkcollect into statement.

    hi,,
    difference btw fetch into statement and bulk collect into statement.
    differece btw for loop and forall loop.

    Hi,
    Syntax:
    (Select)(Fetch)(execute immediate) … BULK COLLECT Into collection_name [,collection_name, …] [LIMIT max_lines] ;
    LIMIT is used to limit the number of rows returned.
    BULK COLLECT can also be used to retrieve the result of a DML statement that uses the RETURNING INTO clause:
    SQL> Declare
    2 TYPE TYP_TAB_EMPNO IS TABLE OF EMP.EMPNO%Type ;
    3 TYPE TYP_TAB_NOM IS TABLE OF EMP.ENAME%Type ;
    4 Temp_no TYP_TAB_EMPNO ;
    5 Tnoms TYP_TAB_NOM ;
    6 Begin
    7 -- Delete rows and return the result into the collection --
    8 Delete From EMP where sal > 3000
    9 RETURNING empno, ename BULK COLLECT INTO Temp_no, Tnoms ;
    10 For i in Temp_no.first..Temp_no.last Loop
    11 dbms_output.put_line( 'Fired employee : ' || To_char( Temp_no(i) ) || ' ' || Tnoms(i) ) ;
    12 End loop ;
    13 End ;
    14 /
    Fired employee : 7839 KING
    try to understand this example.i think it is sufficient.
    Thanks,
    Sanjeev.

  • How to send dynamic flv video to video control

    Hi
    i put a looper in my page and inside it i click insert->media->flash video
    and the window appeared and i try to make the flv dynamic i mean by code and i found that it needs to specify a specific flv file !!! no parameters button to specify dynamic file
    how to specify dynamic flv to video control?
    if this control can't i want a control like that but accepts to specify dynamic file like

    Hi,
    I'm working from the Web UI. This is BSP. Here I add 2 Methods (GET_PDF and SEND_MAIL).
    The GET_PDF gets all data for the form and then sends the FORMOUTPUT to the SEND_MAIL method.
    Here I add the PDF as following:
    First I convert it to BINARY and then I add it as attachment.
    Do I need to add it as another TYPE or ....
    +  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = ip_formoutput-PDF "PDF file from function module
        APPEND_TO_TABLE       = ' '
      IMPORTING
        OUTPUT_LENGTH         =
        TABLES
          BINARY_TAB            = lt_att_content_hex
      lo_document->add_attachment(
        EXPORTING
          i_attachment_type    = 'PDF'
          i_attachment_subject = 'Your appointment Details'
          i_att_content_hex    = lt_att_content_hex ).+
    Kind Regards,
    Maarten

  • Embed dynamic smart view report into power point

    Hello All.
    can amyone help with How to Embed dynamic smart view report into power point
    Thanks.

    Have you tried dragging and dropping onto a ppt slide? I just did and showed up sheet one of the workbook. If you have many sheets in the workbook and want to show a particular sheet/data, you may want to save workbook with that sheet visible when you reopen. One thing I have not checked is dynamic content of the worksheet.
    Venu

  • How to fetch into any type of record

    Hi,
    I have a problem. I have to create a procedure to which any query is given it is able to execute and then fetch into the record create based on the cursor. here is the code
    procedure execute_query(p_sql varchar2) is
    type t_rc is ref cursor;
    l_rc t_rc;
    v_t_record l_rc%rowtype;
    begin
    --dbms_lock.sleep(10);
    open l_rc for p_sql;
    loop
    fetch l_rc
    into v_t_record;
    dbms_output.put_line(v_t_record.object_name);
    exit when l_rc%notfound;
    end loop;
    v_query_row_count := l_rc%rowcount;
    -- dbms_output.put_line(v_query_row_count);
    end execute_query;
    constraints:
    i can specify return clause in ref cursor.
    I have to fetch into the records from different queries
    thanks
    Regards
    nick
    Edited by: Nick Naughty on Dec 21, 2008 5:16 AM

    Yes, as I already mentioned, you could use DBMS.SQL:
    create or replace
      procedure p1(
                   p_query varchar2
      is
          c           number;
          d           number;
          col_cnt     integer;
          f           boolean;
          rec_tab     dbms_sql.desc_tab;
          v_number    number;
          v_string    varchar2(4000);
          v_date      date;
          v_rownum    number;
      begin
          c := dbms_sql.open_cursor;
          dbms_sql.parse(c,p_query, dbms_sql.native);
          dbms_sql.describe_columns(c,col_cnt,rec_tab);
          for col_num in 1..rec_tab.count loop
            if rec_tab(col_num).col_type = 1
              then
                dbms_sql.define_column(c,col_num,v_string,rec_tab(col_num).col_max_len);
            elsif rec_tab(col_num).col_type = 2
              then
                dbms_sql.define_column(c,col_num,v_number);
            elsif rec_tab(col_num).col_type = 12
              then
                dbms_sql.define_column(c,col_num,v_date);
              else raise_application_error(-20900,'unsupported data type');
            end if;
          end loop;
          d := dbms_sql.execute(c);
          v_rownum := 0;
          loop
            exit when dbms_sql.fetch_rows(c) = 0;
            v_rownum := v_rownum + 1;
            dbms_output.put_line('row ' || v_rownum);
            for col_num in 1..rec_tab.count loop
              if rec_tab(col_num).col_type = 1
                then
                  dbms_sql.column_value(c,col_num,v_string);
                  dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_string);
              elsif rec_tab(col_num).col_type = 2
                then
                  dbms_sql.column_value(c,col_num,v_number);
                  dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_number);
              elsif rec_tab(col_num).col_type = 12
                then
                  dbms_sql.column_value(c,col_num,v_date);
                  dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_date);
                else
                  raise_application_error(-20900,'unsupported data type');
              end if;
            end loop;
          end loop;
          dbms_sql.close_cursor(c);
        exception
          when others
            then
              if dbms_sql.is_open(c)
                then
                  dbms_sql.close_cursor(c);
              end if;
              raise;
    end;
    set serveroutput on format wrapped
    exec p1('select ename,sal,hiredate from emp');
    SQL> create or replace
      2    procedure p1(
      3                 p_query varchar2
      4                )
      5    is
      6        c           number;
      7        d           number;
      8        col_cnt     integer;
      9        f           boolean;
    10        rec_tab     dbms_sql.desc_tab;
    11        v_number    number;
    12        v_string    varchar2(4000);
    13        v_date      date;
    14        v_rownum    number;
    15    begin
    16        c := dbms_sql.open_cursor;
    17        dbms_sql.parse(c,p_query, dbms_sql.native);
    18        dbms_sql.describe_columns(c,col_cnt,rec_tab);
    19        for col_num in 1..rec_tab.count loop
    20          if rec_tab(col_num).col_type = 1
    21            then
    22              dbms_sql.define_column(c,col_num,v_string,rec_tab(col_num).col_max_len);
    23          elsif rec_tab(col_num).col_type = 2
    24            then
    25              dbms_sql.define_column(c,col_num,v_number);
    26          elsif rec_tab(col_num).col_type = 12
    27            then
    28              dbms_sql.define_column(c,col_num,v_date);
    29            else raise_application_error(-20900,'unsupported data type');
    30          end if;
    31        end loop;
    32        d := dbms_sql.execute(c);
    33        v_rownum := 0;
    34        loop
    35          exit when dbms_sql.fetch_rows(c) = 0;
    36          v_rownum := v_rownum + 1;
    37          dbms_output.put_line('row ' || v_rownum);
    38          for col_num in 1..rec_tab.count loop
    39            if rec_tab(col_num).col_type = 1
    40              then
    41                dbms_sql.column_value(c,col_num,v_string);
    42                dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_string);
    43            elsif rec_tab(col_num).col_type = 2
    44              then
    45                dbms_sql.column_value(c,col_num,v_number);
    46                dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_number);
    47            elsif rec_tab(col_num).col_type = 12
    48              then
    49                dbms_sql.column_value(c,col_num,v_date);
    50                dbms_output.put_line('  ' || rec_tab(col_num).col_name || ' = ' || v_date);
    51              else
    52                raise_application_error(-20900,'unsupported data type');
    53            end if;
    54          end loop;
    55        end loop;
    56        dbms_sql.close_cursor(c);
    57      exception
    58        when others
    59          then
    60            if dbms_sql.is_open(c)
    61              then
    62                dbms_sql.close_cursor(c);
    63            end if;
    64            raise;
    65  end;
    66  /
    Procedure created.
    SQL> set serveroutput on format wrapped
    SQL> exec p1('select ename,sal,hiredate from emp');
    row 1
      ENAME = SMITH
      SAL = 800
      HIREDATE = 17-DEC-80
    row 2
      ENAME = ALLEN
      SAL = 1600
      HIREDATE = 20-FEB-81
    row 3
      ENAME = WARD
      SAL = 1250
      HIREDATE = 22-FEB-81
    row 4
      ENAME = JONES
      SAL = 2975
      HIREDATE = 02-APR-81
    row 5
      ENAME = MARTIN
      SAL = 1250
      HIREDATE = 28-SEP-81
    row 6
      ENAME = BLAKE
      SAL = 2850
      HIREDATE = 01-MAY-81
    row 7
      ENAME = CLARK
      SAL = 2450
      HIREDATE = 09-JUN-81
    row 8
      ENAME = SCOTT
      SAL = 3000
      HIREDATE = 19-APR-87
    row 9
      ENAME = KING
      SAL = 5000
      HIREDATE = 17-NOV-81
    row 10
      ENAME = TURNER
      SAL = 1500
      HIREDATE = 08-SEP-81
    row 11
      ENAME = ADAMS
      SAL = 1100
      HIREDATE = 23-MAY-87
    row 12
      ENAME = JAMES
      SAL = 950
      HIREDATE = 03-DEC-81
    row 13
      ENAME = FORD
      SAL = 3000
      HIREDATE = 03-DEC-81
    row 14
      ENAME = MILLER
      SAL = 1300
      HIREDATE = 23-JAN-82
    PL/SQL procedure successfully completed.
    SQL> SY.

  • How to specify path to read E$ tab records into .xls file using odisqlunlod

    Hi
    Can any one help me how to specify specific path in odisqlunload tools which is useful for both windows and linux.
    I am developing and testing in windows and moving generated scenario into linux box to test for testing people
    If in case any error out records are populated in E$ table then how that records will populated on xls file, later I am sending that attachement for email notification to concern people
    Below code is present in odisqlunload tool
    OdiSqlUnload "-FILE=d:\ODI_Error_Out_Files\Notification_Error_Records.xls" "-DRIVER=oracle.jdbc.OracleDriver" "-URL=jdbc:oracle:thin:@10.75.114.146:1521:POCWCDS" "-USER=wcds" "-PASS=h2yXeih4hFlXXV,QaMeRR2Fy" "-FILE_FORMAT=VARIABLE" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    select * from E$_notification
    Please help how to make a single code which is useful and work on both windows and linux
    Any sugession willl help me
    Thanks in advance
    Regards,
    Phanikanth

    Hi Bhabani,
    I have written below code in KM itself and select technology as Java BeanShall
    Code:
    <@
    String OS = System.getProperty("os.name").toLowerCase();
    String v_path="";
    if((OS.indexOf("win") >= 0))
    v_path="D:\Unload_Dir\<%=snpRef.getSession("SESS_NO")%>.xlsx";
    else if (OS.indexOf("mac") >= 0)
    v_path="path details";
    else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 )
    v_path="/odi_a/Middleware/logs/wcds/odi_logs/<%=snpRef.getSession("SESS_NO")%>.xlsx";
    else if (OS.indexOf("sunos") >= 0)
    v_path="soliaris path";
    @>
    OdiSqlUnload "-FILE=<@=v_path@>" "-DRIVER=<%=odiRef.getInfo("DEST_JAVA_DRIVER")%>" "-URL=<%=odiRef.getInfo("DEST_JAVA_URL")%>" "-USER=<%=odiRef.getInfo("DEST_USER_NAME")%>" "-PASS=<%=odiRef.getInfo("DEST_ENCODED_PASS")%>" "-FILE_FORMAT=VARIABLE" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    select * from <%=odiRef.getTable("L","ERR_NAME", "W")%>
    It was executed well and below is the Execution code of the above code
    Execution Code:
    <@
    String OS = System.getProperty("os.name").toLowerCase();
    String v_path="";
    if((OS.indexOf("win") >= 0))
    v_path="D:\Unload_Dir\1341360.xlsx";
    else if (OS.indexOf("mac") >= 0)
    v_path="path details";
    else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0 )
    v_path="/odi_a/Middleware/logs/wcds/odi_logs/1341360.xlsx";
    else if (OS.indexOf("sunos") >= 0)
    v_path="soliaris path";
    @>
    OdiSqlUnload "-FILE=<@=v_path@>" "-DRIVER=oracle.jdbc.OracleDriver" "-URL=jdbc:oracle:thin:@10.75.114.146:1521:POCWCDS" "-USER=wcds" "-PASS=<@=snpRef.getInfo("DEST_ENCODED_PASS") @>" "-FILE_FORMAT=VARIABLE" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    select * from WCDS.E$_CDS_COMPANY
    Please confirm me if the above Code is correct or not, if Not, please correct it and DESC_ENCODE_PASS is not encoding the password
    Regards
    Phanikanth
    Edited by: Phanikanth on Feb 18, 2013 1:09 AM

  • How to package dynamic libraries into bundles

    how to package dynamic libraries into bundles

    ok thank u
    i have other doubt
    i am using tomcatplugin instead of myeclipse plugin
    is tomcat plugin supports jsf or not?

  • How do I dynamically open a VI and load values into its connector pane?

    I'm trying to open a VI as a prompt to another VI without opening the second VI's front panel until the user clicks OK in the first window. The second VI takes inputs from the first thru its connector pane. How do I dynamically open the second VI?

    I think what you mean is call by reference dynamically loading VI's
    You can read up on it here
    If you want to make a static call to the sub vi just set the  Front Panel Options to "Open Front Panel when called"
    See here for more info
    Hope that answers your question

  • How can I dynamically specify a Column Name in a Where Clause of a DB

    I have a page that query the Database based on the column Name and values entered by the user. on this page I have a drop down list of all the Column names and a text field. The user can choose from any of the dropdown list option to set the column Name and also enter a value.How can I dynamically pass the option choosed by the user from the drop down list to the dataProvider in seesionBean1 as a column Name???Help

    Hi,
    This is a working example of a search form.
    In the JSP page we have several texts box, a table bound to a DataProvider with the rowSet in the SessionBean and a search button.
    JSP source:
                    <ui:body binding="#{PackageAirtime.body1}" id="body1">
                        <ui:form binding="#{PackageAirtime.form1}" id="form1">
                            <table border="0">
                                <tr>
                                    <td>
                                        <table border="0" width="100%">
                                            <tr>
                                                <td>
                                                    <ui:label binding="#{PackageAirtime.pageTitle}" id="pageTitle" text="Package Airtime"/>
                                                    <br/>
                                                    <br/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table border="0" cellpadding="2" cellspacing="2">
                                                        <tr>
                                                            <td>Package ID:</td>
                                                            <td>
                                                                <ui:textField binding="#{PackageAirtime.textPackageID}"
                                                                    id="textPackageID"/>
                                                                <ui:button
                                                                    binding="#{PackageAirtime.buttonPackageID}" id="buttonPackageID"
                                                                    onClick="handlePackageIDPopup(); return false;" text="..." toolTip="Open package locator"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Airtime Code:</td>
                                                            <td>
                                                                <ui:textField binding="#{PackageAirtime.textAirtimeCode}"
                                                                    id="textAirtimeCode"/>
                                                                <ui:button
                                                                    action="#{PackageAirtime.buttonAirtimeCode_action}"
                                                                    binding="#{PackageAirtime.buttonAirtimeCode}" id="buttonAirtimeCode"
                                                                    onClick="handleAirtimeCodePopup(); return false;" text="..." toolTip="Open airtime code locator"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td></td>
                                                            <td>
                                                                <ui:button action="#{PackageAirtime.searchButton_action}" binding="#{PackageAirtime.searchButton}"
                                                                    id="searchButton" text="Search" toolTip="Search records"/>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <br/>
                                                    <ui:staticText binding="#{PackageAirtime.staticTextSearchResults}" id="staticTextSearchResults"/>
                                                    <br/>
                                                    <ui:table binding="#{PackageAirtime.searchResults}" id="searchResults" paginationControls="true">
                                                        <script>
    /* ----- Functions for Table Preferences Panel ----- */
    * Toggle the table preferences panel open or closed
    function togglePreferencesPanel() {
      var table = document.getElementById("form1:table1");
      table.toggleTblePreferencesPanel();
    /* ----- Functions for Filter Panel ----- */
    * Return true if the filter menu has actually changed,
    * so the corresponding event should be allowed to continue.
    function filterMenuChanged() {
      var table = document.getElementById("form1:table1");
      return table.filterMenuChanged();
    * Toggle the custom filter panel (if any) open or closed.
    function toggleFilterPanel() {
      var table = document.getElementById("form1:table1");
      return table.toggleTableFilterPanel();
    /* ----- Functions for Table Actions ----- */
    * Initialize all rows of the table when the state
    * of selected rows changes.
    function initAllRows() {
      var table = document.getElementById("form1:table1");
      table.initAllRows();
    * Set the selected state for the given row groups
    * displayed in the table.  This functionality requires
    * the 'selectId' of the tableColumn to be set.
    * @param rowGroupId HTML element id of the tableRowGroup component
    * @param selected Flag indicating whether components should be selected
    function selectGroupRows(rowGroupId, selected) {
      var table = document.getElementById("form1:table1");
      table.selectGroupRows(rowGroupId, selected);
    * Disable all table actions if no rows have been selected.
    function disableActions() {
      // Determine whether any rows are currently selected
      var table = document.getElementById("form1:table1");
      var disabled = (table.getAllSelectedRowsCount()>0)?false : true;
      // Set disabled state for top actions
      document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
      // Set disabled state for bottom actions
      document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
    }</script>
                                                        <f:facet name="title">
                                                            <ui:staticText binding="#{PackageAirtime.table1Title}" id="table1Title" text="Package Airtime search results"/>
                                                        </f:facet>
                                                        <ui:tableRowGroup binding="#{PackageAirtime.tableRowGroup1}"
                                                            emptyDataMsg="No records matching the search criteria" id="tableRowGroup1"
                                                            sourceData="#{PackageAirtime.s23_package_airtimeDataProvider}" sourceVar="currentRow">
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn1}" headerText="Package ID" id="tableColumn1" sort="S23_PACKAGE">
                                                                <ui:staticText binding="#{PackageAirtime.staticText1}" id="staticText1" text="#{currentRow.value['S23_PACKAGE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn2}" headerText="Airtime Code" id="tableColumn2" sort="S23_AT_CODE">
                                                                <ui:staticText binding="#{PackageAirtime.staticText2}" id="staticText2" text="#{currentRow.value['S23_AT_CODE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn7}" headerText="Prepaid Value" id="tableColumn7">
                                                                <ui:staticText binding="#{PackageAirtime.staticText6}" id="staticText6" text="#{currentRow.value['SUBR_AT_PREPAID_PERIOD_VAL']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn8}" headerText="Prepaid Type" id="tableColumn8">
                                                                <ui:staticText binding="#{PackageAirtime.staticText7}" id="staticText7" text="#{currentRow.value['SUBR_AT_PREPAID_TYPE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn4}" headerText="Start" id="tableColumn4" sort="PRSM_PK_START">
                                                                <ui:staticText binding="#{PackageAirtime.staticText3}" id="staticText3" text="#{currentRow.value['PRSM_PK_START']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn5}" headerText="End" id="tableColumn5">
                                                                <ui:staticText binding="#{PackageAirtime.staticText4}" id="staticText4" text="#{currentRow.value['PRSM_PK_END']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn6}" headerText="Units" id="tableColumn6">
                                                                <ui:staticText binding="#{PackageAirtime.staticText5}" id="staticText5" text="#{currentRow.value['PRSM_PK_UNITS']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn9}" headerText="Carry-over limit" id="tableColumn9" valign="Top">
                                                                <ui:staticText binding="#{PackageAirtime.staticText8}" id="staticText8" text="#{currentRow.value['ROM_PLAN_CARRY_LMT']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn3}" headerText="Details" id="tableColumn3" width="100">
                                                                <ui:hyperlink action="#{PackageAirtime.viewpackageAT_action}" binding="#{PackageAirtime.hyperlink1}"
                                                                    id="hyperlink1" text="View"/>
                                                            </ui:tableColumn>
                                                        </ui:tableRowGroup>
                                                    </ui:table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </ui:form>
                    </ui:body>
    ...JAVA source:
        public void prerender() {
            search_action();
        public String search_action() {
            try {
                String command = "SELECT s23_package, s23_at_code, prsm_pk_start, prsm_pk_end,  prsm_pk_units, subr_at_prepaid_period_val,  subr_at_prepaid_type, subr_disc_type, subr_disc_rate,  subr_disc_value, subr_disc_perm,  subr_at_prepaid_bill_per_val, subr_at_prepaid_recurring,  s23_package_fwd, s23_at_code_fwd, prsm_pk_start_fwd,  subr_ppa_infinite, subr_ppa_carry_over, rom_plan_carry_lmt  FROM s23_package_airtime, ROM_23_PPLAN_COMP  where rom_23_pack_plan = s23_package";
                String where = "";
                String packageID = (String)textPackageID.getText();
                if (packageID == null) {
                    packageID = "";
                packageID = packageID.replace("'", "''");
                if (packageID != "") {
                    if (where != "") {
                        where += " AND ";
                    where += "upper(S23_PACKAGE) LIKE upper('" + packageID + "%')";
                String airtimeCode = (String)textAirtimeCode.getText();
                if (airtimeCode == null) {
                    airtimeCode = "";
                airtimeCode = airtimeCode.replace("'", "''");
                if (airtimeCode != "") {
                    if (where != "") {
                        where += " AND ";
                    where += " upper(S23_AT_CODE) LIKE upper('" + airtimeCode + "%')";
                if (where != "") {
                    command += " AND " + where;
                this.getSessionBean1().getS23_package_airtimeRowSet().setCommand(command);
                this.staticTextSearchResults.setText(tdi.business.Utils.getRowCountMessage(s23_package_airtimeDataProvider.getRowCount()));
            catch (Exception e) {
                log("Error during search for packages airtime", e);
            return null;
        public String searchButton_action() {
            search_action();
            this.tableRowGroup1.setFirst(0);
            return "";
        }I put the search_action() call in the prerender() to have data in my table when the page is open. For a large resultset the best aproach is to let the user select some search criteria and then call the search_action() using a button (searchButton_action() ).
    I've added a hyperlink column to my table, it is used to display the current record details in a new page.
    I have defined in my SessionBean a getRowkey/setRowkey methods.
    When the user click on a "View" hiperlink the following code is executed:
        public String viewpackageAT_action() {
            RowKey row = tableRowGroup1.getRowKey();
            this.getSessionBean1().setPackageAirtimeRowKey(row);
            return "packageairtime_details";
        }I will step over the "Page Navigation".
    In the Detail Page I have the following code:
        public void init() {
           this.s23_package_airtimeDataProvider.setCursorRow(this.getSessionBean1().getPackageAirtimeRowKey());
    }Now I have the detail page opened and also the DataProvider opened at the saved RowKey value.
    Finally, in the SessionBean:
         * Holds value of property packageAirtimeRowKey.
        private RowKey packageAirtimeRowKey;
         * Getter for property packageAirtimeRowKey.
         * @return Value of property packageAirtimeRowKey.
        public RowKey getPackageAirtimeRowKey() {
            return this.packageAirtimeRowKey;
         * Setter for property packageAirtimeRowKey.
         * @param packageAirtimeRowKey New value of property packageAirtimeRowKey.
        public void setPackageAirtimeRowKey(RowKey packageAirtimeRowKey) {
            this.packageAirtimeRowKey = packageAirtimeRowKey;
        }Note: You should enable page navigation in the result(s) table.
    That's about it :)
    Hope this helps,
    Catalin Florean.

  • How to specify the sheet name while writing data into excel

    _Workbook workbook = (_Workbook)(excelapp.Workbooks.Open(@"E:\ScriptTest\c.xlsx"));
    workbook.Sheets.Add();
    _Worksheet worksheet = (_Worksheet)workbook.ActiveSheet;
    Line 1 Selection of excel sheet
    Line 2:I am intersted in Adding the new sheet
    Line3:Selection of Sheet
    I want to select may be sheet 2 or sheet 3 like that
    How to specify ?
    And instead of just Add() can we specify name of sheet to be created also If yes how ?

    Hi,
    Please try the sample code:
    Dim aSheet As Worksheet
    Set aSheet = Worksheets.Add()
    aSheet.Name = "myWorksheet"
    Worksheets("myWorksheet").Activate
    http://msdn.microsoft.com/en-us/library/office/ff821537(v=office.15).aspx
    PS:
    This forum is for general questions and feedback related to Microsoft Excel, if you have more Excel develop issue, I recommend you post to MSDN forum
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to specify Single in memory instance of a jar in an ear

    i have an ear, containing 3 wars and 2 jars. these jar files are utility jar. and one of them has business logic lets say it application.jar. All the three wars use this jar. When ever a war file uses this jar, it gets its seperate memory instance. i want to make all the three wars use same single in memory instance of application.jar. but i dont know how to specify it. i am using websphere6.1. it will be great if someone can help me. thnx
    Ehtsham

    It's a pity !
    My problem is I tryed to save a FXG file containing images into a swf that will be able to change images sources dynamically.
    To do that, I create an empty FLA document (using JSFL), I import the FXG file into the scene.
    If I export my file into SWF in which I have injected this ActionSctipt :
    for (var x = 0; x < numChildren; x++)
      var e = getChildAt(x);
      trace(e + " " + e.name +" is "+getQualifiedClassName(e));
    I have this trace : [object MovieClip] _IMG_ is flash.display::MovieClip
    I think I cannot change the source of a MovieClip using ActionScript. Maybe I'm wrong ?
    So I would like to replace these objects (using JSFL) with UILoaders and setting the same x,y,width,height,source and then I will be able to change their sources using ActionScript.

  • How to specify approver to a Document

    Hi All,
    Here is my requirement, while uploading a document via Oracle contributor Document check-in form in Webcenter Spaces, can I mention Approver or Reviewer for that document?
    I know that we can specify the approver/reviewer at folder level. I want to know how to do that for a document.
    Any help would be greatly appreciated.
    Thanks!

    Yes, it is possible. However, this is actually 3 questions in one - all of them are related to WebCenter Content and one slightly also to WebCenter Portal.
    1) How to specify a reviewer/approver for a workflow step?
    As written in the manual (http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c05_workflows.htm#CEGGCBCA , step 16.), there are three options:
    - select a specific user
    - select a specific user's group (called alias in WCC)
    - select a token
    The first two are static, but a token can be dynamic - you have an option to write your own code in idocscript (see examples at http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c05_workflows.htm#CIHDJAAE ) which may implement any logic you wish.
    2) How to allow a contributor to influence a workflow (e.g. select an approver, but also choose a workflow, etc.)?
    What a contributor does is a) entering metadata b) entering the content, so OOTB the information influencing a workflow must be either in metadata, or in content. Usually, it is in metadata - you can a variable or a set of variables which may be evaluated during workflows.
    A trick with folders is that you may pre-define the metadata for content checked-in the folder, but you still have to 'translate' the metadata settings into workflow logic by tokens.
    3) How to do that from WebCenter Portal? (Contributor)?
    Like WCC's GUI, Contributor can benefit from profiles - http://docs.oracle.com/cd/E23943_01/doc.1111/e10978/c04_metadata.htm#DAFIIEEI where you can define which metadata will be displayed/hidden/filled in, etc.

  • Fetch into object type

    Oracle 10.2.0.5.0
    Using Pl/SQL Developer
    Hi I'm new to collections, object types etc, so I aologize for any poor wording and missed concepts...
    I need to output a ref cursor from my package (for a summary report in SQL Server Reporting Services 2005). The summary report has two fields that come from the database table and 5 calculated fields. My idea for creating the ref cursor is as follows:
    1. Define an object type at the schema level
    2. Define a table (collection) type at the schema level
    3. Define a ref cursor at the package level
    4. Using dynamic SQL create a sql statement creating virtual columns for the 5 calculated fields
    5. Fetch cursor with dynamic sql into object type one record at a time
    6. Calculate the other five field values and update the object for each record processed
    7. Add the object 'record' to the table (collection) after each record is processed
    8. After the fetch is complete, convert the table to a ref cursor for returning to my application
    Here is what I have so far. I have cut out several of the calculated fields for simplicities sake. It is not complete and I don't know how to fetch the database row into the object, nor convert the collection to a ref cursor.
    Any help would be greatly appreciated.
    create or replace type dlyout.srvCtr_sum_rec_type as object (
                               zoneNo number,
                               zonetx varchar2(15),
                               distNo varchar2(4),
                               distTx varchar2(30),
                               numOccr number,
                               MEError varchar2(1));
    create or replace type dlyout.srvCtr_sum_tbl_of_recs is table of srvCtr_sum_rec_type;
    CREATE OR REPLACE PACKAGE DLYOUT.REPORTS_PKG is
      TYPE CUR IS REF CURSOR; 
    PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.loc.zone_no%type,
                           distNo IN dlyout.loc.dist_cd%type,
                           CUROUT OUT CUR);
    END;
    CREATE OR REPLACE PACKAGE BODY DLYOUT.REPORTS_PKG IS
      PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.loc.zone_no%type,
                           distNo IN dlyout.loc.dist_cd%type,
                           CUROUT OUT CUR) as
      startDateTimeStr varchar2(10) := to_Char(startDate, 'MM/DD/YYYY') ;     
      endDateTimeStr varchar2(10) := to_Char(endDate, 'MM/DD/YYYY');   
      startDateTime date := to_date(startDateTimeStr || ' ' || startTime, 'MM/DD/YYYY HH24:MI:SS');
      endDateTime date := to_date(endDateTimeStr|| ' ' || endTime, 'MM/DD/YYYY HH24:MI:SS');
      distClause varchar2(1000);
      sqls varchar2(2000);
      zoneClause varchar2(1000) :='';
      idx number :=0;
      curSrvCtr cur;
      srvCtrRec srvCtr_sum_rec_type;
      srvCtrTbl srvCtr_sum_tbl_of_recs :=srvCtr_sum_tbl_of_recs();
      BEGIN
        if zoneNo <> 9999 then
            zoneClause := ' and zone_no member of dlyout.reports_common_stuff_pkg.convert_to_collection(zoneNo)';
        end if;
        if distNo <> '9999' then
            distClause := ' and dist_cd member of dlyout.reports_common_stuff_pkg.convert_to_collection(distNo) ';
        end if;
        sqls := 'select distinct l.zone_no zoneNo, l.zone_tx zoneTx,
                l.dist_cd distCd , l.dist_tx distTx, 0 numOccr, '''' MEError       
                from dlyout.loc l
                where l.ts between  :startts and :endts ' ||
                zoneClause ||
                distClause ||
                ' order by l.zone_no, l.dist_tx ';
        open curSrvCtr for sqls using  startDateTime, endDateTime;
        LOOP
          FETCH curSrvCtr INTO srvCtrRec;      --ORA:00932 inconsistent datatype expected - got -
          EXIT WHEN curSrvCtr%NOTFOUND;
            --call other functions to get calculated fields
            srvCtrRec.numOccr := dlyout.reports_common_stuff_pkg.Num_Loc_Exc_Mom(startDateTimeStr, endDateTimeStr, starttime, endTime, srvctrRec.distno);
            srvCtrRec.MEError := dlyout.reports_common_stuff_pkg.ME_Error(startDateTimeStr, endDateTimeStr, starttime, endTime, srvCtrRec.distNo, null);
            dbms_output.put_line(srvCtrRec.distTx || ' ' || srvCtrRec.numoccr|| ' ' || srvCtrRec.MEError);
         end loop;
    end testABC;
    END;
      Then I need to add the object to the table. Something like this?
           -- add object 'record' to table
           srvCtrTbl.extend;
           srvCtrTbl.last := srvCtrRec;
    Then I am not sure how to do the cast to get the table to a ref cursor. Something like this?
    open curout for SELECT *
    FROM TABLE (CAST (srvCtrTbl AS srvCtr_sum_tbl_of_recs))
    ORDER BY zoneNo, distTx;

    Ok, so after more research if seems that in 10.2 you cannot assign an object (SQL) type to a ref cursor (PLSQL). SO i changed my direction and used a global temp table - created at the schema level.
    Create global temporary table dlyout.srvCtr_summary (
                               zoneNo number,
                               zonetx varchar2(15),
                               distNo varchar2(4),
                               distTx varchar2(30),
                               numOccr number,
                               MEError varchar2(1)
    ) on commit delete rows;Here is what the procedure looks like now.
    PROCEDURE testABC(startDate IN date,
                           endDate IN date,
                           startTime IN varchar2,
                           endTime IN varchar2,
                           zoneNo IN dlyout.location.zone_no%type,
                           distNo IN dlyout.location.dist_cd%type,
                           CUROUT OUT CUR) as
      startDateTimeStr varchar2(10) := to_Char(startDate, 'MM/DD/YYYY') ;     
      endDateTimeStr varchar2(10) := to_Char(endDate, 'MM/DD/YYYY');   
      startDateTime date := to_date(startDateTimeStr || ' ' || startTime, 'MM/DD/YYYY HH24:MI:SS');
      endDateTime date := to_date(endDateTimeStr|| ' ' || endTime, 'MM/DD/YYYY HH24:MI:SS');
      distClause varchar2(1000);
      sqls varchar2(2000);
      zoneClause varchar2(1000) :='';
      curSrvCtr cur;
    --Still need the PLSQL record type to put in the cursor for the dynamic SQL
    type srvCtr_sum_rec_type is record (zoneNo dlyout.location.zone_no%type,
                               zonetx dlyout.location.zone_tx%type,
                               distNo dlyout.location.dist_cd%type,
                               distTx dlyout.location.dist_tx%type,
                               numOccr number,
                               MEError varchar2(1));
      srvCtrRec srvCtr_sum_rec_type;
      BEGIN
        --create clauses for dynamic sql by calling other functions
        if zoneNo <> 9999 then
            zoneClause := ' and zone_no member of dlyout.reports_common_stuff_pkg.convert_to_collection(zoneNo)';
        end if;
        if distNo <> '9999' then
            distClause := ' and dist_cd member of dlyout.reports_common_stuff_pkg.convert_to_collection(distNo) ';
        end if;
        --here is the dynamic sql
        sqls := 'select distinct l.zone_no, l.zone_tx,
                l.dist_cd , l.dist_tx, 0, 0,
                0, 0, ''''       
                from dlyout.location l
                where l.enrgz_ts between  :startts and :endts ' ||
                zoneClause ||
                distClause ||
                ' order by l.zone_no, l.dist_tx ';
       open curSrvCtr for sqls using  startDateTime, endDateTime;
        LOOP
          --fetch in part of the record
          FETCH curSrvCtr INTO srvCtrRec;
          EXIT WHEN curSrvCtr%NOTFOUND;
          --do the calculations to get the other field values
            srvCtrRec.numOccr := dlyout.reports_common_stuff_pkg.Num_Loc_Exc_Mom(startDateTimeStr, endDateTimeStr, starttime, endTime, srvctrRec.distno);
             srvCtrRec.MEError := dlyout.reports_common_stuff_pkg.MEC_Error(startDateTimeStr, endDateTimeStr, starttime, endTime, srvCtrRec.distNo, null);
            dbms_output.put_line(srvCtrRec.distTx || ' ' || srvCtrRec.numoccr|| ' ' || srvCtrRec.MEError);
            --add record to GTT
            insert into dlyout.srvCtr_summary(zoneNo, zoneTx, distNo, distTX, numOccr, MEError )
            values(srvCtrRec.zoneNo, srvCtrRec.zoneTx, srvCtrRec.distNo, srvCtrRec.distTX, srvCtrRec.numOccr, srvCtrRec.MEError);
        end loop;
       --open GTT and return ref cursor to app
       open curout for SELECT *
           FROM srvCtr_summary
           ORDER BY zoneNo, distTx;
      end testABC;

  • How to add dynamically called files to a teststand workspace?

    I am using TestStand 4.1.1 and LabVIEW 8.6.1 to try and install dynamically called VI's into a TestStand workspace.  I am following the instructions on pp. 14-8 through 14-10 in the TestStand Reference Manual (May 2008) edition.  So far I have not been successful, and the instructions are not clear.  For example, I cannot see in the instructions anywhere that I am supposed to add my test sequence.  Should the test sequence already be loaded in the project before this set of instructions is followed?  Could someone clarify this set of instructions for me? 
    Then when I get a successful build, I would like to try out the deployment and installation on a target computer.  Please provide a detailed and clear set of instructions on how this can be accomplished.
    Also, is there anyway to do this without building an installation?  Originally I just wanted to create the deployment without an installation.  But please explain both ways. 
    Thank you.
    epsilon-delta

    Epsilon,
    What are you using dynamically called VI's for? Are you adding dynamic VI's to LabVIEW, or to TestStand? If you are calling from TestStand, you don't need to do anything, the deployment utility will do all of the work for you.  The section on adding dynamically called files to a workspace listed in the Test Stand Reference Manual  is a mini-tutorial, and not exactly step by step instructions. All you need to do to add dynamically called VI's is to add them to your workspace file, and make sure the TSW is saved before you build your deployment. The example right before that one, covers how to deploy from a TSW, and mentions that you need to add your sequence file to the project that is in the workspace.
    The steps needed to deploy a sequence is as follows:
    1. Create a new workspace file
    2. Right click on the workspace file and select "Add a project"
    3.
    Right click the project and select add additional files (here you
    should add your sequence file and any files that are dynamically called
    (e.g. VIs))
    4. Go to Tools --> Deploy TestStand System
    5. Check "Deploy Files from TestStand Workspace File"
    6. Select the appropriate file path where you saved the workspace file
    7. Add in a path for the location you want to store your deployable image (for instance your desk top)
    8.
    Go to the distributed files tab and select "yes" to analyze the source
    files [here you will find all the files you chose to include with your
    distribution, this is automatically populated from the workspace and
    its dependencies), if you are deploying and plan on using a User
    Interface and not the TestStand Sequence Editor, here you would need to
    include the UI as well
    9. If you were making an installer, you
    could check the "Create installer" box under installer options and
    specify a location. Also here you could click on the drivers and
    components box to add additional driver installation (only if you are
    building an installer)
    10. Click on build status, then build
    You can also reference the same manual 14-7 through 14-8 which goes through an example deployment, and installation on a target computer. 
    After you build your installer, copy the files to the target computer and run the setup.exe to install to the new computer, what problems do you have? Do you get errors, and if so can you take screenshots of them? 
    If you do not wish to create an installer, and you already have a user interface installed, and the TestStand engine on your target machine, you can just copy all of your files to the target machine, and run them normally. We generally recommend building installers, so that any missing dependencies on the target system could be installed, and the TestStand  deployment tool takes care of pulling out all the needed files for you (except for the dynamiclly called ones, which is why you need to add them yourself). If you want you can use the deployment tool to create an image and then move that image to the target computer. The image should have all of your non-dynamic files included, but still requires that your system have all needed components installed. Please let me know what part of the deployment, installation process you are having errors, and we can help you troubleshoot. I always recommend trying to deploy a very simple example sequence with no code modules, if you are having problems. This is always a good troubleshooting tip that will help to determine if the problem is with one of your systems, or with your specific sequence file. 
    Richard S -- National Instruments --Applications Engineer -- Data Acquisition with TestStand

  • How to find the number of fetched lines from select statement

    Hi Experts,
    Can you tell me how to find the number of fetched lines from select statements..
    and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
    Thanks in advance
    santosh

    Hi,
    Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
    For ex:
    data: itab type mara occurs 0 with header line.
    Select * from mara into table itab.
    Write: Sy-tabix.
    This will give you the number of entries that has been selected.
    I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
    Hope this helps,
    Sudhi
    Message was edited by:
            Sudhindra Chandrashekar

Maybe you are looking for