Reading columns after a "fetch_rows" command

Dear All:
Could somebody help me with this issue?
The following is a sample code to declare, open and fetch a Dynamic Cursor using BIND_ARRAY command ...
declare
c number;
d number;
n_tab dbms_sql.Number_Table;
indx number := -10;
begin
c := dbms_sql.open_cursor;
dbms_sql.parse(c, 'select cod from emp order by 1', dbms_sql);
dbms_sql.define_array(c, 1, n_tab, 10, indx);
d := dbms_sql.execute(c);
loop
d := dbms_sql.fetch_rows(c);
/* The problem is here ...... */
/* After to read the first row, I can not identify a way to read the following row fetched, how can I read the first 10 rows fetched and stored in n_tab variable? */
dbms_sql.column_value(c, 1, n_tab);
exit when d != 10;
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;
The problem is that I can not identify a way to read each row fetched in n_tab after the fetch_rows command, It's supposed that n_tab store 10 rows each time, but how can I read these 10 rows? Is it enough with the column_value command? after this Do I have to reference each row by n_tab[1], n_tab[2] .... n_tab[10] to read the codes fetched?
Thank you to everybody for your attention
Regards
Josi

Dear All:
Could somebody help me with this issue?
The following is a sample code to declare, open and fetch a Dynamic Cursor using BIND_ARRAY command ...
declare
c number;
d number;
n_tab dbms_sql.Number_Table;
indx number := -10;
begin
c := dbms_sql.open_cursor;
dbms_sql.parse(c, 'select cod from emp order by 1', dbms_sql);
dbms_sql.define_array(c, 1, n_tab, 10, indx);
d := dbms_sql.execute(c);
loop
d := dbms_sql.fetch_rows(c);
/* The problem is here ...... */
/* After to read the first row, I can not identify a way to read the following row fetched, how can I read the first 10 rows fetched and stored in n_tab variable? */
dbms_sql.column_value(c, 1, n_tab);
exit when d != 10;
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;
The problem is that I can not identify a way to read each row fetched in n_tab after the fetch_rows command, It's supposed that n_tab store 10 rows each time, but how can I read these 10 rows? Is it enough with the column_value command? after this Do I have to reference each row by n_tab[1], n_tab[2] .... n_tab[10] to read the codes fetched?
Thank you to everybody for your attention
Regards
Josi

Similar Messages

  • I can't print any web page. after the print command, it wants to save xps files. on cannon printer. vista system

    can't print any web page. after the print command, it wants to save as a xps file.
    == This happened ==
    Every time Firefox opened
    == after up grade to 3.6.6 ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)

    I found that Firefox/XPS had deleted all printer driver setups except for the XPS connection. I had to reinstall my printer connection in order to have that selection present in the printer dialogue box.

  • Reading column data type in SSAS tabular database using adomd

    I am working on SSAS tabular database and I need to find out the column datatype. I am using ADOMD for this. So far I looked at AdomdDataReader.GetSchemaTable
    Method & looked at the below code snippet to retrive Metadata from the AdomdDataReader.
    foreach (DataRow objRow in schemaTable.Rows)
    foreach (DataColumn objColumn in schemaTable.Columns)
    Console.WriteLine(objColumn.ColumnName + " = " + objRow[objColumn]);
    Console.WriteLine();
    I wonder with only the list of columns available to me, how can I execute a query/command and utilize adomd reader to get this information?
    What is the best approach to read column metadata?

    Hi, One option that you can try is to use AMO. Here is a sample code that connects to multi-dimensional model.
    http://sqlblogcasts.com/blogs/drjohn/archive/2012/03/15/ssas-utility-to-check-you-have-the-correct-data-types-and-sizes-in-your-cube-definition.aspx
    You will have to change few things to make it work for tabular model. Sorry, I did not try myself but I hope this will give you some ideas.
    // get DSV - this code assumes only one DSV in cube definition
    AMO.DataSourceView
    dsv = olapDatabase.DataSourceViews[0];
    foreach (AMO.Dimension
    dim in olapDatabase.Dimensions)
     foreach (AMO.DimensionAttribute
    attr in dim.Attributes)
     foreach (AMO.DataItem
    dItem in attr.KeyColumns)
         AddAttributeDataItem(dtCubeDataTypes,
    "Key", dsv, attr, dItem);
    AMO.DataItem contains column size and data type when connected to a tabular database.

  • How to Format DataTable Column after load Datatable without extra loop ??

    How to Format Column after load Datatable without extra loop ??
    I dont want to do extra logic which can cause performance thing.
    I have datatable which get fill from Dataset after database query, now i need to format column as decimal but without extra logic.
    I was thinking to create clone and than Import row loop but it ll kill performance, its WPF application.
    Thanks
    Jumpingboy

    You cannot do any custom things at all without doing some "extra logic". Formatting a number as decimal is certainly not a performance killer in any way whatsoever though.
    If you are displaying the contents of the DataTable in a DataGrid you could specify a StringFormat in the XAML:
    <DataGrid x:Name="dg1" AutoGenerateColumns="False">
    <DataGrid.Columns>
    <DataGridTextColumn Header="Number" Binding="{Binding num, StringFormat=N2}"/>
    </DataGrid.Columns>
    </DataGrid>
    Or if you are using auto-generated columns you could handle the AutoGeneratingColumn event:
    public MainWindow() {
    InitializeComponent();
    DataTable table1 = new DataTable();
    table1.Columns.Add(new DataColumn("num")
    DataType = typeof(decimal)
    table1.Rows.Add(1.444444444444);
    table1.Rows.Add(7.444444444444);
    dg1.ItemsSource = table1.DefaultView;
    dg1.AutoGeneratingColumn += dg1_AutoGeneratingColumn;
    void dg1_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e) {
    if (e.PropertyName == "num") {
    DataGridTextColumn column = e.Column as DataGridTextColumn;
    column.Binding.StringFormat = "N2";
    <DataGrid x:Name="dg1" />
     Please remember to mark helpful posts as answer and/or helpful.

  • HT204389 In hands free mode, why does Siri lock my phone after executing a command?

    Anytime I'm using Siri in my car in hands free mode, she locks my phone immediately after executing my command.  Then I can't access certain abilities without unlocking first - which obviously is missing the point of hands free mode.
    Thank you!

    May have found a solution for part of this. In the first senario when the two names are presented, repeat request with a verb and a noun. Say call John.
    As for the 2nd senerio, I have not been able to find a solution.
    Siri appears to be a toy and an advertizing campain talking voice but little else. Upsetting as it was one of the reasons for choosing this platform. It will get better but not soon enough.
    For now considering turning it off and using regular voice control agumented by Plantronics Vocalast service. I can possibly go on business trips and use my phone hands free whith the state Siri is in right now.

  • How to read data after select multiple record by checkbox,

    hi experts
    i  m using simple report with check box , and itab whcih contain records
    how to read data after select multiple record by checkbox,
    thanks

    Hi Prashant,
       Try using this logic.This Code displays the list with check boxes. When you check a checkbox and press a button say 'Select All' or 'De Select all' or 'Display'. It will read the data of those records.
    DATA :
      fs_flight TYPE type_s_flight,
      fs_flight1 TYPE type_s_flight1.
    * Internal tables to hold Flight  Details                             *
    DATA :
      t_flight LIKE
      STANDARD TABLE
            OF fs_flight,
      t_flight1 LIKE
       STANDARD TABLE
             OF fs_flight1.
    SET PF-STATUS 'SELECT' .
    PERFORM selection.
    PERFORM displaybasic .
    *                      AT USER COMMAND EVENT                          *
    AT USER-COMMAND.
      PERFORM selectall .
    *&      Form  SELECTION
    *      Select query to reteive data from SPFLI table
    *  There are no interface parameters to be passed to this subroutine.
    FORM selection .
      SELECT  carrid                       " Airline Code
              connid                       " Flight Connection Number                  
        FROM  spfli
        INTO TABLE t_flight.
      DESCRIBE TABLE t_flight LINES w_lines .
    ENDFORM.                               " SELECTION
    *&      Form  DISPLAYBASIC
    *      Display the basic list with SPFLI data
    *  There are no interface parameters to be passed to this subroutine.
    FORM displaybasic .
      LOOP AT t_flight INTO fs_flight.
        WRITE :
             w_check AS CHECKBOX,
             w_mark,
             fs_flight-carrid UNDER text-001,
             fs_flight-connid UNDER text-002.
      ENDLOOP.                             " LOOP AT T_FLIGHT..
      CLEAR fs_flight-carrid .
      CLEAR fs_flight-connid.
    ENDFORM.                               " DISPLAYBASIC
    *&      Form  SELECTALL
    *      To check all the checkboxes with a 'selectall' push button
    *  There are no interface parameters to be passed to this subroutine.
    FORM selectall .
      CASE sy-ucomm.
        WHEN 'SELECT_ALL'.
          w_check = 'X'.
          w_line = 4 .
          DO w_lines TIMES.
            READ LINE w_line .
            MODIFY LINE w_line FIELD VALUE w_check .
            ADD 1 TO w_line .
          ENDDO.                           " DO W_LINES TIMES
          CLEAR w_line.
        WHEN 'DESELECTAL'.
          w_check = space.
          w_line = 4 .
          DO w_lines TIMES.
            READ LINE w_line FIELD VALUE w_mark .
            IF w_mark = space .
              MODIFY LINE w_line FIELD VALUE w_check .
            ENDIF.                         " IF W_MARK = SPACE
            ADD 1 TO w_line .
          ENDDO.                           " DO W_LINES TIMES
        WHEN 'DISPLAY'.
    IF sy-lilli BETWEEN 4 AND w_lines .
        DO w_lines TIMES.
          READ LINE w_num FIELD VALUE w_check INTO w_check
                                     fs_flight-carrid INTO fs_flight-carrid
                                     fs_flight-connid INTO fs_flight-connid.
          IF sy-subrc = 0.
            IF w_check = 'X'
              SELECT  carrid
                      connid
                      fldate               " Flight date
                      seatsmax             " Maximum capacity in economy
                      seatsocc             " Occupied seats in economy class
                FROM  sflight
                INTO  TABLE t_flight1
               WHERE  carrid = fs_flight-carrid
                 AND  connid = fs_flight-connid.
              LOOP AT t_flight1 INTO fs_flight1.
                WRITE :
                  / fs_flight-carrid UNDER text-001,
                    fs_flight-connid UNDER text-002,
                    fs_flight1-fldate UNDER text-007,
                    fs_flight1-seatsmax UNDER text-008,
                    fs_flight1-seatsocc UNDER text-009.
              ENDLOOP.
            ENDIF.                         " IF SY-SUBRC = 0
          ENDIF.                           " IF W_CHECK = 'X'.
          ADD 1 TO w_num.
        ENDDO.                             " DO W_LINES TIMES
        CLEAR w_check.
        w_num = 0.
      ELSE .
        MESSAGE 'INVALID CURSOR POSITION ' TYPE 'E' .
      ENDIF.                               " IF SY-LILLI BETWEEN..
    ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " SELECTALL
    Much Regards,
    Amuktha.

  • Suddenly, I can't print any web page. After the print command, it wants to save it as a XPS file.

    suddenly I can't print any web page. After the print command it wants me to save as an XPS file and I can't get past that.
    == This happened ==
    Every time Firefox opened
    == few weeks ago

    I found that Firefox/XPS had deleted all printer driver setups except for the XPS connection. I had to reinstall my printer connection in order to have that selection present in the printer dialogue box.

  • Yahoo mail freezes after a few commands on 28.0 but not on 27.0.1

    I am using the newer one at the office but apparently haven't updated at home. Both are running the latest release of Win7 (64 bit).
    The mail software really does stop responding after 4-6 commands, just about any commands. Buttons stop working, etc. If I reload with the recycle command, it goes back to the inbox list and will again work for a few commands before freezing again.
    I haven't tried it with removing plugs and addons yet.
    Am I the only one having this problem?

    If the issue is caused by an add-on, AdBlockPlus seems to be the only add-on that both you and the other user with this issue have in common.
    You do not need to disable this add-on. This add-on has an option to be disabled on a specific website. This can be done to keep the add-on active on other websites.

  • Make a field required on record creation, read only after that

    Hello,
    Does anyone know of a way to make a pick-list field required on record creation, but read-only after that? The other twist to this is that we need to allow this field to also be read-write for all the integration edits, since this field's value could change in the enterprise database.
    Thanks,
    Neal G.

    Hi !
    I think you can add a validation rule for that. Something like :
    IIf(PRE('&lt;YOURFIELD&gt;') IS NULL, &lt;&gt; '', = PRE('&lt;YOURFIELD&gt;'))
    This means that if the previous value of your field is null (it's a creation), so the value must be different than blank. Else, it must be equal to the previous value, so not modified.
    I didn't tested it, but I let you get back to me if it works... or not !
    You'll just have to add a message saying that this field is required on creation and readonly after...
    Hope this will help, feel free to ask more !
    Max

  • How to restore views and procedures after drop user command?

    How to restore views and procedures after drop user command?
    We have 817 EE on NT and one developer created a lot of procedures, functions and vews. DB was not backuped and archived and export has not been done - our fault and we understand it. Sorry for this.
    Ok, now the story: another developer dropped this db user and we lost everything: procedures, functions and vews. The new user with trhe same name was created and new schema was imported in this user, but all old objects are lost. We don't have export and backup and archive log files.
    Question: may we can restore this lost stuff from some other sources. We are looking for lost codes, not data. May be we can use redo logs or shared pool or any other things. Any idea will be appreciated.
    Thanks.
    Victor
    [email protected]

    The switch has occurred after user was dropped, the data has been overwritten and there is be no way to use redo log files.
    I would like to explore another opportunity. Is possible to use Shared Pool or any Data Dictionary internal information to restore texts of the lost SQL and PL/SQL scripts executed in this DB before user was dropped? Not too many scripts are executed in this DB and the lost ones may still be in stack. I remember that Shared Pool (cash) should keep last executed scripts in order to improve performance. They probably are kept in some special format. Can we restore these scripts? Of course they also might be pushed out by Import that had been done after user was dropped.
    Thanks for your help,
    Victor

  • I am using reader 11.0.10.32 Win7 64 bit.  I am unable to print from Reader.  After selecting print all pages, the pri

    I am using reader 11.0.10.32 in Win7 Professional 64 bit.  I am unable to print from Reader.  After selecting print all pages, the progress bar goes through the proper page count. After that a pop up window appears with the message: The document could not be printed.  After pressing the OK button that pop up closes and the next pop up window appears with the message: There were no pages selected to print.  After pressing the OK button, the pop up closes and the pdf document is still visible in Reader.
    I can print from other programs to that printer.  I can print from Reader to other printers.
    I was able to print to all printers before.  I uninstalled Reader and reinstalled it from the Adobe web site.
    Any suggestions to make it print?
    Thanks.

    Answered multiple times every day: open Adobe Reader | Edit | Preferences
    under Documents, change 'View documents in PDF/A mode' to Never
    under Security (Enhanced), disable Protected Mode at startup

  • Word 2010 document becomes Read-Only after saving it

    Hi,
    My Word 2010 document is becoming "Read Only" after saving it, for information my doucment is on the desktop . I searched on this forum and find a couple of solutions (deactivating auto saving, etc.) but it does not work at all. Any other ideas?
    Thanks,
    Sylvain.

    , I wonder why the docuemnt is becoming Read-Only when I am saving it on the Desktop...
    I've read articles and blogs of people arguing each side of whether you should use the Desktop as a storage folder and I really
    don't have anything substantial to add to either the pro or con side of the issue.
    However, what I know about Word is that it behaves a bit different and seems to have issues when you’re actively editing document that are stored
    on the Desktop.  I would speculate that the issue has something to do with the screen driver software.
    When you’re editing a document, Word is actually using something like a dozen or more temporary hidden files and some of these are stored in the
    same folder as the source document. If the source document’s folder is the Desktop, then there has to be interaction with the screen driver. 
    This interaction with the screen driver is one variable that makes the Desktop folder unique and possibly problematic and thus Word under certain conditions
    makes the file Read Only.
    Kind Regards, Rich ... http://greatcirclelearning.com

  • How to make fields read only after form is filled in

    I am creating forms to be used within our company.  The customer srv representative (CSR) would fill in the form and send it to the customer for signature and initial.  There are a few issues I can't solve.
    1)  I need to make the rate & services fields read only after the CSR initials the form

    Will the CSR have Acrobat or just Reader, and what type of computer will the CSR be using (Windows/Mac/mobile OS)? If just Reader (Wind/Mac), this is possible by setting the fields to read-only with JavaScript. The problem is this can't be considered secure, even if using a password as discussed here: Password-protect and hide one form field
    With Acrobat you have the ability to flatten certain fields, which makes it a bit more difficult to change the "fields".

  • Changing a Record to Read-Only after an event.

    I have a Developer application that needs to be modified. This
    application includes several fields as well as a comments
    field. I'd like to change all updatable fields (not to included
    the comments field) to READ-ONLY after a certain event. Then
    after a certain date, I'd like to make the comments field READ-
    ONLY.
    Do you have any suggestions?
    Regina Grimes
    919/874-3140
    null

    Dear Regina,
    Have you tried to set_block_property in pre-record trigger to update allowed/not allowed depending on the event. And in post-record update not allowed. These triggers must be on block level. Also on item level to the item 'Comment' define pre-item trigger where take a new decision whether you want to open the entire block or not, the same way as on block level triggers. But in post-item trigger always make the entire block read-only again.
    Regards
    Jan Kramle

  • Make all text fields read only after signing form

    Hello,
    I have a live cycle form which needs to have all of the text fields set as read only after signing.
    The java script has been placed in the post sign event of a digital signature field.
    for(var i=0;i<this.numFields;i++) {
    var cNm = this.getNthFieldName(i);
    if (cNm.type = "text") this.getField(cNm).readonly = true;
    After signing the form the following console error is shown:
    this.getNthFieldName is not a function
    Can anyone please advise how to revise the script so that when the form is signed all of the text fields become ready only?
    Any assistance will be most appreciated.
    Thank you.

    You don't need any JavaScript to do this.
    In Designer you can setup the signature field in that way, that all fields will be locked after signing.
    Look here:
    http://forums.adobe.com/message/3121870?tstart=2

Maybe you are looking for

  • Site definition files? anyone?

    OK so I am new to website creation, so please cut me some slack. Using Dreamweaver CS3 on a Mac, in the manage sites window, none of the sites I created with Dreamweaver 8 are shown, yet they all reside in a local sites folder in my documents folder.

  • Getting a printed QR code to point to a specific page within my mobile site?

    Hi All, I'm createing a printed marketing campaign for my business and I want to direct a QR code to a page within my mobile muse site (not the home page). I can change the url of the QR code but I'm unsure what the url path should be? The page is ca

  • HELP FIXING ERROR A12E5

    I am unable to install Adobe Application Manager. I continue to receive "error code A12E5." I have tried downloading the patch and installing via that method, but that did not work either. Any ideas how to fix? [ spam bait removed by admin ]

  • How I can Fixed Length of Formula Column

    Dear All I have create a formula column in ORACLE REPORT 6i it consist on 15 length but problem is that formula column return output in this form 123354,000,00 But I want my formula Column return output just like this 123354,000,00 Column values fixe

  • Is it possible to use 2.4GB of data roaming in 1 hour on a iPhone

    Can anyone help me please. I have a iPhone 4 and turned off data roaming, emails 3G etc when I went to turkey and only used the phone to make a few texts and calls but received a £742 bill on my return to the uk for 2.4GB of data roaming in 1 hour 3