Need help in sorting a alphanumeric DB column in BO report.

Hi All,
We have a DB column (Data type = varchar2).. with values..
1                               
1
1.1
1.1.1
1.1.1.1
1.2
1.2.1
1.3
1.3.1
1.3.1.1.1
Desired
1
1.1
1.1.1
1.1.1.1
1.2
1.2.1
1.3
1.3.1
1.3.1.1.1
2
etc..
We need to sort this column in BO report.. any idea..  we have sorted it in the Query which is giving right output in pl/sql developer but in BO sorting is not showing properly.
Could you help please to achieve this?
Thanks and Regards,
Priyashree

The Record Sort Expert appears when you choose the Record Sort Expert command from the Report menu.
Use the Record Sort Expert to define how you want the records in your report to be sorted for printing. You can add and remove a sort field and define the sort direction (ascending or descending) for the data in your report.
In my version Record Sort appears as a   A over a Z with Arrows pointing from A to Z, and Z to A.  It is next to group expert, which looks like a mountain with an arrow pointing up.  Both are on the "Expert" tool bar.

Similar Messages

  • Need help in sorting a column in classic report

    Hi I am trying to create and classic report and I need to do sorting on the columns. Also I am using a select list to filter the records in the column. When I am not using the select list the sorting is working but when I am using the selcet list and select the sort option then it is showing error. Can anyone help...
    Thnaks,
    Rik

    Select lists prior to v4 will sort on the return value. In v4, it sorts on the display value (as you're probably expecting). There's nothing really for you to fix here except if it's really important, see if you can get upgraded to v4.

  • Need help to show a thumbnail image column in report

    Hi, Gurus:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    I am using APEX 4.1, Oracle 11gR2
    Here is my table:
    CREATE TABLE "SORS"."SOR_IMAGE"
       (     "IMAGE_ID" NUMBER(10,0),
         "OFFENDER_ID" NUMBER(10,0) NOT NULL ENABLE,
         "IMAGE" BLOB CONSTRAINT "SOR_IMAGE" NOT NULL ENABLE,
         "THUMBNAIL" BLOB,
         "MIME_TYPE" VARCHAR2(50 BYTE),
          CONSTRAINT "SOR_IMAGE_PK" PRIMARY KEY ("IMAGE_ID")
    )Here is my procedure:
    create or replace
    procedure dl_sor_thumbnail (p_offender_id IN NUMBER) as
       v_mime_type VARCHAR2(48);
       v_length NUMBER;
       v_name VARCHAR2(2000);
       v_image BLOB;
    BEGIN
      SELECT 'IMAGE/JPEG', dbms_lob.getlength(thumbnail), thumbnail
      INTO v_mime_type, v_length, v_image
      FROM sor_image
      WHERE offender_id = p_offender_id
      and image_id = (select max(image_id)from sor_image where offender_id = p_offender_id) ;
    -- setup the HTTP headers
    owa_util.mime_header(nvl(v_mime_type, 'application/octet'), FALSE);
    htp.p('Content-length: '||v_length);
    --htp.p('Content-Disposition: attachment; filename="' || substr(v_name, instr(v_name,'/') + 1) || '"');
    --htp.p('Content-Disposition: attachment; filename="'somemmmmmfilename.jpg'");
    -- close the headers
    owa_util.http_header_close;
    -- download the Photo blob
    wpg_docload.download_file (v_image);
    END dl_sor_thumbnail;here is my report:
    select distinct 'MAP', '<img src="#OWNER#.dl_sor_thumbnail?p_offender_id='||so.offender_ID||'"/>' detail,
    so.doc_number as "DOC Number", so.offender_id as "Offender_ID", so.first_name||' '|| so.middle_name||' '||so.last_name as "Offender Name",
    so.checksum as "checksum",
    so.last_name as "Last Name",
    so.first_name||' '|| so.middle_name as "First Name",
    (select sc1.description from sor_code sc1 where sc1.code_id=so.race) as "Race",
    (select sc2.description from sor_code sc2 where sc2.code_id=so.sex) as "Sex",
    (select sc8.description from sor_code sc8 where sc8.code_id=so.hair_color) as "Hair Color",
    (select sc9.description from sor_code sc9 where sc9.code_id=so.eye_color) as "Eye Color",
    replace(replace(nvl2(sl.address1, sl.address1||' '||sl.address2 ||' '||sl.city ||' '||sl.county||' '||(select sc3.description from sor_code sc3 where sc3.code_id=sl.state)||' '||sl.zip, '-'),'#'),',') as "Address",
    replace(replace(nvl2(sl.physical_address1,sl.physical_address1||' '||sl.physical_city ||' '||sl.physical_county||' '||(select sc4.description from sor_code sc4 where sc4.code_id=sl.physical_state)||' '||sl.physical_zip, '-'),'#'),',')  as "Physical Address",
    sl.status as "Status",
    to_char(sl.ADDRESS1_LATITUDE) as "Address Latitude",to_char(sl.address1_longitude) as "Address Longitude",
    to_char(sl.physical_address_latitude) as "Physical Latitude",to_char(sl.physical_address_Longitude) as "Physical Longitude",
    decode(rox.habitual, 'Y', 'Habitual', '') as "Habitual",
    decode(rox.aggravated, 'Y', 'Aggravated', '') as "Aggravated"
    from sor_location sl, sor_offender so, registration_offender_xref rox, sor_last_locn_v sllv
    where rox.offender_id=so.offender_id
    and sllv.offender_id(+)=so.offender_id
    and sl.location_id(+)=sllv.location_id
    and rox.status not in ('Merged')
    and rox.REG_TYPE_ID=:F119_REG_ID
    and upper(rox.status)='ACTIVE'
    and nvl(rox.admin_validated, to_date(1,'J'))>=nvl(rox.entry_date, to_date(1,'J'))
    and (((select sc11.description from sor_code sc11 where sc11.code_id=so.race and sc11.code_id=:P5_SL_RACE) is not null ) or (:P5_SL_RACE is null))
    and (((select sc12.description from sor_code sc12 where sc12.code_id=so.sex and sc12.code_id=:P5_SL_SEX) is not null ) or (:P5_SL_SEX is null))
    and (((select sc13.description from sor_code sc13 where sc13.code_id=so.hair_color and sc13.code_id=:P5_SL_HAIR_COLOR) is not null ) or (:P5_SL_HAIR_COLOR is null))
    and (((select sc14.description from sor_code sc14 where sc14.code_id=so.eye_color and sc14.code_id=:P5_SL_EYE_COLOR) is not null ) or (:P5_SL_EYE_COLOR is null))
    and (exists ( (select sm.offender_id from sor_mark sm, sor_code sc15 where sm.offender_id=so.offender_id and  sc15.code_id=sm.code and sc15.code_id=:P5_SL_OTHER_MARKS  and sm.description is not null) ) or (:P5_SL_OTHER_MARKS is null))
    and ((exists (select sm1.description from sor_mark sm1 where sm1.offender_id=so.offender_id and upper(sm1.description) like upper('%'||:P5_TF_OTHER_MARKS_DESCRIPTION||'%'))) or (:P5_TF_OTHER_MARKS_DESCRIPTION is null))
    and ((floor(to_number(sysdate-so.date_of_birth)/365)-:P5_TF_AGE between -5 and 5) or (:P5_TF_AGE is null))
    and ((to_number(:P5_TF_HEIGHT_FEET)*12+to_number(nvl2(:P5_TF_HEIGHT_INCHES, :P5_TF_HEIGHT_INCHES, '0')-(floor(so.height/100)*12+mod(so.height, 100))) between -6 and 6) or (:P5_TF_HEIGHT_FEET is null))
    and ((so.weight-:P5_TF_WEIGHT between -25 and 25) or (:P5_TF_WEIGHT is null))and I set detail column as standard report column.
    however, the report shows no image, just an icon which indicates the image is not available. Would anyone help me on this problem?
    Thanks a lot.
    Sam
    Edited by: lxiscas on Apr 16, 2013 1:59 PM

    lxiscas wrote:
    I need to display a column of thumbnail images in a classical report. I follow the thread https://kr.forums.oracle.com/forums/thread.jspa?threadID=2201667
    Bad choice. Only one person involved in that thread knew what they were doing...and you copied from the wrong one.
    Here is my procedure:Lose it. Custom download procedures are overcomplicated and now almost never required.
    See the recommendation to use declarative BLOB support, as shown in the Thumbnail image problems.

  • Need to fix the width of a column in interactive report

    Hi,
    I have a column named 'Comment'. Its have a huge data due to which the lenght of that column in interactive report get increased. I need to fix the length to a desired value.
    I used following code in Region Footer:
    <style>
    table.apexir_WORKSHEET_DATA td[headers=COMMENTS] {
      _width: 300px;
      min-width: 50px;
      max-width: 300px }
    </style>
    Its solved the problem by fixing the width of the column but the column is not showing the full data now. It is hiding most of its part to fit it in that column.
    Please give some idea.
    Thanks,
    Chandru

    Hi,
    I believe you will want to add a height specification to allow for multiple lines.  And you may want/need to specifiy how you want lines to wrap.
    Add (for example):
      height: 60px; 
      white-space: nowrap; 
      word-wrap: break-word;
    There are defaults and several options for white-space and word-wrap.  You may want to look them up and give them a try for comparison.
    Howard

  • Need help with sort

    I need to do an iterate thru records and then allow end user to sort by clicking on table cell header ex.
    name employeenumber dept social sec are the headers. a search is performed and brings back employee name, etc and fills a table cell. the column headers are clicked and results are displayed based on that header. I need to build a way to iterate (which I have) but need to sort also. any suggestions?

    If you're using SQL to pull back your data I would recommend passing an "orderBy" flag when you click on the column heading. Then in your Java code that calls your SQL you can set the "Order By" value to a field name and your data will come back sorted. This would be my first suggestion.
    If this doesn't work for you, take a look at the java.util.Comparator interface.
    Hope this helps!
    DesQuite

  • Hi i need help in  sort in out issue in worflow in sap EDI

    i sap gurus
    i have two issues in sap workflow .can u guys help me out in sorting out these issues.
    1) When checking out/reserving a work flow item(TC: SBWP), there is no option to display who has it checked out. When the workflow item is reserved, it is removed from everyone elses workflow list. It can happen that people put these back at the end of the day, when there is no time to work on them any longer. <b>It would be a great help to have visability to all items even if they are reserved, and to have a name associated with it to see who has it reserved.</b>
    2) In the "Change Layout" option of work flow (TC:SBWP), there are dynamic fields that look like they could be assigned. Perhaps one of these could be used for the person doing the reserving, but in addition to this, i<b>t would be very helpful if customer number could also be populated in one of these fields. This would allow sales specialist to pick up work flow items by customer.</b>
    thanks in advance
    sam sd

    Hi Sam,
    As far your first requirement concerned,I don't think it is possible.
    because reserveing of workitem is to prevent other users from executing it.
    So you can't just have the workitems only for display in other users inbox even after someone else reserved it.It defeats the own purpose.
    I would suggest you to go for a report kinda tool where you can actually help the users have the visibility.
    About second one,you use tcode SWL1 to define the dynamic columns and enter the container elemet ther to have the customer number displayed.

  • Needed help in sorting values in StringBuffer

    Hi,
    I will get a StringBuffer as an input which contains lines in different order,
    Please refer the below example
    "A,B,C,D, LINE_NO=1"
    "E,F,G,H, LINE_NO=8"
    "I,J,K,L, LINE_NO=6"
    "M,N,O,P, LINE_NO=3"
    All the above four lines will be in the StringBuffer based on the above order,
    I need to create a new StrinBuffer order by Line_No.
    Can anyone help me on this..?

    Steps
    1) Split the StringBuffer content into an array containing the lines. You can use String.split() to do this.
    2) Create a java.util.Comparator that takes two lines and returns -1 if the first should be earlier than the second, zero if the two lines are considered equal and +1 if the second should be earlier than the first.
    3) Sort the array using java.util.Arrays.sort(array, comparator);
    4) Build a new StringBuffer from the sorted array.

  • Hi i need help in  sort in out issue on BOM

    hi Sapgurus
    i nedd to configure the following scenerio
    i need a sales BOM that drives the demand- <b>the subitems should drive the demand</b>. can anybody plz gimme the step by step to configure the above scenerio.
    thanks in advance
    samsd

    Hi,
    1. MM01 - select the header item, in the item category field in BASIC DATA-1 screen change from NORM to LUMF. Similarly change this in the SALES:Slaes Org. 2 screen also. Beacause of this now the pricing will be done at the <b>sub items level</b> and no at the <b>header item level</b>.
    2. Go to CS01 - create the sales order BOM. In usage select 5 - sales & distribution. For the sub items <b>select item category as "L"-stock item.</b>
    3. When the sales order is created the pricing will be done at the sub items level.
    ITEM CATEGORY IN CASE OF PRICING AT HEADER ITEM LEVEL:
    For header item: TAQ
    For sub items: TAE
    ITEM CATEGORY IN CASE OF PRICING AT SUB ITEM LEVEL:
    For header item: TAP
    For sub items: TAN
    REGARDING DEMAND-
    Go to transaction code VOV7 select item category as "TAP" here in the bill of material/configuration section in the delivery group select "X"
    Because of this unless and until all the sub itams are ready in stock the delivery of the main item will not be possible.
    Reward points if solution helps.
    Regards,
    Allabaqsh G. Patil

  • Need help in solving conversion row to columns issue

    Hi friends
    I came across a strange situation/ problem. The problem is in one table say source_metadata
    I have 4 attribute
    matching_Table matching_columns source_table source_col
    OTREDW.PARTY_ALT_ID Src_key rcw Source_key
    OTREDW.PARTY_ALT_ID party_id rcw party_id_org
    otredw.individual SRC_KEY
    otredw.individual name rcw name_org
    otredw.individual name rcw name_mod
    otredw.wage_fact src_key
    otredw.wage_fact wages_tips rcw wage_tips_org
    otredw.wage_fact wages_tips rcw wage_tips_mod
    The matching tables and source table can be matched on src_key/source_key
    I need to fetch the values from the respective tables / columns in one query. I have just faint idea to the solution is use of PIVOT feature.
    The desired OUTPUT is
    PARTY_ID PARTY_ID_ORG Name name_org name_mod wages_tips wages_tips_org wages_tips_mod
    1111111 1111111 James James JamesR 1000 1000 2000
    I hope I have explained what I need. I will appreciate If anyone will be able to show me the way how to resolve this issue.
    Thanks
    Rajesh

    Thanks everone for sending me the answer but I think I am unable to explain my issue.
    The main issue is I am storing the name of the table and name of the corresponding column of the table under different columns of the table. How to fetch the data using a sql from these columns.
    EXAMPLE
    METADATA_TABLE
    table_name Column_name
    OTREDW.PARTY_ALT_ID PARTY_ID
    OTREDW.INDIVIDUAL NAME
    OTREDW.WAGE_FACT WAGES_TIPS
    How to write query to fetch the table_name and column_name from metadata_table and fetch the data from the respective tables mentioned in the table columns?
    I hope I was able to explain the question now.
    Thanks
    Rajesh

  • Need Help'bout Sort with Comparator!!

    First of all, the object that Im using is named as "Node". This object has String name, int Value and some kinda things.
    In the code below, I made one demantion object array ( Node[]) and filled it with unordered objects. And now I want to sort it by "int Value". There is a function "getVal()" which returns int Value.
    Node[] arrlist = new Node[size];
    Collect(current, arrlist); <-- this one collects unordered objects
    java.util.Collections.sort(arrlist, new Comp());
    and the class Comp is below
    import java.util.*;
    class Comp implements Comparator {
         public int compare(Object o, Object p){
              int answer = 0;
              if (o == p) {
                   return 0;
              int node1 = ((Node)o).getVal();
              int node2 = ((Node)p).getVal();
              return node1 - node2;
    I dont know much about the comparator. I dont even know what to return in thecomparator class. please help me guys!

    You are on the right track. In the compartor, you have to return a negative value, 0 or a possitive value depending on the two values you compare..
    some thing like this
    public int compare(Object o, Object p){
    //.... your codes here
    int node1 = ((Node)o).getVal();
    int node2 = ((Node)p).getVal();
    if( node1 < node2 )
    return -1
    else
    if( node1 > node2 )
      return 1;
    else
    return 0;
    [url http://www.feedfeeds.com/feedtv]FeedTV

  • Need Help: Use Combox Box + List Builder + Column chart!

    Hi experts,
    I'm a novice in Xcelsius but i met some problems in encountering it, therefore, i would like to seek some assistance from the experts, Thanks!
    These are my data for F1 race. And I have 10 years data and below is an example of my data. I would be using 2 years data as an example first.
    Year     Country      Driver     Point     Laps     Time/Retired     No.of Driver     Position
    2009     Australia     Jenson Button     10     58     1:34:15.784     22     1
    2009     Australia     Rubens Barrichello     8     58     +0.8s     23     2
    2009     Australia     Jarno Trulli     6     58     +1.6s     9     3
    2009     Australia     Timo Glock     5     58     +4.4s     10     4
    2009     Australia     Fernando Alonso     4     58     +4.8s     7     5
    2009     Malaysia     Jenson Button     5     31     55:30.622     22     1
    2009     Malaysia     Nick Heidfeld     4     31     +22.7s     6     2
    2009     Malaysia     Timo Glock     3     31     +23.5s     10     3
    2009     Malaysia     Jarno Trulli     2.5     31     +46.1s     9     4
    2009     Malaysia     Rubens Barrichello     2     31     +47.3s     23     5
    2009     China     Sebastian Vettel     10     56     1:57:43.485     15     1
    2009     China     Mark Webber     8     56     +10.9s     14     2
    2009     China     Jenson Button     6     56     +44.9s     22     3
    2009     China     Rubens Barrichello     5     56     +63.7s     23     4
    2009     China     Heikki Kovalainen     4     56     +65.1s     2     5
    2009     Bahrain      Jenson Button     10     57     1:31:48.182     22     1
    2009     Bahrain      Sebastian Vettel     8     57     +7.1s     15     2
    2009     Bahrain      Jarno Trulli     6     57     +9.1s     9     3
    2009     Bahrain      Lewis Hamilton     5     57     +22.0s     1     4
    2009     Bahrain      Rubens Barrichello     4     57     +37.7s     23     5
    2009     Spain     Jenson Button     10     66     1:37:19.202     22     1
    2009     Spain     Rubens Barrichello     8     66     +13.0s     23     2
    2009     Spain     Mark Webber     6     66     +13.9s     14     3
    2009     Spain     Sebastian Vettel     5     66     +18.9s     15     4
    2009     Spain     Fernando Alonso     4     66     +43.1s     7     5
    2009     Monaco     Jenson Button     10     78     1:40:44.282     22     1
    2009     Monaco     Rubens Barrichello     8     78     +7.6s     23     2
    2009     Monaco     Kimi Raikkonen     6     78     +13.4s     4     3
    2009     Monaco     Felipe Massa     5     78     +15.1s     3     4
    2009     Monaco     Mark Webber     4     78     +15.7s     14     5
    2009     Turkey     Jenson Button     10     58     1:26:24:848     22     1
    2009     Turkey     Mark Webber     8     58     +6.7s     14     2
    2009     Turkey     Sebastian Vettel     6     58     +7.4s     15     3
    2009     Turkey     Jarno Trulli     5     58     +27.8s     9     4
    2009     Turkey     Nico Rosberg     4     58     +31.5s     16     5
    2010     Bahrain      Fernando Alonso     25     49     1:39:20.396     8     1
    2010     Bahrain      Felipe Massa     18     49     +16.0s     7     2
    2010     Bahrain      Lewis Hamilton     15     49     +23.1s     2     3
    2010     Bahrain      Sebastian Vettel     12     49     +38.7s     5     4
    2010     Bahrain      Nico Rosberg     10     49     +40.2s     4     5
    2010     Australia     Jenson Button     25     58     1:33:36.531     1     1
    2010     Australia     Robert Kubica     18     58     +12.0s     11     2
    2010     Australia     Felipe Massa     15     58     +14.4s     7     3
    2010     Australia     Fernando Alonso     12     58     +16.3s     8     4
    2010     Australia     Nico Rosberg     10     58     +16.6s     4     5
    2010     Malaysia     Sebastian Vettel     25     56     1:33:48.412     5     1
    2010     Malaysia     Mark Webber     18     56     +4.8s     6     2
    2010     Malaysia     Nico Rosberg     15     56     +13.5s     4     3
    2010     Malaysia     Robert Kubica     12     56     +18.5s     11     4
    2010     Malaysia     Adrian Sutil     10     56     +21.0s     14     5
    2010     China     Jenson Button     25     56     1:46:42.163     1     1
    2010     China     Lewis Hamilton     18     56     +1.5s     2     2
    2010     China     Nico Rosberg     15     56     +9.4s     4     3
    2010     China     Fernando Alonso     12     56     +11.8s     8     4
    2010     China     Robert Kubica     10     56     +22.2s     11     5
    2010     Spain     Mark Webber     25     66     1:35:44.101     6     1
    2010     Spain     Fernando Alonso     18     66     +24.0s     8     2
    2010     Spain     Sebastian Vettel     15     66     +51.3s     5     3
    2010     Spain     Michael Schumacher     12     66     +62.1s     3     4
    2010     Spain     Jenson Button     10     66     +63.7s     1     5
    2010     Monaco     Mark Webber     25     78     1:50:13.355     6     1
    2010     Monaco     Sebastian Vettel     18     78     +0.4s     5     2
    2010     Monaco     Robert Kubica     15     78     +1.6s     11     3
    2010     Monaco     Felipe Massa     12     78     +2.6s     7     4
    2010     Monaco     Lewis Hamilton     10     78     +4.3s     2     5
    2010     Turkey     Lewis Hamilton     25     58     1:28:47.620     2     1
    2010     Turkey     Jenson Button     18     58     +2.6s     1     2
    2010     Turkey     Mark Webber     15     58     +24.2s     6     3
    2010     Turkey     Michael Schumacher     12     58     +31.1s     3     4
    2010     Turkey     Nico Rosberg     10     58     +32.2s     4     5
    2010     Canada     Lewis Hamilton     25     70     1:33:53.456     2     1
    2010     Canada     Jenson Button     18     70     +2.2s     1     2
    2010     Canada     Fernando Alonso     15     70     +9.2s     8     3
    2010     Canada     Sebastian Vettel     12     70     +37.8s     5     4
    2010     Canada     Mark Webber     10     70     +39.2s     6     5
    2010     Europe     Sebastian Vettel     25     57     1:40:29.571     5     1
    2010     Europe     Lewis Hamilton     18     57     +5.0s     2     2
    2010     Europe     Jenson Button     15     57     +12.6s     1     3
    2010     Europe     Rubens Barrichello     12     57     +25.6s     9     4
    2010     Europe     Robert Kubica     10     57     +27.1s     11     5
    Basically, my requirement is to have year 2009 and 2011 in my component "Combo Box" and when user choose Year 2010, the source data under the component "List builder" shows the FILTERED countries (since i have duplicated countries here) under year 2010 only.
    So user can choose the correct countries and view the details of the countries that he/she choose for year 2010 at the column chart.
    Pls feel free to clear your doubts if any.
    Your assistance will be appreciated!!
    Thanks alot!
    Best regards,
    htoh

    Hi Sanjay,
    Appreciate your quick response.
    However this is what i've set for my combo box and list builder:
    Combo box:
    Insertion Type: Filtered rows
    Source data: Column A & B (Year,Country)
    Destination: Some empty cells
    List builder:
    Insertion type: Row (I can't find Filtered rows as an option)
    Source data: From the empty cells i mentioned above ***
    Destination: Another Empty cells.
    Is there anything wrong with my settings? Pls help, thanks a lot!
    Best regards,
    htoh

  • Need help to sort out photos

    Hi all,
    I just cant figure out something: I have about 3000 photos in my laptop, all in alphabetical order. When I sync them in my iPhone, they never appear sorted in alphabetical order but all mixed up. Anyone could help me to understand what I'm missing?

    iTunes stores the photos within each album chronologically. Even though you can re-order your photos within Photoshop Album or Photoshop Elements, iTunes ignores the order and simply sorts the photos chronologically.
    Knowing this, however, if you really want your photos sorted in a different order, there are a number of applications out there that will allow you to modify the timestamps of these photos - in fact, Photoshop Elements allows you to do this. As expected, if you change the timestamps, you will change the sort order.

  • Need help w/ sorting

    I am unable to turn off manual sort (the option is in lighter font and doesn't respond). I need to sort in ascending order, for some reason my folders have jumbled.
    I have tried to update to the new Lion, but due to extreme slowness of the internet in the house where I am house sitting it keeps quitting after 20 hrs.  Not sure if that contributed to the issue.
    Thanks for any help

    What are you sorting? Manual sorting is only available in Albums.

  • Need help with sorting records in primary and secondary databases

    Hi,
    I would like to store data into primary and secondary db in different order. For the main primary, I want it to be ordered by login_ts instead of uuid which is the key.
    For the user secondary database, I want it to be ordered by sip_user. For the timestampe secondary db, I want it to be ordered by login_ts.
    This is what I have right now,
    this is for main
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    this is for user search
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    this is for timestamp
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200003 login_ts=1264327688 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    but what I want is :
    this is for main
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200004 login_ts=1264327618 logout_ts=
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200005 login_ts=1264327688 logout_ts=
    this is for user search
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200003 login_ts=1264327630 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200004 login_ts=1264327618 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200004 login_ts=1264327688 logout_ts=
    this is for timestamp
    uuid=e2f9a3cb-02d1-47ff-8af8-a3a371e20b5 sip_user=200003 login_ts=1264327613 logout_ts=
    uuid=e1846e4a-e1f5-406d-b903-55905a2533a sip_user=200003 login_ts=1264327618 logout_ts=
    uuid=029ae227-a188-4ba8-aea4-7cbc26783d6 sip_user=200004 login_ts=1264327630 logout_ts=
    uuid=22966f76-8c8a-4ab4-b832-b36e8f8e14d sip_user=200004 login_ts=1264327688 logout_ts=
    Right now, I have:
    int compare_login_ts(dbp, a, b)
         DB *dbp;
         const DBT a, b;
         int time_a = 0;
         int time_b = 0;
         time_a = atoi ( (char *)a->data);
         time_b = atoi ( (char *)b->data);
         return time_a - time_b ;
    for the timestamp secondary, I set that compare function:
              if ((ret = (*sdb)->set_bt_compare(*sdb , compare_login_ts )) != 0){
    Does anyone know how can I make it sorted according?

    Hi,
    The DB->set_bt_compare() is used to compare keys in Btree database. In the callback function, both the DBTs are key, but not data. Please refer to http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/dbset_bt_compare.html.
    If you want any field in the data to be sorted, you might create a secondary index on it and define the compare function as you wish.
    Regards,
    Emily Fu, Oracle Berkeley DB

  • Hi i need help in  sort in out issue in EDI/IDOC order01

    hi sap gurus
    my developer developed the code for idoc order01- FM: idoc_input_orders- here update the logic in the user exit.
    can anybody tell me, what test data  should i have to provide to test the inbound processing, c<b>an anybody tell me how to test the inbound process step by step.</b>
    thanks in advance
    samsd

    Hello,
    Please check the following links
    <b>Test: Inbound Processing: Original Inbound File</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b815143d711d1893e0000e8323c4f/content.htm
    <b>How to test inbound/outbound idocs with screen shots(PDF File)</b>
    http://www.photographybykevin.net/sap/idoc_overview.pdf
    <b>An overview in FI testing</b>
    http://searchsap.techtarget.com/general/0,295582,sid21_gci1130339,00.html
    Reward if helpful
    Regards
    Byju

Maybe you are looking for