Row numbers in a report

I would like to have row numbers in a spool file that I am creating in SQL*Plus. The end user will be bringing the spool file into Excel and needs to have a line number for each row of data. Is that possible? Thanks.

Something like this ?
TEST@db102 > select rownum,a.*
  2  from (select empno,ename from emp
  3  order by ename) a;
    ROWNUM      EMPNO ENAME
         1       7876 ADAMS
         2       7499 ALLEN
         3       7698 BLAKE
         4       7782 CLARK
         5       7902 FORD
         6       7900 JAMES
         7       7566 JONES
         8       7839 KING
         9       7654 MARTIN
        10       7934 MILLER
        11       7788 SCOTT
        12       7369 SMITH
        13       7844 TURNER
        14       7521 WARD
14 rows selected.
TEST@db102 >

Similar Messages

  • Row numbers in Financial reporting Studio report

    Hey I am designing reports in FR Studio that require row numbers next to the line item (Account) description. The problem is that these rows can be dynamically suppressed if they are 0/missing/error. So the question is: how do I get row #s, skipping hidden rows?
    Thanks

    Yes I completely agree, a few extra 'Excel' type functions could make a huge difference!
    Thinking outside the box, one ugly workaround might be ranking??! Could you somehow use ranking on the report to return a row number?
    I'm thinking on the Essbase side you might need to create a member in a dimension other than Accounts that you can store a static value against, incrementing it for each account in your hierarchy, e.g 10, 20, 30 etc. Then in your reports you have a hidden column to return that value and a formual column to rank it in ascending order.
    Like I say not pretty but if you could do it in a dense dim e.g. Period then it shouldn't significantly add to block size / db size as it is only one member, store it against a static member in your other dimensions, e.g. No Year, No Entity assuming you have something similar. You would also need to be careful of your numbering if your row numbers needed to include subtotals so that those values were ranked correctly.
    Its amazing what you can come up with when you have to find a way to do things.
    Hope this helps
    Stuart

  • How To Get Row numbers in matrix report

    Hi All
    i created an matrix dril down report
    in which i have to get row numbers 
    my requirement is something like
    state          City                           RowNumber                 
    Apr                          May                  
    Jun                Jul        Aug
    AP +            Vij                                 
     1                               300000                
    5666
                      Guntur                            
     2                                70000                    
    8888
                      Hyd                                  
    3                                 0000                    
    555
    MP+               RJA                              
    4                               7770                           
    0
    KL+             Kollam                            
    5                              80000                           
    555
                       Trv                                   6                             
    50000                       666
    SP+              Trj                                  
    7                               666                         
    666
    JP+               mka                                
    8                             6667                           
    66668
    RP+              Rja                                  
    9                               899
    like that above i have to get
    i used                  RowNumber(Nothing)                And Also RowNumber("Group")
    iam not getting like above   iam getting either randomly   or sum of all months
    means for each month it is taking 1
    so total iam getting 12,24,36,48..................like that
    but i want the above requirement
    so any one suggest how get that in matrix report..........

    Hi Mr.SMK,
    Per my understanding you want to get the row number based on the row group of "City", right?
    I have tested on my local environment and you can using the expression below to do this:
    Right click the city column and select the "Insert Column" and select the "Inside group-right"
    Add below expression to get the row number:
    =RunningValue(CountDistinct("DataSetName"),Count,"DataSetName")
    Preview result like below:
    If you still have any problem, please try to provide some sample data and more details information.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to print a report without row numbers or grid lines?

    Is there a way to print a Discoverer report without row numbers or grid lines?
    Thank you.
    Blake

    Hi Blake
    You're not doing anything wrong.
    The settings made when you use Tools | Options | Sheet are global settings that are only applied to new workbooks and worksheets going forwards. These have no impact on existing worksheets or even the one you currently have open. This is because Discoverer does not know whether your original worksheets were setup in a certain way deliberately as opposed to inheriting the global settings as they were at that time. What this also means, reading between the lines, is that these settings must then be stored within the worksheet itself, and this is exactly what happens.
    Thus, to edit an existing worksheet's settings you need to open the worksheet, right-click in the sheet and from the popup select either Format Table or Format Crosstab depending upon the type of worksheet you are working with. After making any necessary changes you will need to save or re-save the workbook in order for those settings to be remembered for the next time.
    Best wishes
    Michael

  • Total Rows returned in interactive report

    Hi
    I have an interactive report that displays a warning message if more than 200 rows are returned. Is there anything within APEX that tells me the exact number of rows returned in my report, or at the very least if my report has exceeded my 200 row limit?
    I have a button on my page that I only want to display if the number of rows returned in my query is <= 200.
    I know that I could use say NDS to execute my select statement in order to determine the number of rows as a seperate statement - but this seems a bit of over-kill.
    Many thanks
    Paul

    M Tajuddin wrote:
    Hi Paul,
    You can change the this from report attributes. Click on Edit page >> click on the Interactive report >> click on Report Attributes on the top >> down the bottom there is an option where you can change the row numbers and error message etc.
    Hope this helps,
    M Tajuddin
    http://tajuddin.whitepagesbd.com
    Hi
    I dont want to modify the number of rows returned. I just want to know how many rows are returned so that I can display or hide a button.
    Thanks
    Paul

  • Displaying Row numbers starting from 1

    Hi every one,
    I want to display row number as see in the report while printing, as I am using the fallowing formula I am getting row numbers including suppress records which I donu2019t want, right now my row number is starting from 10. Instead of 1u2026
    WhilePrintingRecords;
    Numbervar x;
    x:=x+1;
    I want row numbers for only display recordsu2026
    Please help me u2026
    Thanks,
    Krish.

    Krish,
    I am assuming that you are using a conditional formula to suppress the details section. If that is the case then add the conditional suppression logic to your running total formula. For example;
    WhilePrintingRecords;
    Numbervar x;
    If Not (condition for suppression) then x:=x+1 else x;

  • Sales quote layout rows doubled in crystal report layout

    Dear All,
    Sales quote layout rows doubled in crystal report layout.
    In sales quote layout the rows are doubled. Even in the standard layout. If the quote contains only two rows. Then it is doubled as 4 rows in the crystal report layout.
    It is happening in the particular database. Other database are working fine. I request you people to help me to overcome this issue.
    Regards,
    Siva

    Hi Siva,
    If this is regarding CR in SAP B1 then please repost to the SAP Business One Application space.
    -Abhilash

  • How to Customize the Message "No Row Returned" from a Report

    Hi,
    I've been trying to customize the Message "No Row Returned" from a Report.
    First i followed the instructions in Note:183131.1 -
    How to Customize the Message "No Row Returned" from a Report
    But of course the OWA_UTIL.REDIRECT_URL in this solution did not work (in a portlet) and i found the metalink document 228620.1 which described how to fix it.
    So i followed the "fix" in the document above and now my output is,..
    "Portlet 38,70711 responded with content-type text/plain when the client was requesting content-type text/html"
    So i search in Metalink for the above and come up with,...
    Bug 3548276 PORTLET X,Y RESPONDED WITH CONTENT-TYPE TEXT/PLAIN INSTEAD OF TEXT/HTML
    And i've read it and read it and read it and read it and can't make heads or tails of what it's saying.
    Every "solution" seems to cause another problem that i have to fix. And all i want to do is customize the Message "No Row Returned" from a Report. Please,...does anyone know how to do this?

    My guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.

  • Restrict number of rows returned in a report

    Hi All
    Does anyone know how to restrict the number of rows returned in a report eg. I want to do a couple of reports based on opportunities/products and return only the top 5 or 10???
    Thanks
    Gail

    Sorry just answered my own question by using the 'is in top' colum filter!

  • Is there a way to have a Numbers spreadsheet show the row numbers on ipad?

    I am have a spreadsheet I am using for keeping count of the current people registered for an event.
    If there a way to have one of the columns automatically show the row numbers so I can easily see the amount of people confirmed for the event without having to manually count them? Also, I will be adding and deleting lines and need Numbers to automatically show the row numbers without me having to change it.
    Thanks,
    Mike

    I found it out:
    inserted a new column A
    a --
    In A1 type 1
    in A2 type 2
    select the pair A1:A2
    drag the circular handle from the bottom right of A2 thru the very bottom of the column.
    b --
    in A1 type =ROW()
    select the cell A1
    drag the circular handle from the bottom right of A1 thru the very bottom of the column.

  • Using row numbers in sql

    I want to do a select query based on row numbers and was wondering if its possible.
    for example,
    select * from TABLE where rownumber = x;
    Thanks.

    There is one special case where
    SELECT * FROM table WHERE rownum = x
    will work, x = 1. Note, the proper psuedo column name is ROWNUM.
    You can do something like:
    SELECT *
    FROM (SELECT *,rownum rn
          FROM table)
    WHERE rn = xfor any value of rownum up to the number of rows in table.
    TTFN
    John

  • Change row's color in report painter

    Hi all!!!
    anybody knows how change row's color in report painter,
    for example
    number   name        |  money          
       7020   payments1 | 100.00   
       7021   payments2 | 200.00
        summary            |  300.00
    change color of row  "7020   payments1" and "7020   payments1"
    Regards!!!

    Hi,
    For it, first place the cursor on the row and choose Formatting > Row. In the next dialog box, select a color (for totals, subtotals, inserted rows, or for emphasis). The system assigns a color based on the selection you make here.
    Regards,
    SDNer

  • Adding radio button to each row of an interactive report: possible or not?

    First of all let me explain what the point of this application is.
    I'm making an application that allows a user to select something out of a drop-down select list. This list is a list of categories for food. Let's say the user selects "Fruit".
    Then the page refreshes and shows an interactive report with a list of food that belongs to the category of fruit.
    Here's where I want to change things:
    I want the user to see the interactive report, but in this interactive report I want to add a radio button for each row.
    Then, when a certain type of food is selected (let's say "Strawberry") via the radio button, a text field should appear underneath the interactive report. In this textfield, the user can then add the weight of the food item, and then it will calculate how many carbs there are in the strawberry.
    All I really want to know is:*
    How do I add a radio button to each row of the interactive report, and how do I link this radio button to the value of that particular row?*
    Additional information:
    The item "P17_FOOD_CATEGORY" contains the following LOV:
    select FOODCATEGORYNAME as display_value, FOODCATEGORYID as return_value
    from FOODCATEGORY
    order by 1
    The "Food" region contains the following source:
    select a.FOODID, a.NAME, b.FOODCATEGORYNAME, c.STANDARDAMOUNT, c.NAME Unit
    from FOOD a inner join FOODCATEGORY b
    on a.FOODCATEGORYID = b.FOODCATEGORYID join FOODUNIT c
    on a.FOODID = c.FOODID
    where a.FOODCATEGORYID = :P17_SET_CATEGORY
    EDIT:
    PLEASE! Even if you don't know a good answer or if you are unsure about your answer, do post! Even suggestions would be welcome! I really need all the help I could get, even if it's not much.
    Edited by: 917169 on Feb 29, 2012 12:25 AM

    Hi there!
    I tried to change my code to your version, but then I get an error message:
    Error Unable to change Interactive Report query.
    ORA-12899: value too large for column "APEX_040100"."WWV_FLOW_WORKSHEET_COLUMNS"."DB_COLUMN_NAME" (actual: 32, maximum: 30)
    I don't quite know what this means. After doing a quick search on the internet, I know that this message should mean that the length of the value for the columns named "APEX_040100", "WWV_FLOW_WORKSHEET_COLUMNS" and "DB_COLUMN_NAME" is too long. But, I don't have these columns. I searched for them in my object browser, and they can't be found in any table related to my application.
    I'm sure your answer is the solution, but do you perhaps have an idea on how to solve this error? I checked the allowed maximum length for any column value that is related to my application, but they all have "50" set as the maximum value...
    Thank you for your reply. ;)

  • Excel 2010 Row numbers disappearing

    Question: Bit of an odd one here.
    Running Excel 2010 on a WinXP Sp3 box. Issue is only affecting one user and one of his spreadsheets. Sporatically, the actual numbers within the row identifier boxes vanishes, along with the data in the affected rows. The rows are still there, and the rows
    above and below are still numbered in the same sequencial order as if the affected rows were still numbered. If we do not notice this before saving spreadsheet, data is lost. If we unhide all cells, the numbers come back, as does the data. The odd thing is,
    as I said, the rows are NOT actually hidden, only the row identifier numbers and the data are gone.
    Please help! Critical order tracking sheet.

    Using  Windows 7 Professional ver 6.1 (Build 7601 : Service Pack 1) and Excel version 14.0.6112.5000 (32 bit)
    A large spreadsheet some 8MB and formatted as an xls file.
    I experienced a similar problem  with some  row  numbers and data missing together with some rows being expanded to a height of  550 pixels.
    Highlighting the whole row and automatically resetting the height (double clicking bottom edge ) sometimes resets the height, row numbers and data.
    Strangely highlighting the row and clicking the bold button also resets the the height, row numbers and data.
    Unfortunately these remedy’s do not persist after saving the file and reopening it.
    If I resave the "corrupted" xls version  as a Macro-Enabled Worksheet .xlsm file all of the issues above disappear.
    I hope this helps some one

  • How can i get the failed row numbers in batch insertion?

    Afeter execution of batch insert operation into a table, i use OCIAttrGet() to get the error number of insertion, as expected, it returns the correct number. however, when i use OCIParamGet() to get an error handle and then to get the exact failed row numbers , OCIParamGet() returns -2 , means "INVALID_HANDLE". can anyboy tell me why ? how can i get the exact failed rows?
    the snapshot of my code :
    int errNum = 0;
    int nRet = 0;
    nRet = OCIAttrGet((dvoid *)m_pIIOdbc->m_pStmtAll,OCI_HTYPE_STMT,&errNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pIIOdbc->m_pErrHandle);
    if (errNum)
         OCIError* pErrHndl;
         int* pRow_off = new int[errNum];
         for (int i = 0; i < errNum; i++)
         nRet = OCIParamGet(m_pIIOdbc->m_pErrHandle,
    OCI_HTYPE_ERROR, m_pIIOdbc->m_pErrHandle, &pErrHndl, i + 1);
         nRet = OCIAttrGet (pErrHndl, OCI_HTYPE_ERROR, &pRow_off, 0,
         OCI_ATTR_DML_ROW_OFFSET, m_pIIOdbc->m_pErrHandle);
              delete []pRow_off;

    now the code is :
    OCIEnv      *m_pEnvHandle;                    
    OCIError      *m_pErrHandle;                         
    OCIError     *m_pErrHandle2;                    
    OCIServer *m_pSrvHandle;                         
    OCISvcCtx *m_pSvcHandle;                         
    OCIStmt *m_pStmtExec;
    OCIStmt *m_pStmtAll;
    OCIError** m_pErrorHndl;     
    int* m_pRowOff; //the array that will contain the failed row numbers
    int     m_nArrayLength; //length of array in once batch operation
    int m_nErrNum; //error number
    int m_nSucCount; //successful record number
    //initialization
    //m_nArrayLength is a parameter passed in, so i can not tell the exact length of the array, dynamic space allocation is needed
    m_pErrorHndl = new OCIError*[m_nArrayLength];
    m_pRowOff = new int[m_nArrayLength];
    //execution
    OCIStmtExecute(
              m_pSvcHandle,
              m_pStmtAll,
              m_pErrHandle,
              (ub4)m_nArrayLength,
              (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL,
              OCI_BATCH_ERRORS
    //get successful records number
    m_nSucCount = 0;
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nSucCount,
              0,OCI_ATTR_ROW_COUNT, m_pErrHandle);
    //get error numbers
    m_nErrNum = 0;
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2);
    //get failed row numbers into the array
    if (m_nErrNum)
              //get failed row numbers into the array
              for (int i = 0; i < m_nErrNum; i++)
                   //initiallize error handles               OCIHandleAlloc((dvoid*)m_pEnvHandle, (dvoid**)&m_pErrorHndl,
                        OCI_HTYPE_ERROR, (size_t)0, (dvoid**)0);
                   OCIParamGet(m_pErrHandle, OCI_HTYPE_ERROR, m_pErrHandle2, (void**)&m_pErrorHndl[i], i);
                   OCIAttrGet (m_pErrorHndl[i], OCI_HTYPE_ERROR, &m_pRowOff[i], 0,
                                            OCI_ATTR_DML_ROW_OFFSET, m_pErrHandle2);
    now, if batch insert is executed, eg, there are 10 records to be inserted, thus m_nArrayLength is set to be 10. There are 5 records of the 10 have exist in database, so some of insert operations will fail. After execution, m_nErrNum is 5, and i can get the failed row numbers.Everything seems go well.
    However, if batch updata is excuted, eg, 10 records to be updated, m_nArrayLength is set to be 10, and also there are 5 records of the 10 have exist in database. After execution, the OCIStmtExecute() returns 1, m_nErrNum got by
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2)
    is 0, and m_nSucNum is 5. Why?? how can I get the rows that fail? i have to know which rows do not exist in database??

Maybe you are looking for

  • Resizing pixel art video without affecting the pixels with blur.

    Hello everyone, First I would like to mention that I did searched for an answer to my issue on the forum but only found a thread by Rowby Goren from Jan 4, 2010, who asked a similar pixel resize question regarding to still images in CS4. He was answe

  • In sales order item level problem of sales unit.

    Hi All, When I create the sales order at that time at item level when I enter the sales unit to order quantity, it then replaced by base unit of that material. Also I have checked the unit conversion in material master, but no conversion is maitained

  • Installation Of a Fresh Release 12.

    Dear all, I am a newbie in Oracle Apps Dba. We use Oracle Application 11.5.10.2 on HP-UX machine. I have never install any application of such before. I'm planning to install a fresh R12. What doc do i need to follow? Do i need staging CDs? Kindly gi

  • Apex LE/D 4088 Assistance

    I saw that there was a group of users who had the Apex 40" LE 4088 television on an earlier post and wanted to follow up with those users as this information doesn't seem to exist anywhere else and customer service with Apex is non-existent. Does any

  • Macbook Pro Retina 15 inch possible display/logic board issue?

    Ive had this problem when opening up FaceTime windows or notification center windows. the screenshot is provided (http://imgur.com/1h6fip4). i have run an apple hardware test the normal one and the extended one and it said it has no problems to repor