How to have rownum in a report based on a view

How to use rownum in a report or tabular form?
I wanted to number the rows in a report. The most obvious way would be just stick
rownum in there. There is a view in a database1. It is merely select a,b,c from various
things joined together and order by pkey1.
Apex is in database2 so I have to create a view there across the link
like:
create or replace view SOME_VIEW as
select * from OTHER_VIEW@SOMELINK
alter view SOME_VIEW add constraint PK_SOME_VIEW
PRIMARY KEY (pkey1)
DISABLE NOVALIDATE;
The problem is if I try to include rownum in the query in the report I always get:
failed to parse SQL query:
ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
There's no rowid, it knows that the primary key is Pkey1 so what is the problem?
I know it's rownum that it hates. Maybe I can just number these things some other
way. However it'd be good to figure out what it is griping about.
Anyone know?
Edited by: lake on Mar 12, 2011 9:36 AM

thanks!
Actually I made a mistake in testing. And it does work to do this:
in database1:
create or replace view VIEW1 as
select
rownum "SEQ", etc.
in database2:
create view VIEW2 as select * from VIEW1@mylink
How I screwed up testing that I don't know. I was calling the column NUM before....
this is good because you can create a report about the next so many of something, such as how many of
the next batch of mailings have address problems? For that you need to know in what order it will be done and
when to quit.
But I'm sure I will use the report rownum thing also. thanks very much.

Similar Messages

  • Report based on a view

    Hi,
    On my page I have a select list with submit (--> computes an application item AI_OEFID) and I have a "form with report" based on a view.
    In my Region Source I have added a where condition: where "EMPID" = :AI_OEFID.
    When I select an employee in the select list the report only shows data of the selected "EMPID", which is fine.
    The "null display value" of my LOV is "Choose employee..."
    When I select "Choose employee..." the report shows "no data", BUT at that moment I want all my employees shown in the report.
    So, I tried the following: I changed my where condition: where "EMPID" IN (:AI_OEFID) and I created another (conditional: when value of LOV = -1) Page Processing computation which computes my application item AI_OEFID with the result of a SQL query: select EMPID from <<VIEW>>.
    When I select "Choose employee..." the report shows only my first EMPID.
    How can I show all my employees in the report when I select the "null value" of my LOV ?
    Thanx,
    Frederik.

    Frederik,
    Have a look at this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:99
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How i have to attach a report output(from server) as attachment

    Hi ,
    how i have to attach a report o/p as attachment.
    Thanks in advance for helping

    You could make use of a GLOBAL TEMPORARY TABLE and populate the data in this table in the BEFORE-REPORT trigger.
    Then your report query would be based on this global temporary table which will make it very easy for you.

  • R12: How to filter Open Item Revaluation Report based on GL Date

    Hi,
    Anybody know how to filter Open Item Revaluation Report based on GL Date from and GL Date to in R12?
    Since we just upgraded from 11.5.10 to 12.1.3 and found we cannot filter those report for specific date. It shown all data included the old data from 8 years ago also.
    We need to run the report only for specific date only. Please share with me if anyone know about this.
    Thanks.

    Pl do not post duplicates - R12: How to filter Open Item Revaluation Report based on GL Date

  • Error when trying to add sort option to a report based on a view

    Hello,
    I have several reports based on a view. Everytime I am trying to soft them by a column or more, I get this error:
    failed to parse SQL query:
    ORA-00911: invalid character
    If I take the sort out, it works just fine. Any idea how to fix it?
    PS: got it... it was from the ; at the end of my sql...
    Thank you
    Anca
    Message was edited by:
    ancag

    You seem a little grumpy. Yes, it has acurred to me that no one knows the solution. And no, I have not called tech support yet as I have been distracted lately and spending an hour on the phone trouble shooting is an hour I could be studying. Its much easier to "bump" this thread and hope someone with a suggest will chime in.
    Anyway, please dont just tell me to delete something without giving me an idea of what Im deleting. I have a feeling that this login.keychain deletion will cause me to loose the information already stored. Is this the truth?

  • BI Publisher report based on VO (View Objects)

    Hi,
    I would like to know, can we generate BI Publiher report based on VO (view Objects ). Actually we are creating VOs for ADF and want to know if that can be used for generting BIP report.
    Thank,s
    Niraj

    Hi Niraj
    Yes, you can, there is a method on the VO to get the data from it in an XML format. Then use our APIs >> documentation to format it with a template.
    Regards, Tim

  • How to display results of a report based on current year

    Hi,
    Please advice me for the following requirement.
    I have a report which is having sales results, which is having year column also. Report has to be displayed based on the current year. Now it is 2013. I should show current year results only i.e 2013.
    In 2014, i should show only 2014 results. How to achieve this at a report level.
    regards
    CK.

    Hi CK,
    You are having Data for 2014 also. If not means, you can use sql query select max(year) from period.
    So it will show the final maximum end of the year(2013) from database.
    You can use dashboard prompts too. in the prompt also you can have specific year or sql query
    http://mkashu.blogspot.com
    Regards,
    VG

  • Discoverer 4i:i have to create a report based on the two columns

    Hi,
    I have to create a report(workbook) that will have 2 parameters from date & to date.i have to apply a validation that from date should be lesser then to date.Do reply
    Thanks,

    The methods described by user564110 will work, but may not give the results you want. The user will enter the dates, the query will run, and if the to_date is lesser than the from_date, the result will be an empty worksheet with a "no rows returned" type of message. There is no way that I can think of that validate the parameters and warn the user prior to runing the worksheet.
    One alternative condition you could try:
    col_date between least(:from_date, :to_date) and greatest(:from_date, :to_date)It won't warn the users, but will still allow the worksheet to return data.

  • How to select records from Interactive Reports based on checkboxes

    Referring to the link below
    http://apex.oracle.com/pls/otn/f?p=31517:95
    I want to select rows from the Interactve Report based on a checkbox. This demo page has 2 sections, one for classic report and other for interactive one. The classic report is able to select the whole records but the interactive report selects only the emp nos. I am looking for a functionality where I can select the whole record from the interactive report.
    Any pointers will be helpful.
    Thanks

    That is easy. You should just modify the query:
    DECLARE
       v_count   INTEGER := 0;
    BEGIN
       :p95_text_ir := NULL;
       FOR i IN 1 .. apex_application.g_f20.COUNT
       LOOP
          v_count := v_count + 1;
          FOR c IN (SELECT ename, job, mgr, sal, deptno
                      FROM emp
                     WHERE empno = apex_application.g_f20 (i))
          LOOP
             :p95_text_ir :=
                   :p95_text_ir
                || 'ID: '
                || c.empno
                || ' / '
                || 'Name: '
                || c.ename
                || ' / '
                || 'Job: '
                || c.job
                || ' / '
                || 'Manager: '
                || c.mgr
                || ' / '
                || 'Salary: '
                || c.sal
                || ' / '
                || 'Department: '
                || c.deptno
                || CHR (10);
          END LOOP;
       END LOOP;
       :p95_text_ir := :p95_text_ir || ' / Records selected: ' || v_count;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Report Based on SQL view not pulling in all parameters

    Post Author: ronhawker
    CA Forum: .NET
    I based a report on a SQL view below:SELECT     TOP (100) PERCENT CorpDirectory.Position, CorpDirectory.PhoneDirect, CorpDirectory.Email, CorpDirectory.Store, CorpDirectory.Name,                       CorpDirectory.PhoneFaxWave, CorpDirectory.Department, Store.StoreName, Store.StoreStreetAddress, Store.StoreCity, Store.StoreState,                       Store.StoreZip, Store.StorePhone, CorpDirectory.DisplayOrderFROM         dbo.CorpDirectory AS CorpDirectory INNER JOIN                      dbo.Store AS Store ON CorpDirectory.Store = Store.StoreORDER BY CorpDirectory.Store, CorpDirectory.Department, CorpDirectory.DisplayOrder, CorpDirectory.Name When the report was created the order by sequence only brought in the first parameter of CorpDirectory.Store. It seemed to ignore the other three order by parameters. I am running 10.2 is VS2005.

    Sharmila,
    Thanks for your response. Maybe I wasn't clear enough in my previous statement. I will give an example of what I am trying to accomplish.
    Let's say I have 2 date fields(SUBMITDATE,COMPLETEDATE) in a table TABLE A
    I want to calculate a field called CYCLETIME with the following conditions:
    If COMPLTEDATE is NULL, then CYCLETIME = SYSDATE-SUBMITDATE
    IF COMPLTEEDATE is not null, then CYCLETIME = COMPLTEEDATE-SUBMITDATE
    Would appreciate any help.
    Thanks
    Dev
    Hi,
    You can do the calculation in the sql query itself. Here is an example which shows the sum of salaray for each department in the scott.emp table.
    select deptno,sum(sal) sal
    from scott.emp
    group by deptno
    Thanks,
    Sharmila

  • How to show more than one report in a same Viewer or Form

    Dear all,
    I have develop many reports with CrystaReport XI and I'm using the CrystalReportViewer to show each of them in VB6. My Question is: Can I show more than one report in a same Viewer? if i need to show the report1.rpt and report2.rpt in a same window how can I do it?
    Sérgio Salazar - Brazilian VB developer

    No and Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly

  • How can have the name of report server

    Hi,
    There is a method or a statement to obtain the name of the report server, in order to use it a script?
    Thank You.
    Gretings....
    Gaetano

    the name of report serverAs in Oracle Reports? If so you should use Reports as that's where you are most likely to find people with the requisite domain expertise.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Interactive report based on complex view

    firefox 24 , apex 4.0 , db11gxe ,
    hi all,
    i created an interactive report with this code :
      select c.client_id , c.client_name , c.age , c.email , c.phone ,
    p.payment_date , sum(p.amount) "summary"
    from clients c , payments p
    where c.client_id = p.client_id
    group by c.client_id , c.client_name , c.age , c.email , c.phone ,
    p.payment_date;
    but the problem was i could not delete any of the rows of the report , because there was no checkbox existed , so i created one with "apex_application.checkbox" , and i have got it now , but
    i still can not delete any rows ,
    i created a button to submit the page , and a process with this code
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
       DELETE FROM cp
       WHERE client_id = APEX_APPLICATION.G_F01(i);
    END LOOP;
    and sure nothing was deleted , and i am facing this error
    ORA-01732: data manipulation operation not legal on this view

    What is the object "CP" ?
    It sounds like it is a view. If it's the same you've used for the IR, then check out "key preserved views"
    Oracle doc - http://docs.oracle.com/cd/B28359_01/server.111/b28310/views001.htm#ADMIN11784
    Tom Kyte - http://asktom.oracle.com/pls/asktom/f?p=100:11:6474092145067::::P11_QUESTION_ID:548422757486
    There could be another issue once you address the error - depending on how you've defined apex_application.checkbox2 (the other is deprecated)
    You may not be associating the correct value in g_f01

  • How to find out names of reports using a particular view

    hi guys,
    i am newbie here, i jsut want to know how to find out which reports are using a particular view
    many thanks in advance for your help

    If you go to the Properties for the Folder in Discoverer Administrator, there is a Dependents tab that should list any workbooks using the folder. This only works for workbooks saved to the database, so won't help with any created using Discoverer Desktop. If you are gathering statistics and have the The Discoverer V5 EUL business area and its workbooks installed, it can tell you about Folders Used as well. It contains information about queries run whether the workbook is saved to the database or to the file system, but wouldn't contain inforamation about workbooks that had been created but not run.

  • Reports based on SQL view contain no data. Reports based on tables work just fine

    When we load a report into Crystal reports server that is based on a SQL view the report will run but will contain no data. A report that pulls data from SQL tables works just fine. Running the crystal report on standalone crystal reports works just fine.
    I am completely lost on this one. If you have any ideas please send them my way.

    Are you missing an ODBC / TNS entry on your CMS (or report processing, if clustered env) server?  This could definately be an issue if the report will run locally within CR client, but not when hosted on the enterprise environment.  Another test would be to run the report from CR client ON the CRS / BOE server..

Maybe you are looking for

  • Problems Sharing iMovie with Share Media

    After waiting through 40-50 minutes of processing time getting failure and a weird message: Not enough hump space / Help?

  • How do I shrink a QT window?

    I'm using QT to play some soundFX for a presentation and would like to "shrink" the window that it comes up in, if possible. Is this possible? Right now I have a bunch of 2-3 second SFXs that, when opened in QT, open as full-sized windows. Is there a

  • Update to 10.6.7 "writing files" for 14 hours?

    How do I get it to finish?  Can I stop it somehow without messing up my computer?

  • WD MyBook Live

    I noticed Western Digitial have just launched a new NAS in 1 and 2 TB flavours. Their website (http://www.wdc.com/en/products/Products.asp?DriveID=872) claims: "Compatible with Apple Time Machine - Mac computer users can utilize all the features of A

  • How do i restore do not ask me again box?

    I've accidentally checked the do not ask me again again box when I wanted to delete a photograph. I,d like to get it back if anyone can help please?