*Modify the LKM to add order by clause*

I had a requirement to insert the data in the asc order, So how we can modify the LKM for using the order by caluse.
Thanks in advance.
Cheers,
Rajeev

Hi Rajeev,
It is IDEAL to change your IKM knonwledge module instead of LKM to load into the target table with order by clause.
This is because, if you add order by clause in LKM, it extracts data from source with order by clause first and loads into ODI work tables intially. From these work tables data will be loaded into target tables. In this step we are not sure if the the data is going to be loaded in the same order.
Coming to your question, follow the below steps.
1. Import IKM knowledge module depending on your technology. For example "IKM Oracle Incremental Update (MERGE)".
2. Double click on the IKM to change the definition name, to just make you aware that IKM has been customised.
3. Go to the details tab in IKM after double click, double click on the step which inserts from I$ table to final target table. In my case the step name is "Merge Rows".
4. You can modify the second line
from
using     <%=odiRef.getTable("L", "INT_NAME", "A")%> S
to
using     (select * from <%=odiRef.getTable("L", "INT_NAME", "A")%> order by 1) S
5. Note that above step will sort always based on the first column. You can modify depending on your requirement.
6. Save it and you can view respective sql statements generated from operator.
Let me know if it is resolved.

Similar Messages

  • Performance with order by clause

    Dear all,
    please find the below query .if i executed without order by it is going to execute with in 2 sec.if i add order by clause
    it is taking more than 2 min.as per the business we need order by clause .plaese suggest me.it's very urgent.
    SELECT "FACILITY_ID","VESSEL_NAME","CLASS_NUM","SURVEY_REPORT_NO","IMO_NUMBER","VESSEL_TYPE","VESSEL_TYPE_ID","PRIMARY_BUILDER","BUILDER_ID","REGISTER_OWNER","ABS_SURVEY_STATUS_ID","ABS_SURVEY_STATUS_DATE","NOT_ASSIGNED_SINCE","NO_OF_FINDINGS","CASE","SPM_ITM_CAT_NAME","LEAST_CONFIDENCE" FROM (SELECT
    V. FACILITY_ID,
    v.vessel_name,
    v.class_num,
    ASR.SURVEY_REPORT_NO,
    V.IMO_NUMBER,
    V.VESSEL_TYPE,
    v.vessel_type_id,
    V.PRIMARY_BUILDER,
    V.BUILDER_ID,
    V.REGISTER_OWNER,
    ASR.ABS_SURVEY_STATUS_ID,
    ASR.abs_survey_status_date,
    ROUND(SYSDATE - ASR.abs_survey_status_date) AS NOT_ASSIGNED_SINCE,
    (SELECT COUNT(1) FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND FIN_TAG_STAT_ID IN( 'TG')) AS no_of_findings,
    CASE WHEN ( SELECT rnum FROM (SELECT survey_report_no,COUNT(rnum) rnum FROM (SELECT a.survey_report_no,COUNT(*) rnum FROM ABS_FINDINGS A,ABS_SURVEY_REPORTS b
         WHERE a.survey_report_no=b.survey_report_no
         GROUP BY a.survey_report_no,spm_item_category) GROUP BY survey_report_no ) WHERE survey_report_no=asr.survey_report_no )=1 THEN
    ( SELECT spm_item_cat_id FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND ROWNUM<2)
    ELSE
    5
    END CASE,
    (SELECT SPM_ITM_CAT_NAME FROM SPM_ITEM_CATEGORIES WHERE SPM_ITEM_CAT_ID =
    (CASE WHEN ( SELECT rnum FROM (SELECT survey_report_no,COUNT(rnum) rnum FROM (SELECT a.survey_report_no,COUNT(*) rnum FROM ABS_FINDINGS A,ABS_SURVEY_REPORTS b
         WHERE a.survey_report_no=b.survey_report_no
         GROUP BY a.survey_report_no,spm_item_category) GROUP BY survey_report_no ) WHERE survey_report_no=asr.survey_report_no )=1 THEN
    ( SELECT spm_item_cat_id FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND ROWNUM<2)
    ELSE
    5
    END )) AS SPM_ITM_CAT_NAME,
    (SELECT MIN(tag_weight) FROM TAGGED_FINDINGS
              WHERE finding_id IN (SELECT finding_id FROM ABS_FINDINGS WHERE survey_report_no IN (ASR.SURVEY_REPORT_NO))) AS least_confidence
    FROM
    ABS_SURVEY_REPORTS ASR,
    ABS_VESSELS V
    WHERE
    ASR.FACILITY_ID = V.FACILITY_ID
    AND abs_survey_Status_id = 1 ) WHERE no_of_findings>0
    ORDER BY ABS_SURVEY_STATUS_DATE
    Thanks
    venkat

    Please start reading these informative links first:
    HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long ...
    and then rephrase your question by posting
    - database version
    - execution plans
    - etc. (see the links above)
    Put the tag before and after your examples, so it'll stay formatted.
    See: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • ROWNUM can use with ORDER BY clause?

    Hi
    Following i have two quires in ROWNUM order for example..
    1:query
    select rownum,empno,ename,deptno from emp
    where rownum <= 14;
    result:
    rownum empno ename deptno
    1 7369 SMITH 20
    2 7499 ALLEN 30
    3 7521 WARD 30
    4 7566 JONES 20
    5 7654 MARTIN 30
    6 7698 BLAKE 30
    7 7782 CLARK 10
    8 7788 SCOTT 20
    9 7839 KING 10
    10 7844 TURNER 30
    11 7876 ADAMS 20
    12 7900 JAMES 30
    13 7902 FORD 20
    14 7934 MILLER 10
    2:Query , add ORDER BY clause it will change the sequence of ROWNUM.
    select rownum,empno,ename,deptno from emp
    where rownum <= 14
    order by deptno;
    result:
    rownum empno ename deptno
    7 7782 CLARK 10
    9 7839 KING 10
    14 7934 MILLER 10
    1 7369 SMITH 20
    11 7876 ADAMS 20
    13 7902 FORD 20
    8 7788 SCOTT 20
    and so on......
    but i want these records from 2 to 5...how i can query this through ROWNUM or any sequence because ORDER BY clause change the order of ROWNUM and i could get this result.
    rownum empno ename deptno
    9 7839 KING 10
    14 7934 MILLER 10
    1 7369 SMITH 20
    11 7876 ADAMS 20
    please send me general query which i can apply on any table.
    advance thanks.

    My guess is that you are looking for a pagination solution. If so, here is a thread on Asktom:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:127412348064
    So, essentially, you ORDER BY first and then write a wrapper to get your the rownum.
    If you do it this way, You will also use the top-n optimization that Oracle uses.
    Rahul.

  • Order by Clause is slow

    Guys,
    I have a table of 80,000 records.If i select * from this table need 0.04 seconds.If I add order by clause it become very slow 30 sec.
    Order by clause is on the primary key.Also i increased the size of temp tablespace.
    Kindly assist

    In Forms, LOV's are meant for a small set of values.
    For a table containing 80,000 records you need to develop a small selection form, i.e. a separate form in which you can search for values and select one value. Details for this can be acquired in the Oracle*Forms Forum. A form will typically fetch only a few rows and is therefore more suited in this case. Be sure to check the block properties "Query Array Size", "Number of Records Buffered" and "Query All Records".
    At my shop we use a standard of approximately 20 values. Below this number a LOV can be used and above a select form is recommended.
    Regards,
    Rob.

  • Order By clause in Receiver JDBC adapter

    Hello All,
    Is it possible to construct a select statement that uses an Order by clause in JDBC receiver adapter?
    ex : I would like the JDBC adapter to from a query as follows:
    <b>Select * from EMP where sal = 10000 order by empid</b>
    We are able to construct the select statement without order by clause but not with it.
    Can any one suggest me how to do it. This is bit urgent for us.
    Thanks
    Abinash

    hi,
    did you try with
    SQL_DML
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Regards,
    michal

  • Should I modify the camera file to change the greyscale resolution of my Photonfocus camera from 8 to 12 bits?

    I have some difficulties to use my Photonfocus camera with 12 bits greyscale resolution.
    I have a Photonfocus camera MV-D1024E-160-CL-12, a NI PCIe-1429 frame grabber, PFRemote 2.0 and Measurement & Automation Explorer 4.2.1.3001.
    If I work with 8 bits greyscale resolution (PFRemote -> Data Output: Resolution : 8 bit) and look at the image with MAX (Système -> Périphériques et interfaces -> NI-IMAQ Devices -> img0: NI PCIe-1429 -> Channel 0: PhotonFocus MV-D1024-160 (file in attachment), everything is working.
    Now I'd like to work with 12 bits and I don't know exactly what I have to change? I've tried to change only the resolution in PFRemote (PFRemote -> Data Output: Resolution : 12 bit) but then the image in MAX remains a 8 bit resolution. Then I've tried also to modify the camera file (file in attachment). I've put the "BitDepth" and the "BitsPerComponent" at 12 instead of 8 and the "BinaryThreshold" to (0,4095). But when trying to grab an image in MAX, an error occured: "Error 0xBFF600FE Le nombre de bits par pixel requis est invalide".
    Should I really modify the camera file in order to grab 12 bits images? Or what should I do?
    Thank you
    Mélanie
    Attachments:
    PhotonFocus MV-D1024-160.txt ‏5 KB

    Hi toto26,
    Thank you very much for the information. I did exactly the same thing as you suggested for 8-bit, and I were able to change the resolution (number of pixels), exposure time, frame rate without any problem. I understand that I need to coordinate the MAX icd file and the settings of PFRemote.
    When I tried to switch to 12-bit, I found that I need the camera file (.icd) for 12-bit. I tried the attached icd in the previous discussion (Photonfocus MV-D1024E-160-CL-12 12-bit 1429 X4 only.zip 2 KB). There was an IMAX Error: Error 0xBFF6002C, FIFO overflow caused acquisition to halt. Then I think maybe this camera file is not good for me because I have a PCIe-1427, instead of a PCIe-1429. 
    So, I downloaded the camera file generator (from the same link you suggested) to create my own camera file. When I run the generator, the first window popped out was for camera setting, and there was no Photonfocus in the choice for the Manufacturer. Is it true that I cannot create camera files for Photonfocus camera, or I simply don't know how to use the generator?
    Thanks again for the help and I look forward to more advices.
    Regards,
    Hasi

  • Execution process of order by clause

    What is the execution process of order by clause in sql statement and how it will effect query's performance.

    Siddharth Singh wrote:
    What is the execution process of order by clause in sql statement Depends. First, do you mean "alrogithmically, how does Oracle produce ordered data"? There are a number of different approaches. The data may be ordered because you are fetching sequentially from an index. Or it may be explicitly materialized and sorted.
    and how it will effect query's performance.Depends. It could have no impact because it relies on the index to order the data and the index is the most efficient access path regardless of the presence of an ORDER BY. Or it could require a tremendous amount of time to materialize and sort multiple GB of data.
    Justin

  • CJ31 - How to modifying the assigned budget

    Hi gurus,
    We have checked that in our system we have incorrect values in the Budget database. this is because we have posted invoices directly in FI by a batch input calling to the tcode FB01. We post this with reference to Purchase orders populating the field "purchase order". I mean, the FI invoice has the field PO document filled out with the PO number. We close the PO number manually.
    The problem is that even the invoice is with the same amount than the PO, the assigned budget in transaction CJ31 is being modified in the value for instead remaining without changes. Transaction MIRO makes a check in the PO when being posted but FB01 not. In fact in MIRO if the amount is greater than PO, the assigned value is increased.
    SAP has indicated that FB01 is not connected to the commitment system as MIRO so this is the correct behavior of system. At this point we are going to start using the standard procedure. However we need to correct the current data we assigned to the .
    Therefore we have the in budget database corrupted since they are duplicated or even more than duplicated.
    My question is how to modify the assigned budget?
    -Is there any way from a functional point of view (executing some transaction or program) to reduce the assigned budget for errors like this?
    -In case that this is not possible by t-code or program, is there any idea of tables we need to adjust? We know that the table PJPA registers the annual records and assigned values are displayed in fields WTJHR and WLJHR but we cannot modify only this table in case there are other tables linked.
    Many thanks in advance and kind regards

    Hi Varun,
    Thanks for replying. I checked the note you linked. However I didn't find a solution
    CJEN and CJBN are not an option for us. With these transaction we can rebuild the data but the wrong data is already imputed in my system. Just to clarify. My requirement is getting a way to amend the values we have in the assigned value. From the system point of view the assigned budget is correct because it was imputed from FI. But in terms of my business we are duplicating the assigned (Purchase orde an FI document). Therefore we are searching for modify the assigned value in order to represent the real budget state.
    Kind Regards

  • Select will not displaying the Rows in any order

    hai
    in oracle 8i if i give run this
    SELECT "Payor Name","UnappliedMonth1" AS "Apr 04", "UnappliedMonth2" AS "Mar 04",
    "UnappliedMonth3" AS "Feb 04", "UnappliedMonth4" AS "Jan 04", "UnappliedMonth5" AS "Dec 03", "UnappliedMonth6" AS "Nov 03", "UnappliedMonth7" AS "Oct 03", "UnappliedMonth8" AS "Sep 03", "UnappliedMonth9" AS "Aug 03", "UnappliedMonth10" AS "Jul 03",
    "UnappliedMonth11" AS "Jun 03",
    "Total Cash Applied" AS "Total Cash Applied", "Total Unapplied Cash" AS "Total Unapplied Cash", "Percentage Unapplied" AS "Percentage Unapplied" FROM "RP_Unapplied0I1" GROUP BY "Payor Name", "UnappliedMonth1", "UnappliedMonth2", "UnappliedMonth3", "UnappliedMonth4", "UnappliedMonth5", "UnappliedMonth6", "UnappliedMonth7", "UnappliedMonth8", "UnappliedMonth9", "UnappliedMonth10", "UnappliedMonth11", "Total Cash Applied", "Total Unapplied Cash", "Percentage Unapplied"
    statement it is displaying the result in ascending order
    but if i run in oracle 9i It is not displaying in a ascending order
    what is the problem?
    please help me

    Yes.
    Please note that without the presence of an ORDER BY clause Oracle is free to display the resultset in any order it may choose (may depend on the plan the optimizer comes up with).
    if you need results displayed in a particular order, you MUST supply an ORDER BY clause.
    You cannot rely on the order of the resultset as you get today when executing the query (if not using ORDER BY clause), since the ordering can (and will) change in the future.

  • How do I modify the WHERE clause in my SQL query?

    This seems like such a straight-forward part of the report design, but I'm fairly new to Crystal Reports and I only have experience with modifying reports someone else has already written.  In this particular case, I just need to modify the WHERE clause of the SQL query.  I can select Show SQL Query and see what statement is being used to select data, but I can't find where to modify it since it's grayed out.  I see how to change the selection criteria, parameters, grouping, etc...just not the WHERE clause.  The report is linked to a database used for reporting with a table created and populated by a stored procedure.  I don't need to modify the stored procedure because the data I want to filter by is currently in the table--I just don't know how to filter by what I need.  Here's part of the query:
    SELECT "rpt_dist"."startdate", "rpt_dist"."transtype", "rpt_dist"."laborcode", "rpt_dist"."crewid", "rpt_dist"."regularhrs" FROM   "Reporting"."dbo"."rpt_dist" "rpt_dist"
    WHERE  (rpt_dist."transtype" <> 'WORK' AND rpt_dist."transtype" <> 'WMATL') AND rpt_dist."laborcode" LIKE 'S%' AND (rpt_dist."crewid" = 'HOUS' OR rpt_dist."crewid" = 'HOUS2' ...
    I would like to add another crewid to the WHERE clause.  Thanks for any input.

    1.Open the report in the crystal designer
    2.Go to the field explorer(if hidden go to view menu->field explorer)
    3.Rt. click on the database fields->choose database expert
    4.Now you will see 2 columns-Available DataSource  and Selected Tables
    5.Rt. click on the object(ex.command) available in the Selected Tables column->Choose Edit command
    6.A new Modify Command window will appear,here you can edit your SQL Query
    I get to step 4 and I see the two columns including my database and the report table, but there is no command object available.  If I right-click on my table, I can just view the Properties. ??
    As for the other tip to modify the record selection:  I don't see anywhere the other crewid values are set and if I add the one I'm missing, it doesn't modify the existing SQL Query and when I preview the report it throws off the results so that no data displays??
    I'm using Crystal Reports 11.5 if that makes a difference.  Thanks again.

  • How to Modify Order by clause of standard VO

    Hi All,
    I want to modify orderby clause of standard VO. I extended the VO and modified the order by clause. But it did not workout.
    Anybody worked on this kind of requirement?
    Any help would be greatly appriciated.
    Thanks in Advance.
    Rakesh.

    Hi user2705625,
    After extending the VO , one needs to do. jpx import to reflect the changes on to the application server . Please check the link below for steps
    https://blogs.oracle.com/prajkumar/entry/eo_based_vo_extension_in
    Thanks
    Sandeep

  • How to prevent modifying the same sales order in R/3 & CRM at the same time

    Guys,
    We are using CRM 5.0& R/3 4.6C. We have the middle set up. I have noticed that its possible to open the same sales order in R/3 and CRM in the change mode. I believe this could cause inconsistenices if the users modify the same order in different systems. Is there a standar way to prevent this from happening.
    Is there something like a change lock like we have the distribution lock?
    Anirudh

    Hi,
    As per OSS Note 705200 scenario X, Y and Z are supported with R/3 4.6C. Even if you use Scenario A, SAP wont support that. I would suggest sceario Z to be implemented. This would convert all the CRM order into R/3 order as soon as they are transferred to R/3. As a result the order can now only be modified in R/3 and all the changes would flow back into CRM maintaining the integrity between the systems.
    Refer to OSS Note 541113 for details.
    Regards,
    Gaurav Gera

  • I have alot of loose photos at home (old) and I would love to make a bunch of iphoto books and make the pages like whole page collages?  How do I get my photos into iphoto in order to do this?  Can I make a DVD at the drugstore and add them to iphoto?

    I have alot of loose photos at home (old) and I would love to make a bunch of iphoto books and make the pages like whole page collages?  How do I get my photos into iphoto in order to do this?  Can I make a DVD at the drugstore and add them to iphoto?

    You can make the collages easily if you have iWork.  Just open a letter sized page in landscape mode and drag the photos onto the page, rotate and postiion as necessary.  Then do a Print ➙ PDF ➙ Save PDF to iPhoto to get a 200 dpi jpeg version of the Pages page into iPhoto.  From there you can add it to your book and use a blank page with the option to have an image as the backbround. 
    If you have a 3rd party image editor that supports layers you can create the collage with it. 
    OT

  • Is there a way to automatically add text to video; the text gleaned from order data?

    is there a way to automatically add text to video; the text gleaned from order data?

    What is "order data"?

  • When attempting to install add-ons, Firefox generates a message saying it is unable to install add-on because Firefox cannot modify the necessary file. To what file is this referring, and how do I fix this problem?

    When I download an add-on such as Colorful Tabs and start the installation process, I receive a message that Firefox cannot install the add-on because it cannot modify the necessary file. To what file is this referring?

    That is usually caused by Firefox not unpacking the extension.
    You can try to set the Boolean pref <b>extensions.alwaysUnpack</b> to <i>true</i> on the <b>about:config</b> page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold (user set).
    *Preferences can be reset to the default via the right-click context menu if they are user set
    *Preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean)

Maybe you are looking for