Avoiding Duplicate Values Using LOV

Hi
I have the following code in WHEN_VALIDATE_ITEM trigger on a text item named REASON_ID.
------------------xxxxxxxxx--------------------------------
DECLARE
rg_id RecordGroup;
rec_count NUMBER;
BEGIN
-- Get the record group ID --
rg_id := Find_Group( 'REASONS_RG' );
-- Get the number of rows --
rec_Count := Get_Group_Row_Count( rg_id );
-- delete the selected row --
FOR j IN 1..rec_Count LOOP
If Get_Group_Number_Cell( 'REASONS_RG.ID', j ) = :PREF_REASONS_TO_JOIN.REASON_ID Then
Delete_Group_Row( rg_id, j );
exit ;
End if ;
END LOOP;
END;
-------------------------xxxxxxxxxxxxxx----------------------
Record Group REASONS_RG exists and contains ID in the SELECT statement.
LOV REASONS_LOV is working fine as expected.
Now When I click on this item REASONS_ID, LOV is displayed automatically and I select the record that I want. Then I press enter to change record and make another selection. This trigger should prevent me from selecting the same record twice (it should actually remove that record to be displayed in the LOV) right? But it doesn't work. I can still select the same record.
Can anyone help me with this please?
I got the above trigger code from this forum only and I guess many people have tried it and were able to restrict duplicates. I dont know what I am doing wrong here.
Thanks in advance

Hello,
Yes, the automatic refresh must be set to NO, else, the record group is re-populated each time.
Francois

Similar Messages

  • How to restrict the duplicate values in lov column of VO based Adv Table

    Hi Gurus,
    I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
    If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
    After the duplicate values have been removed, then the user can save all the values in the table.
    My Adv Table is based on a VO.
    The link how to restrict the duplicate values at form level
    talks about Adv Table based on a EoVO, which doesnot work in my case.
    My Approach,
    I am iterating through RowSetIterator and committing through PROCEDURE.
    I am able to avoid duplicate entry through a function checkRespId. (given below)
    Below code is for iterating and committing.
    public void saveline(String reqid,String userid)
    System.out.println("RequestId/saveline"+reqid);
    System.out.println("UserId/saveline"+userid);
    OAViewObject vo = (OAViewObject)getRespLineVO1();
    RespLineVORowImpl row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    System.out.println("Inside the for LOOP");
    row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
    String respoidid = row.getAttribute("ResponsibilityId")+"";
    String respname = row.getAttribute("ResponsibilityName")+"";
    String stdate = row.getAttribute("StartDate")+"";
    String enddate = row.getAttribute("EndDate")+"";
    String linestatus ="A";
    if(userid!=null)
    if(!(respoidid.equals("null")) && respoidid!=null)
    String checkingrespid=null;
    checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
    System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
    if(checkingrespid.equals("No"))
         String message, result = null;
    Connection txn = getOADBTransaction().getJdbcConnection();
    try
    calling PROC ...
    catch(Exception e)
    message = "Error in Inserting into line" + e;
    throw new OAException(message, OAException.ERROR);
    else
    throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
    else
    System.out.println("respoidid is null");
    break;
    deleteIter.closeRowSetIterator();
    public String checkRespId(String userid,String respoidid)
    String createRow="No";
    OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
    if (vo != null)
    vo.setWhereClauseParams(null);
    vo.setWhereClauseParam(0, userid);
    vo.setWhereClauseParam(1, respoidid);
    vo.executeQuery();
    System.out.println("ROW COUNT IS "+vo.getRowCount());
    if(vo.getRowCount()>0)
    createRow="Yes";
    else
    createRow="No";
    return createRow;
    Problem:
    I remove the duplicate entries and click on save and get this error.
    Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
    \nAction: Cancel the transaction and re-query the record to get the new data.
    Thanks,
    Sombit

    Hi Anil,
    I am trying out your code but stuck in inserting the rows
    using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
    I am always getting the same exception i.e COde blast in when I run.
    My modified code is:
    String[] as = null;
    Number[] vNumber = null;
    Number[] vNumberrespid = null;
    Number reqidnumber = null;
    reqidnumber = new Number(Integer.parseInt(reqid));
    Connection txn = getOADBTransaction().getJdbcConnection();
    String mCreateSearchRequestStatement = null;
    OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
    int j = vo.getFetchedRowCount();
    try
    System.out.println("abouce try");
    vo.reset();
    if (vo.getFetchedRowCount() > 0)
    System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
    int i = 0;
    as = new String[j];
    vNumber = new Number[j];
    vNumberrespid = new Number[j];
    while (vo.hasNext())
    vo.next();
    System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
    vNumber[i] = (reqidnumber);
    vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
    as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
    System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
    System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
    System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
    i++;
    CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
    ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
    cs.setArray(1, array);
    cs.setArray(2, arraynew);
    cs.setArray(3, array1);
    cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
    cs.execute();
    ARRAY error = null;
    error = (ARRAY)cs.getArray(2);
    if ((error != null) && (error.length() > 0))
    System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
    String[] retError = new String[j];
    retError = (String[])error.getArray();
    System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
    cs.close();
    catch (Exception exception)
    throw new OAException("code blast", OAException.ERROR);
    Thanks,
    Sombit

  • How to avoid duplicates values from alvgird see below code

    how to avoid duplicates values from alvgird see below code
    in below query docno no is repeated again and again
    how i can avoid duplication in this query.
    select * into corresponding fields of table itab
             from  J_1IEXCHDR
                     inner join  J_1IEXCDTL
                        on  J_1IEXCDTLlifnr =  J_1IEXCHDRlifnr
                     where  J_1IEXCHDr~status = 'P'.

    Hi Laxman,
    after that select statement
    select * into corresponding fields of table itab
    from J_1IEXCHDR
    inner join J_1IEXCDTL
    on J_1IEXCDTLlifnr = J_1IEXCHDRlifnr
    where J_1IEXCHDr~status = 'P'.
    <b>if sy-subrc = 0.
    delete adjucent duplicates from itab comparing <field name of itab internal table>
    endif.</b>
    this will delete your duplicate entries.once you done with this call the alv FM.
    <b>  call function 'REUSE_ALV_GRID_DISPLAY'</b>
    exporting
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = v_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = 'IT_USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       i_grid_title                      = 'Purchase Order Details'
      I_GRID_SETTINGS                   = I_GRID_SETTINGS
       is_layout                         = wa_layout
       it_fieldcat                       = it_fieldcat
      IT_EXCLUDING                      = IT_EXCLUDING
      IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS
       it_sort                           = it_sort
      IT_FILTER                         = IT_FILTER
      IS_SEL_HIDE                       = IS_SEL_HIDE
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        = IS_VARIANT
       it_events                         = it_event
      IT_EVENT_EXIT                     = IT_EVENT_EXIT
      IS_PRINT                          = IS_PRINT
      IS_REPREP_ID                      = IS_REPREP_ID
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   = IT_ALV_GRAPHICS
      IT_HYPERLINK                      = IT_HYPERLINK
      IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT
      IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO
      IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER
      ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER
        tables
    <b>      t_outtab                          = ITAB</b>
    exceptions
       program_error                     = 1
       others                            = 2
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Thanks
    Vikranth Khimavath

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

  • Avoid duplicate values in a row!

    Hi,
    I posted this query few days back and got the response to .. but now i am facing a new problem in this.. so let me explain this again,
    I have a table A as follows
    TableA
    ID data1 data2
    1 aa zz
    1 bb xx
    1 cc yy
    1 aa yy
    1 bb zz
    When i select data1 ColumnA, data2 ColumnB from TableA,
    I need it to be displayed in single row seperated by comma, is their any way to do it....
    ColumnA ColumnB
    aa,bb,cc zz,xx,yy
    So i got a response to use one of the technique suggested by,
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    I used the following function to achieve it..
    CREATE OR REPLACE FUNCTION get_data (p_id in tableA.id%TYPE)
    RETURN VARCHAR2
    IS
    l_text VARCHAR2(32767) := NULL;
    BEGIN
    FOR cur_rec IN (SELECT data1 FROM tableA WHERE id = p_id) LOOP
    l_text := l_text || ',' || cur_rec.data1;
    END LOOP;
    RETURN LTRIM(l_text, ',');
    END;
    The above function works .. brings all the data in the column in a single line.. but.. it has duplicates in that row.. how to avoid the duplicates it..
    i am getting OUTPUT as
    columnA ColumnB
    aa,bb,cc,aa,bb zz,xx,yy,yy,zz
    but i need it as follows
    ColumnA ColumnB
    aa,bb,cc zz,xx,yy
    How to avoid those duplicate values.. could some one help me around
    Thanks in advance
    -Preetha

    May be this can give you an idea to customize it for you!
    http://www.williamrobertson.pwp.blueyonder.co.uk/documents/one_row.html
    Sorry! I didn't know! It is the same example that is referred in both the links!
    Cheers
    Sarma.
    Message was edited by:
    Radhakrishna Sarma

  • HOW TO AVOID DUPLICATES WHILE USING VRM FM

    HI EXPERTS,
                      I AM USING VRM FM TO PASS VALUES INTO LISTBOX IN SCREENS.FIRST TIME IT IS WORKING PROPERLY WHEN I USE IT FOR THE SECOND TIME IT IS SHOWING THE PREVIOUS DATAS ENTRIES ALSO .HOW TO DELETE THE DUPLICATE ENTRIES OF IT .
    THIS IS MY CODE.
    when 'ENTER'.
          select POSNR ARKTX from LIPS into corresponding fields of table i_pstyp WHERE VBELN EQ VBELN.
          LOOP AT I_PSTYP .
            W_DDLIST-KEY = I_PSTYP-POSNR.
            W_DDLIST-TEXT = I_PSTYP-POSNR.
    APPEND W_DDLIST TO POSNR1.
    CLEAR W_DDLIST.
    CALL FUNCTION 'VRM_SET_VALUES'
            EXPORTING
              ID              = 'POSNR'
              VALUES          = POSNR1.
    IN THIS IF I SELECT NEXT VBELN WITHOUT EXITING FROM THE SCREEN THE PREVIOUS VBELN'S LINE ITEMS ALSO ARE DISPLAYING .WHAT SHALL I DO .
    MANI

    when 'ENTER'.
    select POSNR ARKTX from LIPS
           into corresponding fields of table i_pstyp
           WHERE VBELN EQ VBELN.
    LOOP AT I_PSTYP .
    W_DDLIST-KEY = I_PSTYP-POSNR.
    W_DDLIST-TEXT = I_PSTYP-POSNR.
    APPEND W_DDLIST TO POSNR1.
    CLEAR W_DDLIST.
    ENDLOOP. " Endloop here. the FM should not be called inside the loop
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = 'POSNR' " hope you are using the fieldname correctly
    VALUES = POSNR1.
    CLEAR : POSNR1. " this will stop repeating the values in your drop down list
    Regards
    Gopi

  • How do I avoid duplicates when using "Automatically Add to iTunes"

    I recently consolidated all my music and then created a new library in iTunes. Now I'm using the "Automatically Add to iTunes" folder when I find more music from my archives.
    However, unlike when importing from a CD, iTunes doesn't seem to compare to existing library and detect duplicates in songs in this folder; it just adds them to iTunes. So I am ending up with dups. Is there any way to avoid this?
    Specs: Mac Mini running OSX 10.8.5; iTunes v. 12.0.1.26

    See this Apple support document.
    http://support.apple.com/kb/ht1751
    B-rock

  • How to avoid Duplicate values in Oracle forms

    Hello Everyone,
    I am new to Oracle forms, working on Oracle Applications : 12.1.2,
    Here I have a form Receiving Transactions,
    in that I have Lot_Number and quantity columns.
    The purchased items need to be stored in Lot number.
    If 100 quantities purchased then 100 quantities can be stored in single lot number
    i.e
    Lot_Number         Qty
      001                100or 100 quantities can be stored in different lot numbers.
    i.e
    Lot_Number         Qty
      001                50
      002                50(The qty may differ)but not like the following,
    Lot_Number          Qty
      001                 50
      001                 50.For second line,If they selected same lot number as First lot number,
    The error message has to be shown as "Lot number duplicated,Select Different Lot number or update the full qty in original line".
    Can anyone help me to solve this.
    Thank you.
    Regards,
    Gurujothi

    Hi François Degrelle,
    I added the following Plsql in the 'When-validate-Item' block,
    declare
    l_current_number varchar2(80);
    begin     
    l_current_number := :lot_entry.lot_number;
    first_record;
    loop
      if l_current_number = :lot_entry.lot_number then
         message ('Duplicate');
      end if;
      next_record;
    end loop;Its started to check from First record itself and giving the message 'Duplicate',
    How to check from second record?
    when the first record is entered it should not check when the second record is entered it should compare with the First record value and if it is same then it should give message as 'Duplicate'.
    Thank you.

  • Avoid duplicate inserts using SQL statement?

    I have primary key on three columns and I want to write a sql statement to insert a row only if the matching three columns doesn't exist in the database.
    This is the condition I wrote but doesn't work. Could someone suggest me a query which meets this criteria.
    INSERT INTO JAVA_SERVICES (SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME,
      ROOT_PATH)
      VALUES ('AAAA', 'BBBB', 'CCCC', 'njdex') WHERE SERVICE_PAGE != 'AAAA' AND SERVICE_TYPE != 'BBBB' AND SERVICE_NAME != 'CCCC'Edited by: user626618 on Jun 12, 2009 2:39 PM

    you need to provide us more details such as what table name and column names are you using. using an insert into statement an example would be like:
    insert into java_services
    (service_page, service_type, service_name, root_path)
    select [column name], [column name], [column name]
      from [table name]
    where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                   from JAVA_SERVICES);
    begin
      for i in (select [column name] col1, [column name] col2, [column name] col3
                  from [table name]
                 where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                    from JAVA_SERVICES)) loop
        insert into java_services
          (service_page, service_type, service_name, root_path)
        values
          (i.col1, i.col2, i.col3);
      end loop;
    end;
    /

  • To avoid duplicate values in DrowpDownByIndex

    hi
    Iam calling an RFC ,it's output is as following
    column 1 column2
       A             2
       A              3
       A             42
       B              34
       B              3
       B              11
       B               0
    Iam displaying these values in two combo box. But my requirement is as following in first combobox if i select A ,only those values in column 2  which are mapped to A ie(2,3,42) should see in the combobox two.So pls help me i don't know how to do this iam a beginner in webdynprofor java.
    I'll give points.......

    Hi,
    You can loop through the node of combo box1:
    List attrList = new ArrayList();
    IPrivate<VIEW NAME>.I<NODE NAME>Element ele = null;
    for(int i = 0;i<wdContext.node<NAME>.size();i++){
        if(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>().startWith("A")){
            // ATTR_NAME1 is the attribute mapped to checkbox1.
            // create element of another attribute which should be mapped to checkbox2.
            ele = wdContext.create<NODE NAME>Element();
    ele.set<ATTR NAME2>(wdContext.node<NAME>().get<NAME>elementAt(i).get<ATTR_NAME1>());
            // ATTR_NAME1 is the attribute mapped to checkbox1.
    attrList.add(ele);
    wdContext.node<NAME>.bind(attrList);
    Hope this will solve your problem.
    thanks & regards,
    Manoj

  • Avoid Repating values using SQL

    Hi team,
    I have this issue here which i am finding difficult to handle it, after my stint with SAP,
    Case1
    Col1         col2          col3         Qty
    97812799     65021329     45019836     48492
    85001060     65021329     45019836     48492
    *Now i want that QTY column should only have single value i.e. 48492, either in first row or 2nd row doesnt matter, but we have have only one value*
    _expected result_
    Col1          col2         col3         Qty
    97812799     65021329     45019836     48492
    85001060     65021329     45019836     
    Case 2
    Col1          col2          col3         Qty
    85001133     65021369     45019878     76169
    85001132     65021369     45019878     76169
    97813988     65021369     45019878     76169
    97813003     65021369     45019878  76169
    Expected result
    Col1          col2         col3         Qty
    85001133     65021369     45019878     76169  --> could be anywhere in the record list, but need to have only 1 value
    85001132     65021369     45019878     
    97813988     65021369     45019878     
    97813003     65021369     45019878
    plz assist me here, or give me hints i would try my self,
    Kind regardsEdited by: Nicloei W on Apr 14, 2010 6:38 PM

    The column with the distinct values will be always the same (col1)?
    If so, could be this:
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    Connected as fsitja
    SQL>
    SQL> with t as (
      2  select 85001133 col1, 65021369 col2, 45019878 col3, 76169 qty from dual union all
      3  select 85001132, 65021369, 45019878, 76169 from dual union all
      4  select 97813988, 65021369, 45019878, 76169 from dual union all
      5  select 97813003, 65021369, 45019878, 76169 from dual union all
      6  select 97812799, 65021329, 45019836, 48492 from dual union all
      7  select 85001060, 65021329, 45019836, 48492 from dual
      8  )
      9  -- end of sample data
    10  SELECT col1, col2, col3, decode(rn, 1, qty) qty
    11    FROM (SELECT col1, col2, col3, qty, row_number() over(PARTITION BY col2, col3 ORDER BY col1) rn FROM t)
    12   ORDER BY col2, col3, col1;
          COL1       COL2       COL3        QTY
      85001060   65021329   45019836      48492
      97812799   65021329   45019836
      85001132   65021369   45019878      76169
      85001133   65021369   45019878
      97813003   65021369   45019878
      97813988   65021369   45019878
    6 rows selected
    SQL>

  • Colour duplicate values in html output

    Hello,
    I am looking to colour duplicate values in an html output file. 
    I have written a folder comparison ps script which shows output as below:
    Name Length Version
    Name length and version are the column names
    Now there are many duplicate entries under name column which I need to highlight using any one colour. I have sorted the output under name using alphabetical order.
    I just need to highlight all duplicate values using a particular colour. 
    Thanks in advance.

    Posting my script here:
    # Get Start Time
    $startDTM = (Get-Date)
    $a = "<style>"
    $a = $a + "BODY{background-color:peachpuff;}"
    $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
    $a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
    $a = $a + "</style>"
    $folderReference = Read-Host "Enter Reference Folder Name"
    $folderDifference = Read-Host "Enter Difference Folder Name"
    $FolderReferenceContents = Get-ChildItem $folderReference -Recurse | 
        where-object {-not $_.PSIsContainer}
    $FolderDifferenceContents = Get-ChildItem $folderDifference -Recurse | 
        where-object {-not $_.PSIsContainer}
    #get only files that are on reference folder not base folder
    $one = Compare-Object -ReferenceObject $FolderReferenceContents `
    -DifferenceObject $FolderDifferenceContents -Property ('Name', 'Length','Get-FileVersionInfo') -PassThru |
        where-object { $_.SideIndicator -eq '<='} | select Name, Length, LastWriteTime, VersionInfo
    #get only files that are on base folder not on reference
    $two = Compare-Object -ReferenceObject $FolderReferenceContents `
    -DifferenceObject $FolderDifferenceContents -Property ('Name', 'Length','Get-FileVersionInfo') -PassThru |
        where-object { $_.SideIndicator -eq '=>'} | select Name, Length, LastWriteTime, VersionInfo
    $three = $one + $two | sort-object -property Name | ConvertTo-HTML -Fragment 
    # Get End Time
    $endDTM = (Get-Date)
    # Echo Time elapsed
    $four = "Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds"
    ConvertTo-HTML -Head $a -Body "$one $two $three $four" -Title "Output" | Out-File C:\output.html

  • How to avoid duplicates in LOV

    Hi, i'm using search query component (11g) and for the search fields i'm adding LOV. In the UI , i can see the LOV with values from the table. But i need to avoid the duplicates in this . Looked at the docs and demo and i couldn't figure out anything. Could some one point me a resource. Thanks.

    How do you create the LOV then?
    To make a view object with a lov you need two viewObjects - let us say viewObject and viewObjectLOV.
    viewObject is updatalbe, viewObjectLOV is not.
    Your problem is that viewObjectLOV returns duplicate values.
    1. find where is the viewObjectLOV, you can reach it via viewObject's accessor
    2. make sure it has a primary key.
    3. modify viewObjectLOV's query so it does not return duplicate values, for example using distinct keyword.
    0. If you did not understand what I tried to explain, maybe you should read some more documentation first :)

  • How to avoid the duplicate values, I do not want the duplicate............

    i have one database table called "sms1" that table is updated every day or on daily basis it has the following fields in it:
    SQL> desc sms1;
    Name Null? Type
    MOBILE NUMBER
    RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)
    SNO NUMBER
    INDATE DATE
    From this table the is one column "RCSTCNATCNATCNATCNAWTHER VARCHAR2(39 CHAR)" . I am splitting it into different columns like :
    SQL> desc smssplit;
    Name Null? Type
    R VARCHAR2(2 CHAR)
    C VARCHAR2(2 CHAR)
    S VARCHAR2(1 CHAR)
    TC VARCHAR2(3 CHAR)
    NA VARCHAR2(3 CHAR)
    TC2 VARCHAR2(3 CHAR)
    NA2 VARCHAR2(3 CHAR)
    TC3 VARCHAR2(3 CHAR)
    NA3 VARCHAR2(3 CHAR)
    TC4 VARCHAR2(3 CHAR)
    NA4 VARCHAR2(3 CHAR)
    WTHER VARCHAR2(10 CHAR)
    SNO NUMBER
    INSERTDATA VARCHAR2(25 CHAR)
    Now I am written a procedure to insert the data from "Sms1" table to smssplit table...
    CREATE OR REPLACE PROCEDURE SPLITSMS
    AS
    BEGIN
    INSERT INTO scott.SMSSPLIT ( R,C,S,TC,NA,TC2,NA2,TC3,NA3,TC4,NA4,WTHER,SNO)
    SELECT SUBSTR(RCSTCNATCNATCNATCNAWTHER,1,2) R,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,3,2) C,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,5,1) S,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,6,3) TC,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,9,3) NA,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,12,3) TC2,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,15,3) NA2,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,18,3) TC3,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,21,3) NA3,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,24,3) TC4,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,27,3) NA4,
    SUBSTR(RCSTCNATCNATCNATCNAWTHER,30,10) WTHER, SNO
    FROM scott.SMS1 where SNO=(select MAX (sno) from SMS1);
    END;
    Now in order to update the second table with data from first table on regular basis I have written a job scheduler and I am using oracle 9.0. version...
    DECLARE
    X NUMBER;
    JobNumber NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    job => X
    ,what => 'scott.SPLITSMS;'
    ,next_date => SYSDATE+1/1440
    ,interval => 'SYSDATE+1/1440 '
    ,no_parse => FALSE
    :JobNumber := to_char(X);
    END;
    Now this job scheduler is working properly and updating the data for every one minute but it is taking or updating the duplicate values also ..like example:
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:49:16
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:49:16
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:50:17
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:50:17
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:51:19
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:51:19
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:52:20
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:52:20
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:53:22
    R C S TC NA TC2 NA2 TC3 NA3 TC4 NA4 WTHER SNO
    INSERTDATA
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:53:22
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:54:45
    33 35 2 123 456 789 543 241 643 243 135 RRRRRR 55
    06-SEP-2012 03:54:45
    Now I do not want the duplicate values to be updated ...and want them to ignore them.....
    please I need a help on this query........How to avoid the duplicate values............

    Look at the posts closely:might not be needed if formatted ;)
    create or replace procedure splitsms as
    begin
      insert into scott.smssplit (r,c,s,tc,na,tc2,na2,tc3,na3,tc4,na4,wther,sno)
      select substr(rcstcnatcnatcnatcnawther,1,2) r,
             substr(rcstcnatcnatcnatcnawther,3,2) c,
             substr(rcstcnatcnatcnatcnawther,5,1) s,
             substr(rcstcnatcnatcnatcnawther,6,3) tc,
             substr(rcstcnatcnatcnatcnawther,9,3) na,
             substr(rcstcnatcnatcnatcnawther,12,3) tc2,
             substr(rcstcnatcnatcnatcnawther,15,3) na2,
             substr(rcstcnatcnatcnatcnawther,18,3) tc3,
             substr(rcstcnatcnatcnatcnawther,21,3) na3,
             substr(rcstcnatcnatcnatcnawther,24,3) tc4,
             substr(rcstcnatcnatcnatcnawther,27,3) na4,
             substr(rcstcnatcnatcnatcnawther,30,10) wther,
             sno
        from scott.sms1 a
       where sno = (select max(sno)
                      from sms1
                     where sno != a.sno
                   ); ---------------> added where clause with table alias.
    end;Regards
    Etbin

  • How can i populate records using LOV value in form 6i

    Create a form based on the following output use EMP Table
    Create a non Database Block i.e Control Block----> Dept No
    Create a Database Block -EMP
    Create an LOV for the Dept no from dept table.
    For the Current Dept No . Populate the Employee Records
    How can i populate records using LOV value????
    thanks

    How can i populate records using LOV value in form 6i Start by posting in the correct forum: {forum:id=82}
    (Seriously: after making all your previous posts in the Forms forum, how do you end up posting in this one? Is it because the Forms forum has changed category?)

Maybe you are looking for

  • Error Installing 10g on Windows XP

    hello all.. Iam installing ORacle10g on WinXP. After selecting the Installation type as " Personal Edition" option, i get an error message " Thrown when the ip address of the host cannnot be determined" and it gives me 4 options.. Retry, cancel, help

  • Personalization in header region not reflecting

    I am trying to personlize a field in the header region for the Change Location function. I tried changing the CSS style to OraErrorText for the Message Styled Text: Effective as of Approval Date field in the Page: /oracle/apps/per/selfservice/locatio

  • Install Logic X, then Un-install Logic 9

    So, downloaded Logic X and MainStage 3 last night after living with Logic 9 for a a while. All good, all great; even sounds better than the last version. But: it's eventually going to download content to my computer, and currently I'm a bit hard up f

  • Change movie language

    I rent a film and saw a turkish languange selection but not able to watch the film in Turkish. i am using my AppleTv in Turkey wth ny Turkish Apple acccount and i bought a film before for my doughter and she watched it in Turkish. does anybody help m

  • Sync Log

    I've set my Itunes 10.1 to sync one my photo folder Into this folder there are 158 files .jpg When i click sync button, itunes work for 1 minute and does'nt show any errors but on my Iphone 4 there are'nt new pic files ! Itunes save a log file to und