Source table name on ? ? level

hi
I would like to store in Java Variable source table name on <? ?> level.
<?
String table_name = Source_Table_Name;
?>
When I use:
<?
String p = "<%=odiRef.getSrcTablesList("", "[TABLE_NAME]", ", ", "")%>";
?>
then this code is translated to:
<?
String p = "<?=snpRef.getObjectShortName("L", "TABLE1", "SCHEMA1", "D")";
?>
where TABLE_NAME is already replaced to TABLE1. (the same happens when I use <%=odiRef.getFrom()%>
Thanks in advance
Marcin

I had success using a regular expression to remove everything from the <?...?> expression before and after the table name.
Something like this might work.
<%
// Get the source table for this interface. A check will be added to verify that only one exists.
String srcTableCall = odiRef.getSrcTablesList(0, "", "[TABLE_NAME]", "", "");
// srcTableCall returns a string like <?=snpRef.getObjectShortName("L","<TableName>","<Physical Architecture>","D")?>. We have to use a pair
// of regular expressions to isolate the table name in a form that can be used to manipulate another string.
String srcTable = srcTableCall.replaceFirst ("^.*getObjectShortName.......", "").replaceFirst(".,.*$", "");
// The onClause is the mappings marked with UD1.
String onClause = odiRef.getColList("", "\tT.[COL_NAME] = [EXPRESSION]", "\n\tand\t", "", "UD1");
out.println ("onClause before substitution is " + onClause );
// Replace the source table in each EXPRESSION with S. This doesn't work like I think it should.
onClause = onClause.replace (srcTable, "S");
out.println ("onClause with substitution is " + onClause);
%>

Similar Messages

  • 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

  • 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

  • Dynamically passing the source table name to OWB mapping

    I am building a mapping wherein one of the source tables is a view. The view name varies with the time parameter I pass in. I am looking at ways to pass in the time parameter to the mapping procedure such that it first gets the view name from a table and uses that view as the source table to fetch data. Any directions?
    In normal PL/SQL coding, I can first get the view name and use this view name to buld a dynamic query, which can be then executed.

    This is a common question. The best way to do this is to use a synonym.
    Create the synonym in the database and import into OWB. Use the synonym in your mapping. Have your mapping accept a mapping input for the table you want the synonym to point to. Setup a premapping process to re-create the synonym with the table you want to use.
    Here is the procedure that I use. It defaults to a private synonym. Remember, the synonym will be created in the same schema that the mapping is deployed to.
    CREATE OR REPLACE PROCEDURE "CAWDATA"."CREATE_SYNONYM_PRC" ("P_SYNONYM_NAME" IN VARCHAR2,  "P_OBJECT_NAME" IN VARCHAR2,
    "P_IS_PUBLIC_SYNONYM" IN BOOLEAN DEFAULT false)    IS
    BEGIN
    if p_is_public_synonym = true then
    execute immediate 'create or replace public synonym '|| p_synonym_name || ' for '|| p_object_name;
    else
    execute immediate 'create or replace synonym '|| p_synonym_name || ' for '|| p_object_name;
    end if;
    exception
    when others
    then
          raise_application_error(sqlcode,sqlerrm) ;
    END;

  • BRIDGE statement in a loop : dynamic destination and source table names ...

    Hello,
    I can't find the right syntax to do what I need, if it's possible :
    Context :
    I work actualy on a migration from MS Access applications to Oracle (datas only). So I copied all MS Access Tables into Oracle and created manualy all the relationnal constraints like primary and foreign keys ('cause constraints are not included in 'Copy to Oracle').
    I Have often to refresh my datas, because the MS access applications are still in use. Therefore I wrote PL/SQL scripts. They do the folowing, using dynamic SQL with 'Execute Immediate' statement :
    Script 1
    - disable all user's constraints
    - disable all user's triggers
    - truncate all user's tables
    (Here, I have to do a manual copy of all MS Access tables to Oracle, checking the Append check-box, because the BRIDGE statement doesn't support 'Execute Immediate', and wait...)
    Script 2
    - enable all user's constraints
    - enable all user's triggers
    Could someone let me know how Il could do the same as :
    For t in (select table_name from user_tables) loop
    -- Copy the datas from an Access table into the same Oracle table
    execute immediate ('BRIDGE ' || t.table_name || ' AS MyAccessConnName(select * from ' || t.table_name || ') APPEND') ;
    -- News flash ...
    dbms_output.put_line('Table ' || t.table_name || ' filled') ;
    end loop;
    -------------------------------------------------------------------------------------------------------------------------- ==> 00900. 00000 - "invalid SQL statement"
    If a dynamic table name substitution is applicable in the Bridge statement from a query, I take it with joice!
    Thank you for helping me...
    Daniel

    Hi Daniel,
    The BRIDGE statement is just an extra command I implemented in the SQL Developer worksheet script runner.
    It gets interpreted by SQL Developer and it dynamically creates (CREATE TABLE , INSERT INTO , SELECT ... ) statements and runs them against the connections specified.
    It was developed to improve certain migration features of SQL Developer. We haven't really spent any time developing it into a customer friendly statement to be used in custom scripts.
    Hence the lack of doc. But it is there and if you can make it work for yourself all the better.
    When I say "One way of doing what you want". I mean I haven't thought about your particular problem exhaustively and I wouldn't want you to take my solution as gospel :)
    If you are happy running a script in SQL Developer, but would rather not run 2 scripts , or cut and paste results around, you could SPOOL the results and execute them.
    --call your other scripts to disable constraints during the data move
    set echo off;
    set feedback off;
    set linesize 1000;
    set pagesize 0;
    set headsep off;
    set termout off;
    set verify off;
    set heading off;
    SET PAGES 0;
    SET HEAD OFF;
    spool c:\mydynamicscript.sql
    select 'BRIDGE ' || table_name || ' AS MyAccessConnName(select * from ' || table_name||');' from user_tables ;
    spool off
    @c:\mydynamicscript.sql
    --call another script to enable your constraints again
    Regards,
    Dermot.
    SQL Developer Team.

  • 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

  • Source table not taken as S_order_item_xa when i generate map...urgent

    When i check generated result in owb it not showing source table name as s_order_item_xa.its taking as group name instead.i have specified group name as XA for CHAR_val column.
    It should show "s_order_item_xa"."CHAR_VAL instead of "XA"."CHAR_VAL"/*
    can anyone tell me where i went wrong immedietely.
    Generated code in owb
    "S_ORDER_ITEM"."STATUS_CD"/* EXPRESSION.OUTGRP1.ROOTSTATUS */ "ROOTSTATUS",
    "S_ORDER"."X_BT_SUB_STATUS_CD"/* EXPRESSION.OUTGRP1.O_SUBSTATUS */ "O_SUBSTATUS",
    "S_ORDER_ITEM"."X_BT_SUB_STATUS_CD"/* EXPRESSION.OUTGRP1.ROOTSUBSTATUS */ "ROOTSUBSTATUS",
    EXPRESSION.OUTGRP1.OUT_ROOTSTATUSOVERALL */ "OUT_ROOTSTATUSOVERALL",
    "XA"."CHAR_VAL"/* EXPRESSION.OUTGRP1.OUT_CHAR_VAL */ "OUT_CHAR_VAL",
    "S_ORDER_ITEM"."ACTION_CD"/* EXPRESSION.OUTGRP1.ROOTACTION */ "ROOTACTION",
    "S_ORDER"."X_BT_DLR_CHANNEL"/* EXPRESSION.OUTGRP1.O_DLR_CHANNEL */ "O_DLR_CHANNEL",
    regards
    SIRI
    Edited by: user11923932 on Sep 21, 2009 1:41 AM
    Edited by: user11923932 on Sep 21, 2009 1:47 AM
    Edited by: user11923932 on Sep 21, 2009 1:48 AM

    Siri,
    You didnt in essence do anything wrong, but when you bring an attribute into an expression from a table and give the group it is in a name the group name becomes an alias for the table. If you still want it to read "s_order_item_xa"."CHAR_VAL just name the group " "S_ORDER_ITEM_XA" instead of "XA".
    Regards,
    Shaun

  • Find underlying table name of ViewObject in AMImpl

    Hi All,
    In my datamodel AMImpl I have a method where I would like to extract the underlying table name based on top of which I have my ViewObject. Is there any way I can do it?
    Thanks

    User,
    In the general case, no - since View Objects can be based upon arbitrary SQL queries that have more than one table. If the ViewObject is based upon Entity Objects, you can call getEntityDefs() on the VO and then getSource() on the EntityDefs to get the source table names.
    John

  • Handling table name changes

    Hi,
    Because of a change in naming convention, all our source table names are changing (only the prefix: The rest of the name and the table structures will remain the same). We already have developed a significant number of OWB mappings based on the old naming convention. What is the OWB equivalent of doing a global search replace of table names ? Is there a script available for doing this ?
    Thanks in advance.
    Regards,
    Biswa.

    The name changing part should be relatively simple to handle. I have included a script that should do the renaming with the prefix 'WH_'. The reconcile will have to be done by you. The script should go something like this (please test your scripts in a test environment as I will not provide support for this).
    Regards:
    Igor
    # Update the connection information here.
    # The connect string format is repository_user/repository_pwd@hostname:port:service_name
    # Connecting to the repository:
    OMBCONNECT owb/owb@localhost:1521:ora9201
    puts "Connected to repository."
    # Setting the project and prefix variables (set project name here):
    set MProject MY_PROJECT
    # Everything will be prefixed by WH_:
    set wh WH_
    #Open the project
    # Entering into the Project (CC = Changing Context):
    OMBCC '$MProject'
    set module_list [OMBLIST ORACLE_MODULES]
    # Loop to enter into each project module:
         foreach i in {$module_list}{
              puts "Working on module: $module_list ."
              OMBCC '$module_list'
              set table_list [OMBLIST TABLES]
    # Loop to prefix the name of each table in the current module:
                   foreach j in {$table_list}{
                        puts "     Working on table: $table_list ."
                        OMBALTER TABLE '$j'
                             RENAME TO '$wh$j'
    # Loop to prefix the name of each dimension in the current module:
              set dim_list [OMBLIST DIMENSION_TABLES]
                   foreach l in {$dim_list}{
                   puts "     Working on dimension: $dim_list ."
                        OMBALTER DIMENSION_TABLE '$l'
                             RENAME TO '$wh$l'
    # Loop to prefix the name of each cube in the current module:
              set cube_list [OMBLIST CUBE_TABLES]
                   foreach m in {$cube_list}{
                   puts "     Working on cube: $cube_list ."
                        OMBALTER CUBE_TABLE '$m'
                             RENAME TO '$wh$m'
    # Loop to prefix the name of each mapping in the current module:
              set mapping_list [OMBLIST MAPPINGS]
                   foreach k in {$mapping_list}{
                   puts "     Working on mapping: $mapping_list ."
    # Reconcile your mapping here by using OMBRECONCILE ...
    # this will have to be done by you...     
    puts "Done."
    # Saving the changes:
    OMBCOMMIT
    # Disconnecting from the repository:
    OMBDISCONNECT

  • Source Tables for Hierarchies

    Hi,
    I have a particular hierarchy defined in BW. It has several nodes in that. I found out from the transfer structure that the hierarchies have the Source from R/3.
    I just want to know the R/3 tables from which the values for these hierarchies is populated.
    Is there any place in either BW or R/3 where i can find the name of the table from which i can get the source table name.Pls clarify
    Sajan.M
    Message was edited by: Sajan Rajagopal

    hi,
    try
    - go to help.sap.com, click 'search documentation', option 'netweaver'
    - type in your hierarchy's datasource name
    - you will get a result list, in right side, click 'datasource'
    - you may get the datasource page with a list of field and r/3 origin table
    this is not always 'luck', if not get it, try another several ways mentioned in Roberto's weblog
    /people/sap.user72/blog/2005/09/05/sap-bw-and-business-content-datasources-in-pursuit-of-the-origins
    hope this helps.

  • Dynamically pick the table names in data flow task SSIS

    Hi All,
    I want to create a SSIS package which loads the data to a table on the other server every day. I have around 250 tables to load everyday and source and destination table names are available in a metadata table, table names have to read from the metadata
    table and data should be loaded. Is there a way that we can configure the source and destination table names dynamically in Data flow task?
    I am newbie to SSIS can any help with the solution for this problem.

    You can do that, not a big deal. The underlying problem is say suppose you constructed a ETL based on some x source and y destination and have put x(3 columns) as source and y destination(3 columns).. As you said if we have choice of dynamically pick the
    table names.. ETL might fail when you face below situation
    source x(3 columns)   destination y (4 columns) and there will be no mapping as it is dynamic. Sometimes mapping also fails even if the source and destination have same number of columns. If you still want to do... follow below steps:
    Create two variables:
    1.variable1 , datatype string
    2.variable datatype string  
    take one execute sql task, pick your source table names dynamically as you desired from metadata table \
    "SELECT sourcetblname as Res FROM @metadata WHERE ID=1" in sql statement and then go to name the result name as Res (I meant same as table alias) and map it to variablename1
    And in variable2 go to expression and write "Select * from "+@[User::variable].. and this will be your constructed dynamic command for oledb destination.
    And connect that execute sql task to (Data flow task)oledb source and choose data access mode as sql command with variable,and choose variable2. below is the diagram.
    - please mark correct answers

  • How to find Table Name and Field Names given a Data Source

    Hi,
    I tried ROOSOURCE table in R/3 to find the Extract Structure and Extractor names for a specific data source, let us say 2LIS_02_ITM (PO Item Level).
    I know the extract structure for this data source is MCO2M_0ITM
    I am not able to find where this structure is extracting the data for every field.. I wanted to know the corresponding table name and the respective field names.. Both the existing and Appended fields..
    Thanks,
    Naren

    Hi,
    Check in in LBWE and Click on Maintenance and see the table names
    EKKO
    EKPA
    EKPO
    Tables are use for this DS
    Eg:
    MCEKKO  BEDAT  Document Date
    MCEKKO  BSART  Document Type
    MCEKKO  BSTYP  Doc. Category
    MCEKKO  BUDAT  Accounting date
    MCEKKO  EBELN  Purchasing Doc.
    MCEKKO  EKGRP  Purch. Group
    Note: here EKKO is table
    https://wiki.sdn.sap.com/wiki/display/BI/BW%20SD%20MM%20FI%20DATASOURCES
    thanks
    Reddy
    Edited by: Surendra Reddy on Mar 10, 2010 8:18 AM
    Edited by: Surendra Reddy on Mar 10, 2010 8:19 AM

  • SSRS Reports level how to find out All tables names & columns list to display dynamically SQL Query????

    Hi Team,
    I Have one requirement,In SSRS Reporsitory 3000 reports are available.
    My end user requirement All 3000 reports are used Table names & columns list of each wise to display single table or single result set.
    I find out all 3000 reports details are diplayed single results set like
    Report Id,Path,Dataset,Source Query Text,Datasource
    In Source Query Text  column level All reports Queries are available but I want Each Report wise Table name & columns List.If any solution Please share me.
    Regards
    Rama

    Hi Ramakoteswara,
    According your description, you want to show used tables and columns of each report, and display is into a single result set. Right?
    In this scenario, we don't know where to find a column contains the Source Query Text. With my understanding, in Reporting Services, we have Catalog table in ReportServer DataBase, it has a column called Content stores the report code (.xml). In the
    code we can find the Query and Fields. Then you need to use VB/C# code to parse each .xml code of each report and fetch out the table name and columns. We do not support writing any queries against SSRS DataBase or parsing data records in any
    table.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • See Multiple node names under Import manager source table of single XML

    Hi,
    I have a xml file with differnt nodes of following structure when it comes to IMport manager It shows multipletable names where I can choose Business Partner, Partner, RemoteSystem... But My maps are based on Partner only.. Now I need to update the look up Qualifer table.. of which values are in Type.. Which I am unable to see under Partner node in import manager...I dont see the fields of Type Node under Map Filed/Values tab...
    <Business_partner xlms....
    --<Partner>
    <Address>
    <name>   
    <name1>
    <Role>
    <A>   
    <B>
    <Remote SYstem>
    <name>   
    <Code>
    <Type>
    <Type>   
    <Type2>
    Can any one put there comments please..
    Thanks
    Rajeev

    Hello Rajeev
    "Import manager guide"
    page 36:
    "For XML source files, the source table list displays the nested elements defined in the XML schema."
    page 44:
    "The XML Schema list includes an entry for each XML schema defined in the MDM Console."
    page 86:
    "Ways in which the Source Hierarchy tree now reflects an XML fileu2019s structure include:
    u2022 Top-level node is the source XML file
    u2022 Tables in the tree represent nested XML structures
    u2022All tables are nested under the root element
    u2022 Fields in the tree represent data-storing XML elements
    u2022 Joins and _ID fields are no longer added or required
    With these changes, users no longer have to manually recreate the relationships implicit in the XML schema, as they are preserved by MDM and accurately reflected in the source hierarchy tree.
    NOTE ►► To ensure that Import Manager correctly interprets the structure of an XML file, specify its corresponding XML schema file in the Connect to Source dialog (see u201CStarting and Exiting the Import Manageru201D on page 43 for more information)."
    page 188:
    "When the source is an XML file, the Available Fields list is limited to nodes which are siblings (on the same level as), or children of (nested below) the currently selected Source Hierarchy tree node."
    page 213
    "For example, if a source file is in XML format, Import Manager uses a tree in the Source Fields grid to depict the nested structure of fields within the associated XML schema."
    Use XML schema for right node showing
    Regards
    Kanstantsin Chernichenka

  • How-To Find the R/3 Table Name for a BW Data Source

    Hi there,
      Please advice how can I find the respective table name in R/3 for a particular BW DataSource ?
      P/S : I would like a technical how-to instead of referring the table names at HELP.SAP.COM
      For instance, for my Standard Business Content Info Cube 0CCA_C03(CO-OM-CCA: Statistical Key Figures) which extracts from BW Data Source: 0CO_OM_CCA_4
      My question is, how can I find out which specific tables in SAP R/3 is this Data Source pulling the data from ?

    Hi Dinesh,
       Data Source: 0CO_OM_CCA_4
       1) In my R/3, I ran SE16 : Table -> ROOSOURCE
       2) OLTPSOURCE -> 0CO_OM_CCA_4
       3) EXMETHOD = F1
         (Hence, I assume the Extraction Method is a Function Module)
       4) So, Function Module = BWOM_RS_GET_CTRSTA
       5) Run SE37 in R/3
          How do I find out the specific tables in this Function Module ?
          Would you please list them for me, so I can further refer to the individual tables ?

Maybe you are looking for