Tuesday, April 9, 2013

Distinct values in value set

There are multiple ways to define distinct values in custom value set.

Standard:
  1. Setting Allow Parent Values will make values distinct. Con is that it cannot be used in conjunction with ID in table column.


Custom
  1. Write distinct statement in the field where table name is entered, but this has a limitation to the number of characters that can be entered. so if query is long then you cannot make use of this feature.
  2. Create view based on your query with distinct values and use that view in the value set.
  3. Use of max rowid in where clause field

    SELECT ooh.order_number
    FROM oe_order_lines_all ool, oe_order_headers_all ooh
    WHERE ool.header_id = ooh.header_id
    AND ool.rowid= (SELECT max(rowid)
    FROM oe_order_lines_all oo11
    WHERE oo11.header_id = ooh.header_id);


No comments:

Post a Comment