Show Biggest Sequence Number

Hi,
I am writing a report in Oracle 6i & Windows xp. I got some duplicated item# in my report as below:
Item# Sequence# date
J1000 13567 10/10/04
J1000 13550 10/10/04
J1000 13551 10/10/04
J1001 13570 10/10/04
J1002 13571 10/10/04
Is there any way that I can just get the biggest sequence# only for Item#(J1000), and my report will be like:
Item# Sequence# date
J1000 13567 10/10/04
J1001 13570 10/10/04
J1002 13571 10/10/04
Thank you,
JJ

You can try a summary column, and set the summary to max for the group. But that still won't accomplish what you are trying to do I dont think.
Care to enlighten me why my solution did not work? I suspect you left some information out on your first post. My suggestion is to handle as much as you can in SQL, and less in Reports Builder. The more the report has to do calculations the better.
Please post your query that you tried, an example of the dataset you tested on, and the results.
Thanks!

Similar Messages

  • Show biggest sequence# in report builder

    Hi,
    I am writing a report in oracle 6i report builder and query builder.
    My report result is below:
    ITEM# DATE SEQUENCE#
    item1 10/19/04 12000
    item1 10/19/04 12001
    item1 10/19/04 12002
    item2 10/19/04 11999
    item3 10/19/04 11998
    What I want to do is: using PL/SQL Editor in report builder, if i get same item#, the result only shows the item# that has biggest sequence#, it shoul look like below:
    ITEM# DATE SEQUENCE#
    item1 10/19/04 12002
    item2 10/19/04 11999
    item3 10/19/04 11998
    Can anyone help?
    Thanks,
    J

    Dude
    STOP cross-posting. I answered your question already 2x.
    Show Biggest Sequence Number
    As I stated, this is not a report builder problem, its a simple SQL problem that can be solved by using the max function. I doubt you actually ran the query I provided, or else you would have the results you were looking for!

  • How to pass the sequence number of current loop in a for loop in FPGA vi to the host

    PCI-7830R
    LV 8.2
    What I was trying to do is to use multiple DIO to generate pulse at different sequence. Mode one is to automatically sweep from DIO1 to DIO20; mode 2 is several DIOs generate pulse simoutaneously.  So I use a case structure to make the selection, in the mean time, I set up two for loop in each case so that I can use multiple pulse generations. For example, in scanning mode, if I set 2 exposures, it sweeps from 1 to 20 then do it again.  
    Then I need to get the loop sequence number, i of each scenario. So I put an indicator within the first loop, and create a local variable of it and put in the second one.  Running the FPGA vi alone, I can see the indicator change in each case from 0 to N-1, N being the for loop time.But in the host vi, I tried to add this indicator as an element in the read/write invoke method, in the debugging mode, I could only see it directly jump to N-1 without all the changes I saw in FPGA vi. 
    Is it possible to get this number passed correctly from FPGA vi to the host vi? Thanks

    Thanks for the reply Jared.
    Excuse me if it looks incorrect, but I'm new to FPGA programming, so I would have to look into the FIFO you referred to.  I used local variables because for one thing I have several different cases containing for loop in each of them, and I only want one indicator for the "i".  If I put the indicator out of any for loop, it's only gonna show the last number which is N-1.  For the other thing, it seems like property nodes are not allowed in FPGA vi.  And by doing this, I can see the i number changing from 0 to N-1 in each case, well, in FPGA vi's front panel.  But while I ran the host vi with everything, the indicator in host vi's front panel only showed the last number N-1. It may be the reason you said, it happened too fast before the indicator in host vi can catch it.
    What I want to realize is to group the data I collect in host vi, for example, when I choose multiple exposure in each mode, and the FPGA runs 1 through 20 then do it again, I want the data stored in two groups using the loop sequence number as the seperator in file name.  So it goes like 1-1, 2-1.......20-1; then 1-2, 2-2,.....20-2.

  • Error While Generating Sequence Number. Contact your system Administrator

    Hi All,
    I have developed a form to provide our client with 'an easy to fill' User Interface. This form will be used instead of the standard form present in Business Suite.
    Some columns of the table, on which form is based, are getting populated via generation of sequence numbers.
    Now the problem is, after deploying custom form developed by me in the instance, Standard form is showing this error
    " Error While Generating the Sequence Number. Please contact the System Administrator "
    I am unable to trace why this error had started appearing..
    Any suggestions would be of great help...
    Thanks in Advance,..

    Forms version 6i,
    Database version 9.2.0.6.0
    Sequences which I am using are used there in Standard form also..
    So evrytime i need to save the record, I am selecting NEXTVAL of it into
    the respective item of the datablock..

  • Sequence number different in DB than from assignSequenceNumber()

    I am using TopLink 10.1.3 DP4 (I think - inside JDev build 3565). I am attempting to use a sequence in a schema that I DO NOT OWN - I cannot make modifications tot he database sequence because there are other applications in place running against it.
    The database sequence is in a 10g database, with an interval of 1 and a cache of 20.
    My object uses the value of the sequence as the sole element of its primary key. I am creating a new object, registering it with a UnitOfWork using registerNewObject(obj). It seems that this does not make a clone, since the object returned by this method is the same identity as the object passed in.
    My project sequencing policy is set as follows:
    <project-sequencing-policy>
    <sequencing-policy>
    <preallocation-size>1</preallocation-size>
    <sequencing-type>Use native sequencing</sequencing-type>
    <name-field-handle>
    <field-handle/>
    </name-field-handle>
    <counter-field-handle>
    <field-handle/>
    </counter-field-handle>
    <sequencing-policy-table></sequencing-policy-table>
    </sequencing-policy>
    </project-sequencing-policy>
    Platform is 10g
    <platform-name>Oracle10g</platform-name>
    The sequence is accessed through a synonym (since JDev couldn't seem to reference a sequence in a different schema from a user's login).
    <sequence-number-name>EVENT_SEQ_SYN</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    When I commit my new object, I can see the insert statements in the log claiming a value of 'x' for the primary key. The row in the database actually has a primary key of 'y', where 'x = y - preallocation size' and 'y = sequence last number - preallocation size'. I think I would get the right number if I could set the preallocation size to 0 (performance problems understood) but TopLink chokes on this at run-time.
    Is this problem familiar to anyone?
    Failing using native sequencing, I tried to write custom SQL for the insert statement, but I couldn't find any decent examples anywere on how to do that. I found in a deep google search an example that showed you could use hash (#) to reference the value of a property, but what if the value that needs to be inserted in the database is held in an indirect referenced object? For example, if I was trying to write an insert sql for a Pet object with an indirect reference (valueHolder) to its owner, and I needed to put the owner id in the row - how would I write that insert statement in the 'custom sql' pane in workbench?
    Thanks for your help.
    Dave

    Very strange case.
    I tried to reproduce it using TopLink Employee example - and couldn't.
    Here's the code:
        //  to get debug info
        session.setLogLevel(SessionLog.ALL);
        session.login();
        UnitOfWork uow = session.acquireUnitOfWork();
        Employee emp = new Employee();
        emp.setFirstName("sequencingTest");
        uow.registerNewObject(emp);
        uow.assignSequenceNumber(emp);
        uow.commit();
        System.out.println("firstName = "+emp.getFirstName() +"; id="+ emp.getId());And here's the log:
    [TopLink Info]: 2006.01.26 04:49:05.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060116)
    [TopLink Config]: 2006.01.26 04:49:06.171--DatabaseSessionImpl(18)--Connection(19)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
         platform=>Oracle9Platform
         user name=> "test"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:orcl"
    [TopLink Config]: 2006.01.26 04:49:10.140--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:orcl
         User: TEST
         Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.1.0.4.0
    [TopLink Finest]: 2006.01.26 04:49:10.625--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence PROJ_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence ADDRESS_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence EMP_SEQ: preallocation size 1
    [TopLink Info]: 2006.01.26 04:49:11.453--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])-- login successful
    [TopLink Finer]: 2006.01.26 04:49:11.703--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--acquire unit of work: 48
    [TopLink Finest]: 2006.01.26 04:49:11.703--UnitOfWork(48)--Thread(Thread[main,5,main])--Register the new container bean Employee: sequencingTest
    [TopLink Finest]: 2006.01.26 04:49:11.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2006.01.26 04:49:11.750--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--SELECT EMP_SEQ.NEXTVAL FROM DUAL
    [TopLink Finest]: 2006.01.26 04:49:12.328--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing preallocation for EMP_SEQ: objects: 1 , first: 3,469, last: 3,469
    [TopLink Finest]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--assign sequence to the object (3,469 -> Employee: sequencingTest )
    [TopLink Finer]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.421--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2006.01.26 04:49:12.437--UnitOfWork(48)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(Employee: sequencingTest )
    [TopLink Finest]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Thread(Thread[main,5,main])--Assign return row DatabaseRecord(
         EMPLOYEE.VERSION => 1)
    [TopLink Fine]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, GENDER, END_DATE, START_DATE, MANAGER_ID, START_TIME, END_TIME, ADDR_ID, VERSION) VALUES (3469, NULL, 'sequencingTest', NULL, NULL, NULL, NULL, {t '09:00:00'}, {t '17:00:00'}, NULL, 1)
    [TopLink Fine]: 2006.01.26 04:49:12.640--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO SALARY (SALARY, EMP_ID) VALUES (0, 3469)
    [TopLink Finer]: 2006.01.26 04:49:12.781--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--release unit of work
    firstName = sequencingTest; id=3469
    If I understood correctly, the problem is x showing up in insert as a value to be assigned to PK and y actually inserted into the db. If that's the case could there be a BeforeInsert trigger on the table? To test try inserting through jdbc using concrete pk value.

  • A sequence number error in a form

    I am currently creating a form with a sequence number in forms 10g
    <pre>
    table name: emp
    table desc: emp_id number,emp_name varchar2(20),emp_no number
    </pre>
    i have to generate the emp_id automatically.
    <pre>
    create sequence emp_seq
    minvalue 1
    start with 1
    increment by 1
    cache 20
    </pre>
    I use pre_insert trigger in block
    <pre>
    begin
    select emp_seq.nextval into :emp.emp_id from dual
    end
    </pre>
    problem;
    I can not insert a record because of sequence number in :emp.emp_id
    no compilation error but there is no automatic sequence number appeared in :emp.emp_id after run a form.
    It used to work before(fine with automatic sequence number in :emp.emp_id).
    it happens after I changed layout format and someone add more columns in emp table.
    eventhough i did not use sequence number in emp.emp_id
    in pre-insert-trigger
    <pre>
    begin
    select nvl(max(emp_id),0)+1
    into :emp.emp_id
    from emp;
    </pre>
    still can not show up any number in :emp.emp_id
    please help me out

    Thank you . It works now.
    would you mind explain to me; what I can not use automatic sequence number in emp.empid text field in pre-insert-trigger in my case
    is it trigger confliction in my forms?

  • Sequence number in Trigger

    I'm trying to create an insert trigger that will do the following:
    1.) Grab the next sequence number from a sequence and use it as the value for the id_number column.
    2.) Grab the SYSDATE and use it as the value for the create_date column.
    I'm using Oracle 8.1.6 on HP-UX. Here's my syntax, so far:
    CREATE OR REPLACE TRIGGER tI_GRANT_TEST_CHILD before INSERT on GRANT_TEST_CHILD for each row
    declare curDate DATE;
    declare idNumber NUMBER;
    begin
         SELECT SYSDATE into curDate FROM DUAL;
         SELECT GRANT_TEST_SEQ.NEXTVAL into idNumber FROM DUAL;
         :new.CREATE_DATE := curDate;
         :new.ID_NUMBER := idNumber;
    end;
    I'm pretty new to Oracle, so I've probably got a syntax error. The trigger worked fine when I just had the create date functionality; but, I can't get the sequence stuff to work.
    Also, anyone know any good links for Oracle syntax standards?
    Thanks for the help.

    I don't see anything wrong with the syntax in your example, but the trigger can be simplified to:
    create or replace trigger ti_grant_test_child
    before insert on grant_test_child
    for each row
    begin
      select grant_test_seq.nextval
        into :new.id_number
        from dual;
      :new.create_date := sysdate;
    end;
    /You can type SHOW ERRORS after compiling in SQL*Plus to see the actual errors.

  • Sequence Number in PLD_Sales Quotation

    Hi,All
    I want to show sequence number in PLD. My Problem is  i can't use LineNum() because in some rows in matrix
    that no price, i  will not show data in PLD.
    Now,if i use LineNum() when i print preview in column system will skip record that no have price and the sequence number is not  proper.
    How to manage for get number order ascending sequence ?
    Please help me in this regard,
    Venkatesh.R

    Hi .....
    Try to be as specific as possible ...
    1 .- I created a formula field - assigned to it in MY CASE THE FIELD F_174 --
    This formula has the status field for the lines are visible or not ..
    2 .- I have left as "invisible" field  LineNum()
    3 .- I created a new formula field - IN TURN THIS AREA IS F_175 --
    The second field contains the following formula ColSum(F_174)
    This field is the field position LineNum() (replaces)
    4 .- All areas covered are bound to repeat F_174 (to appear when it meets the condition of the formula)
    With all these steps allowed me to see so correlative lines, even when there are lines that are not visible to not meet the condition.
    I hope it will help
    Best regards,

  • How do you create a sequence number in SQL Developer Data Modeler?

    I am new to Data Modeler and am looking to create a sequence number but do not know how to do the same using the Data Modeler. Can someone guide me? Thanks.
    Edited by: user6710206 on Jun 9, 2010 7:32 AM

    I have had found that the following works sometimes when coming immediately after the create or replace package body in a script (although it isn't doing anything for me on invalid package bodies at the moment):
    show errors package body <package name>
    Because it is inconsistent, you cannot really trust it, which gets you back to Jim's options (open in editor or compile from connection tree) or the old long hand of
    select * from user_errors where type = 'PACKAGE BODY' and name = '<package name>'

  • Sequence Number

    HI guyz,
    I have one problem with my forms. i would like to create Seqeunce number in my field by using when button pressed trigger which shows next next sequence number. how can i do this?
    Regards

    Whats your usage for that number you want to generate from a sequence? If your requirement is to have no gap between the numbers, theree will fail using a sequence (what happens if the user closes forms after pressing your button).
    The easiest way to generate the number only once yor a new record would be to do it "automatically", either in the WEHN-CREATE-RECORD-trigger or using a Initial value of :SEQUENCE.MYSEQ.NEXTVAL (this will fill the field at record creation) or using a PRE-INSERT-trigger (this will fill the field at "commit"-time).
    If you want to keep with the button-method, why not just check if the field is empty (or is it allowed to overwrite existing number?)

  • Sequence number adjustment in the column

    In my table maintenance generator,
    I have one field called sequence number which increments by '1', each time user enters a new record in my table maintenance generator(have coded in such a way).
    now the internal table, under sequence column if some records get deleted,
    then the numbering of that column should be adjusted automatically.
    Like
    1st record -     1 A B D
    2nd record -     2 A B C
    3rd record -     3 A B D
    4th record -     4 A B C
    5th record -     5 E D F
    If some user deletes 3rd record , then instead of showing the TMG as below
    1st record -     1  A B D
    2nd record -     2  A B C
    3th record -     4  A B C
    4th record -     5  E D F
    the TMG should should show  as
    (I need that to be sequence column adjusted as )
    1st record -     1  A B D
    2nd record -     2  A B C
    3th record -     3  A B C
    4th record -     4  E D F
    My thought is to write on new module in PAI,
    and buils the logic in case of syst-ucomm = 'DELE'.
    Please suggest me any function module availble or any good logic for this
    Thanks in ADV.

    This really isn't the way the TMG was meant to be used. Normally, one just uses it to manually add change or remove individual records, not a number of records based on some logic. It would probably be simpler to build a simple dynpro to take care of this.
    Rob

  • Generate archive logs are not in sequence number?

    On last friday... the latest archive log number was ARC00024.ARC. Tomorrow when I come backup, the archive logs ARC00001.ARC and ARC00002.ARC were being generated by oracle itself. I wondering the archive log sequence should be in sequence. What is happening?
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination C:\oracle\ora92\RDBMS
    Oldest online log sequence 1
    Next log sequence to archive 3
    Current log sequence 3
    SQL>
    FAN
    Edited by: user623471 on Jun 7, 2009 7:35 PM

    khurram,
    Its our production instance and havent issued resetlogs option but when listing the arvchives it shows in different sequence number...
    and also while copying the archives by RMAN it doesnt copy in sequence
    -rw-r----- 1 xxx dba 69363859 May 28 19:16 2_10373.arc.gz
    -rw-r----- 1 xxx dba 43446622 May 28 19:16 1_10553.arc.gz
    -rw-r----- 1 xxx dba 52587365 May 28 19:16 1_10578.arc.gz
    -rw-r----- 1 xxx dba 45251820 May 28 19:16 1_10543.arc.gz
    -rw-r----- 1 xxx dba 60890256 May 28 19:17 1_10579.arc.gz
    -rw-r----- 1 xxx dba 46659008 May 28 19:17 1_10548.arc.gz
    -rw-r----- 1 xxx dba 116899466 May 28 19:17 2_10353.arc.gz
    -rw-r----- 1 xxx dba 77769517 May 28 19:17 1_10531.arc.gz
    -rw-r----- 1 xxx dba 66401923 May 28 19:18 1_10530.arc.gz
    -rw-r----- 1 xxx dba 45972697 May 28 19:18 1_10605.arc.gz
    -rw-r----- 1 xxx dba 55082543 May 28 19:18 1_10600.arc.gz
    -rw-r----- 1 xxxq dba 42682207 May 28 19:19 1_10547.arc.gz
    thanks,
    baskar.l

  • Redo log sequence number

    hi everyone,
    I am looking at our SB system, and try to do only redo log backup. however it comes back with error message: The current redo log sequence number is not greater than the sequence number of the last saved offline redo log file.
    So, we suspect that since last refresh, we may reset the sequence back from 1.  Any one know how to solve this problem?  Thanks in advance.
    Amy

    Hi,
    Is your probh solved?
    Can u pl tell if u executed a recovery of database earlier?
    Pl check if there was a case of reset logs.
    To do this run BRTOOLS-->Instance Mgt->Show Inst Status.
    This will show if there was a case of reset logs.
    If it is so try the following:
    Shut down sap and the database.
    Look for a folder named oraarch
    Oracle/sid/oraarch
    Copy all the archive files to another folder and delete all the arc files from the oraarch folder.
    The name of the arch files will be like <SID>ARCHARC123456.001
    After copying to another location and subsequently deleting them from oraarch folders start up oracle in mount mode.
    Then issue the following sql
    alter database open resetlogs;
    then start sap.
    NB:Dont forget to take a complete backup before and after diong this.
    Hope this will help.
    Most probably your database contains two icarnations of redo log files so this error is comming.
    regards

  • Reg : I need to generate a file name sequence number.

    Dear All,
    I need to generate file name in sequence number. Now i have generated file in specific folder. In that folder file i am reading one by one and generating. Problem is folder file some names having special characte those names are not generating while reading 'Cat' Caommand in shell script. Instad of that i want to generate files in 1.ldt,2.ldt to etc..
    Please guide me how to generate in specific folder.
    Thanks in advance.
    Best Regards,
    Velu.

    First, LabVIEW 7 allows you to pass string and path data types directly into the Matlab script node. Otherwise, in LV <= 6.1 you can do the following:
    In LabVIEW, convert the string to an array of U8s using the String to Byte Array function. Then pass the U8 array into the Matlab script node as a Real Vector type. Finally, in Matlab, convert the Real Vector to a string using the char() function. For example:
    stringAsString = char(stringAsRealVector)
    Attached is an image that shows how to do this.
    Good luck,
    -Jim
    Attachments:
    Matlab_Script_Node_String_Input.GIF ‏6 KB

  • VT01N-Loading Sequence number functionality /BEV1/RPFLGNR in table VTTK.

    Hi Gurus,
    While creating shipment in VT01N, in the process screen, one field Sequence number: is showing by default Zero.
    Loading Sequence Number in the Tour /BEV1/RPFLGNR in table VTTK.
    Sequence number of the load in the tour.
    When will this sequence number will take running numbers like 1, 2 .. and so on.
    Could any body throw some light on this.
    Thanks&Regards
    Sreekanth

    No response

Maybe you are looking for