How to Order a Source Table ???

How can I do if I have to order the select of my source table ???
I have try to put an order by on the same filter than my filter but it is build with parenthesis
if I put an filter with :
COL1='3' ORDER BY COL2
it's build like
Select ... where ((COL1 = '3') (ORDER BY COL2))
and the parenthesis raise an error...
If someone know....
Thanks

I'll share two (not straight) approach;
1) In the KM, add a last line "order by 1" in the 'select' of load step of the KM. Then modify the source datastore such that you push the required column order to the top ...i.e order 1. and when ever you this use this KM it will sort by the first column
2) Do a "cheat" in the filter. Use the order by clause like this ....
table.col1=0) order by (table.col_sort
when compiled...it would result in
(table.col1=0) order by (table.col_sort)
If you have more than one column in order by clause, then use the following;
table.col1=0) order by (table.col_sort1), (table.col_sort2
Enjoy ODI,
Karthik

Similar Messages

  • How to find the Source Table in one corresponding schema?

    Hi All,
    How to find the Source Table in one corresponding schema?
    regards,
    DB

    DB wrote:
    Hi All,
    How to find the Source Table in one corresponding schema?
    regards,
    DBHUH?
    I do not understand your question
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • How to delete the source table rows once loaded in Destination Table in SSIS?

    Data Base=kssdata
    Tables= Userdetails having 1000 rows
    Using SSIS: 
    Taking A  
    OLE DB Source----------------->OLE DB Destination
    Am Taking 200 rows in Source table and loaded into Destination table once
    Constraint: here once 200 rows are exported in destination table , that 200 rows are deleted in source table
    repeat the task as source table all the records are loaded into Destination table 
    After that am taking another 200 rows in source table and loaded into Destination table

    Provided you've a sequential primary key  or audit timestamp (datetime/date) column in the table you can do an approach like this
    1. Add a execute sql task connectng to source db with below statement
    SELECT COUNT(*) FROM table
    Store the result in a variable
    2. Have another variable and set it to below expression
    (@[User::CountVariable]/200) + (@[User::CountVariable]%200 >0? 1:0)
    by setting EvaluatesExpression as true. Here CountVariable is variable created in previous step
    3. Have a for loop container with below settings
    InitExpression
    @NewVariable = @CounterVariable
    EvalExpression
    @NewVariable > 0
    AssignExpression
    @NewVariable = @NewVariable - 1
    3. Add a data flow task with OLEDB source and OLEDB Destination
    4. Use source query as
    SELECT TOP 200 columns...
    FROM Table
    ORDER BY [PK | AuditColumn]
    Use PK or audit column depending which one is sequential
    5. After data flow task have a execute sql task with statement as below
    DELETE t
    FROM (SELECT ROW_NUMBER() OVER (ORDER BY PK) AS Rn
    FROM Table)t
    WHERE Rn <= 200
    This will make sure the 200 records gets deleted each time
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to read the source table using a dblink in oracle

    Hi,
    I want to read data from a source table which I can access using dblink in the datawarehouse. I tried different things in DI and I don't know how to do that? Can any one help me on this?
    Thanks,
    Gowri

    Two options:
    First you could create a view in the dwh database that is using that remote link: create or replace view r_source as select * from source@dblink.
    Better option is to create the source system datastore - but I assume that exists already - and then go to the dwh datastore and say that there is a dblink of a given name with which the target database can read from the other database. DI then will execute a insert...select from source@dblink kind of statement whenever that is possible. In case no such full pushdown is possible and the data is going through the DI engine anyway, reading via the dblink does not make sense anyway.
    https://boc.sdn.sap.com/node/5065
    https://boc.sdn.sap.com/node/5814

  • How to identify EBS Source tables for SC and OM modules?

    Hi,
    I need to identify EBS source tables for Supply Chain and Order Management module.
    What prefix I should check in EBS tables?
    Is there any document on this?
    Regards
    Sudipta

    Check etrm.oracle.com
    For order Management you should check with OE
    Purchasing PO and inventory INV and I guess for ASCP MSC
    Mahendra

  • How to lock my source table?

    There are other jobs that are updating my source table at the same time my mapping is running. This is causing problems for me. Is there any way that I can lock my source table until after my mapping is complete? IOW: Can I issue "select for update"??
    I am running 10gR1 and 10gR2.
    Thanks,
    Tim O'Brien

    I'll share two (not straight) approach;
    1) In the KM, add a last line "order by 1" in the 'select' of load step of the KM. Then modify the source datastore such that you push the required column order to the top ...i.e order 1. and when ever you this use this KM it will sort by the first column
    2) Do a "cheat" in the filter. Use the order by clause like this ....
    table.col1=0) order by (table.col_sort
    when compiled...it would result in
    (table.col1=0) order by (table.col_sort)
    If you have more than one column in order by clause, then use the following;
    table.col1=0) order by (table.col_sort1), (table.col_sort2
    Enjoy ODI,
    Karthik

  • How to join multiple source tables and do lookup?

    I have a requirement to load a target table by joining 4 source tables. Also I have to do a lookup on a domain table to transform codes and check for nulls. What will be the best approach to load the target table?
    Is it possible to do it in one interface or do I need to build multiple interfaces to achive this?
    My source and target database both are oracle and I am planing to use Oracle Incremental Update Merge.
    Thank you

    You are in the right direction by creating one interface for this transformation.
    You will need to drag drop 4 source tables + the lookup table on the Sources window of Interface and then make appropriate joins.
    Also, check for NULLS in the transformation. Depends what you want to do with the NULLS. If you want to ignore them, use a filter.
    If you want them to error out, use a constraint.
    If you want to convert them, use NVL
    Start with Oracle Incremental Update and once successful, use Oracle Incremental Update MERGE.

  • How to join two Source tables

    Hi
    I am doing a POC on joing two MSSQL 2K source tables and populating into Oracle table.
    I did not find the joiner operator and other transformation operators.
    Can anyone help me in using them?
    Thanks,
    Ganesh

    Hi,
    First, just drag&drop the two source table in the interface.
    Then, connect the two tables with eachother using your mouse while selecting the two columns that you want to use in your join.
    Transformations can be found when selecting a field in your target datastore; you will see a screen appear in the 'properties-panel' of your interface-editor; here you can edit transformations.
    Good luck ...
    Steffen

  • How to get source table name according to target table

    hi all
    another question:
    once a map was created and deployed,the corresponding information was stored in the repository and rtr repository.My question is how to find the source table name according to the target table,and in which table these records are recorded.
    somebody help me plz!!
    thanks a lot!

    This is a query that will get you the operators in a mapping. To get source and targets you will need some additional information but this should get you started:
    set pages 999
    col PROJECT format a20
    col MODULE format a20
    col MAPPING format a25
    col OPERATOR format a20
    col OP_TYPE format a15
    select mod.project_name PROJECT
    , map.information_system_name MODULE
    , map.map_name MAPPING
    , cmp.map_component_name OPERATOR
    , cmp.operator_type OP_TYPE
    from all_iv_xform_maps map
    , all_iv_modules mod
    , all_iv_xform_map_components cmp
    where mod.information_system_id = map.information_system_id
    and map.map_id = cmp.map_id
    and mod.project_name = '&Project'
    order by 1,2,3
    Jean-Pierre

  • How to find source table

    Hi Experts,
                         Please some one tell me how to find the source table for a structure table. I have table called AFVGD( Structure Table) and AFIH( Transparent Table) , I want to find the physical table where this two tables based on like I want to know Price field is coming from that is existing in AFVGD.
    Thanks
    Robbie

    go to se11 display the structure afvgd.
    the price field PREIS take data element name and it will be PREIS
    and come back to initial screen of se11 go to data type give the name PREIS here in application tool bar you can find the where used list button just click it will pop up some box check tables there and press enter it will display the tables list.
    i think you can find it in AFVC table.
    regards
    shiba dutta

  • Source Table

    Hi Experts,
    Need a help from you. Please tell me know how to find the source tables for a particular field. I m using the transaction code MCTA and when i am trying to get teh table for KUNNR, i,e. Sold to Party, its showing me a structure and not the source table .....Though we know the tables for customer master....I would like to know the procedure of identifying the source table and not structure....
    Thanks in Advance
    Regards,
    Shivaji.

    Hi,
    If you know the field, then go to transaction SE84. Click on ABAP dictionary > Fields. Double click on the view fields. There you will find 'Field Name'. Put KUNNR and Execute. You will find the list of tables and views. You can recognize the table by description.
    Else, go to SE12, put DD03L and go to display. Put the field name and you will get the list of all the views, structures and tables.
    SE84 will be more useful for you.
    Thanks
    Mukund S
    Reward points if helpful....

  • SOURCE TABLE FOR GRN IN MM

    Hi,
    Please let me know how to find the source table for GRN in MM .
    Thanks  in Advance,
    Manu

    Hi,
    You can also use ST05..
    Switch on the SQL Trace..
    Execute the transaction..
    Switch off the SQL Trace..
    You can see the tables that were used in the transaction.
    Reward points if found helpful..
    Cheers,
    Chandra Sekhar.

  • How can I replicate a source table that doesn't have any primary keys?

    We have transactional replication setup in our workplace.
    In the source database, there are some tables that do not have any primary key.
    1) How can I get these tables to replicate in the current scenario?
    2) Is it possible to introduce foreign elements in a replicated instance of the database?
    Example, additional records in a table that don't exist in the source or additional tables in the database?

    1) You need to add a primary key to this table. There must be a criteria that the app uses to identify which row it wants to up date or delete. If not you might be able to add an identity column to the table and then add a primary key to it. If this is not
    possible you might want to use snapshot replication or CDC to do change tracking and then something like SSIS or service broker to move the change to the destination server.
    2) yes, but be careful. They should not modify the schema or the data of tables which are being replicated.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • How to get source table inside Template Mapping code template

    Hi guys,
    I have the following scenario, I have an table from external database and want to map it to an oracle table. This is done with Template mapping and I selected an Load code template on the execution unit that holds only the external table, this load code template will read row by row from source table and make the inserts into the flow table. I know that oracle use odiRef.getFrom() in order to construct the select statement from the external table. Because i need to do something custom i will need to have a list of the source tables inside the Load code template.
    Is this possible?
    P.S. I use owb 11gr2.
    Regards,
    Cipi
    Edited by: Iancu Ciprian on Jan 11, 2011 10:58 AM

    Hi Suraj,
    Thx for your answer!
    After posting the message i found in ODI documentation about odiRef other function and this I'm trying now to see if works, will let you know my results ...
    I implemented an custom iterator that retrieves the data from an external source and pass it to INSERT commands to execute against flow table. In order that this iterator to work i need the source table name of the current execution unit. Then the iterator is using the that name to get the data from the external entity and retrieve it as an array of Objects, this array of objects will be inserted in the flow table.
    Regards,
    Cipi

  • How to get source table name

    Hi,
    I need to know how get a source table name. I need to get a source table name and do some transformation. I am adding the step in IKM to do this and therefore need source table name in there.
    <%=odiRef.getSrcTablesList("","[RES_NAME]","","")%> gives work table name (C$_0XXXXX) whereas actual source table name is expected.
    Could someone please help?
    Thanks.

    Hi,
    May i add a point?
    In IKM level, if u use this API it will always return u C$ table name only since for IKM C$ is the source. You need to capture and use this API in LKM level.
    In LKM add a step in Command on target and technology as Jython and try the below code.
    mySourceTable= '<%=odiRef.getSrcTablesList("", "[RES_NAME]", ", ", "")%>'
    And later in IKM use this variable for ur transformation.
    Thanks,
    Guru

Maybe you are looking for

  • Calling abap method in xslt mapping?

    Hi I need to call abap method in my xslt mapping , i tried with <sap:external-call >and <sap:external-function> . But it is giving short dump error. Can anybody give me proper syntax.. thanks Prasad

  • Troubleshooting raw files on trial version of Lightroom 4

    Just downloaded a trial version of Lightroom 4. Am proficient in PS6 but have never used Lightroom. I decided to do a practice run through Lightroom using a folder from a recent shoot..some jpegs are finished and named, some are left alone and I have

  • If a macbook pro with retina display's hard drive fail, do you have to buy a new computer

    I am going to get a macbook pro and i'm not sure whether to go for a normal 15 or 15 with retina, i would prefer the retina for what i need it for but this is pretty important

  • File Sharing with Windows (XP/Vista)

    Hello all, I've studied various websites including the Apple support documents and I'm still a little confused about file sharing. Is there a way to share only certain folders via SMB with a vista/xp machine? E.G. can I just share my 'public' folder?

  • HTTP Receiver - Proxy

    Hi, I had to design a file----- XI - HTTP scenario. Say i am connect to a 3rd party with address 11.11.111.11 throgh the HTTP call. But now i am told that a firewall wil be in place between XI and HTTP. What does that mean ? do i still have to call t