Tables and Joins used in constructing SQL

I am new to OBIEE. I contructed my physical layer table joins etc.
In my logical layer I have a source that is using a few physical tables. I have defined the joins (some right outer etc.). I go into Answers to display some info. When I examine my SQL source in NQQuery.log I see tables being used that I have not defined in my source. It is picking some from my other Logical tables. Why is that? Is it from the way I joined things in the Business Model?

Double post:
Outer Joins with multiple columns
The two post are similar. You have first to understand the logic of OBIEE.
And first which table is your fact table ?
http://gerardnico.com/wiki/dat/obiee/bi_server/design/fact_table/obiee_identifying_fact_table
Cheers
Nico

Similar Messages

  • List of SQL tables and attributes used in SSRS reports

    Hi,
    I have around 450-500 reports deployed in SSRS reporting server.
    All these reports are built on SQL from multiple databases, and these databases are having unnecessary tables and attributes.
    My requirement is to clean the unused tables and attributes from the databases. For this, I need the list of SQL tables and attributes used in these 450-500 SSRS reports.
    Is there any way to get this data?
    Regards,
    RK

    Hi RK,
    According to your description, you want to get a list of the tables and attributes used in all reports.
    In your scenario, you can query the ReportServer.dbo.Catalog table to get Report name, data source name, dataset name, and query used in the dataset with query below:
    WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd )
    SELECT ReportName = name
    ,DataSetName = x.value('(@Name)[1]', 'VARCHAR(250)')
    ,DataSourceName = x.value('(Query/DataSourceName)[1]','VARCHAR(250)')
    ,CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
    ,Fields = df.value('(@Name)[1]','VARCHAR(250)')
    ,DataField = df.value('(DataField)[1]','VARCHAR(250)')
    ,DataType = df.value('(rd:TypeName)[1]','VARCHAR(250)')
    --,ConnectionString = x.value('(ConnectionProperties/ConnectString)[1]','VARCHAR(250)')
    FROM ( SELECT C.Name,CONVERT(XML,CONVERT(VARBINARY(MAX),C.Content)) AS reportXML
    FROM ReportServer.dbo.Catalog C
    WHERE C.Content is not null
    AND C.Type = 2
    ) a
    CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet') r ( x )
    CROSS APPLY x.nodes('Fields/Field') f(df)
    ORDER BY name
    For more information, please refer to this similar thread:
    Extract metadata from report server database
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Sql query parsing (retrieve tables and columns used in query)

    Hi,
    1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.
    2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .
    Thanks and Regards,
    Luqman

    luqman123 wrote:
    Hi,
    1. Is there any view in Oracle which can tell me, which tables and columns were used in the last ran query, no matter how complex the query is.I don't believe so. You can look at V$SQL and retrieve the actual SQL text from there.
    2. Secondly I can get table names, used in stored procedures and views, using USER_DEPENDENCIES VIEW, however this System View does not return column names, used in that procedure / view, any idea please .Oracle added fine grained dependency tracking in 11g, but didn't expose any views to query this information. However, it has been reverse engineered a bit: About Oracle: DBA_DEPENDENCY_COLUMNS

  • Dimension build using SQL table and process to fill the SQL table

    I have a dimension in a cube that is manually* built by one of our power users. Now I have to get all the member information of that dimension into a SQL table(example : with columns...level0,level0property,level1,level1property etc....) to use that table in STUDIO for member load.
    Is there any easy process to do this? Currently I am building each and every row manually in that SQL table and there are 1100+ members in that manually built dimension. Please advice.

    Thank you so much Glenn!! That worked!! You make our lives so much easier!!

  • Tables and Columns used in Universe (BO 6.5)

    Hi All,
    Please help me out with the below queries:
    1. Is there any automated way to find out which report is using which universe? (may be through a SQL fired in BO repository)
    (Note: As per the BO Documentation, OBJ_X_DOCUMENTS This is the only table in the document domain. It stores the binary content of all documents sent to the repository (through the user actions Publish to corporate documents, Send to users or Send to Broadcast Agent). The document contents are stored as BLOBs (Binary Large Objects) stored in slices.)
    2. I need to identify the universes which use certain tables and columns.
    I fired the following SQL in BO repository:
    SELECT
    UNV_UNIVERSE.UNI_FILENAME,
    UNV_UNIVERSE.UNI_LONGNAME,
    UNV_TABLE.TAB_NAME,
    UNV_COLUMNS.COLUMN_NAME
    FROM UNV_UNIVERSE, UNV_TABLE,UNV_COLUMNS
    WHERE
    UNV_UNIVERSE.UNIVERSE_ID = UNV_TABLE.UNIVERSE_ID
    AND UNV_TABLE.TABLE_ID = UNV_COLUMNS.TABLE_ID
    But as 'UNV_COLUMNS' table is empty, no data is returned. My question is is this table supposed to be empty in BO repository?
    Is there any other way to find out this (identify the universes which use certain tables and columns)?
    Many Thanks & Regards,
    Sandeep

    Hi,
    Please find the below list of tables created in the BO repository, which helps you to retrieve the information related to reports, universes, users e.t.c.
    OBJ_M_ACTOR
    OBJ_M_ACTORDOC
    OBJ_M_ACTORLINK
    OBJ_M_CATEG
    OBJ_M_CONNECTDATA
    OBJ_M_CONNECTION
    OBJ_M_DOCAT
    OBJ_M_DOCATVAR
    OBJ_M_DOCCATEG
    OBJ_M_DOCCST
    OBJ_M_DOCUMENTS
    OBJ_M_GENPAR
    OBJ_M_MAGICID
    OBJ_M_OBJSLICE
    OBJ_M_REPOSITORY
    OBJ_M_RESERVATION
    OBJ_M_RESLINK
    OBJ_M_TIMESTAMP
    OBJ_M_UNIVCST
    OBJ_M_UNIVDBCST
    OBJ_M_UNIVERSES
    OBJ_M_UNIVSLC
    OBJ_M_USRATTR
    OBJ_X_DOCUMENTS
    UNV_AUDIT
    UNV_CLASS
    UNV_CLASS_DATA
    UNV_COLUMNS
    UNV_COLUMN_DATA
    UNV_CONTEXT
    UNV_CONTEXT_DATA
    UNV_CTX_JOIN
    UNV_DIMENSION
    UNV_DIM_OBJ
    UNV_JOIN
    UNV_JOINCONTENT
    UNV_JOIN_DATA
    UNV_JOIN_OBJECT
    UNV_OBJCONTENT
    UNV_OBJECT
    UNV_OBJECT_DATA
    UNV_OBJECT_KEY
    UNV_OBJ_COLUMN
    UNV_OBJ_TAB
    UNV_PROPERTY
    UNV_PROP_DATA
    UNV_PROP_TAB
    UNV_RELATIONS
    UNV_TABLE
    UNV_TABLE_DATA
    UNV_TAB_OBJ
    UNV_TAB_PROP
    UNV_UNIVERSE
    UNV_UNIVERSE_DATA
    UNV_X_UNIVERSES
    Hope this tables helps you.

  • Inserting in multiple tables and joining data

    I am using DW8, PHP and MySQL.
    I've created a database for software inventory. One table is
    a list of software products and the other is the licensing
    information. I set it up this way because we have a product such as
    Windows XP that will have different licenses. But the end result
    will be someone clicking on Windows XP and seeing all licenses for
    that product.
    I've created a page to insert into the software table and one
    for the licensing information. Now I need to make a third page so
    that the user can select the product from a dropdown menu and then
    enter the licensing information. I have join setup between the
    tables in the MySQL backend. How do I tell Dreamweaver that the
    license being entered is related to the correct product?
    Thanks!

    Nevermind, I figured out how to do this.

  • Expand the Warehouse tables X adding physical tables and joins

    I was questioned about these options:
    a) Add physical tables (from other DBs) and modifying the physical model with new joins + modifying logical model to include new columns
    b) Expand warehouse tables to include new columns in the tables. Doing a complementar ETL in order to feed the additional columns with data. Logical model would be updated but the idea in this option is to avoid joins in the physical layer.
    My understanding is that option a) despite the joins in the physical layer would be a better strategy.
    Pls. I'd appreciate any comments on the performance side or in the amount of effort to create the complementar ETL...
    Txs.
    Antonio

    Hi Lombo,
    I am not sure about what you mean with option a. In my understanding, you are asking for a comparison between:
    a) adding data from an additional source in the RPD:
    This means that you have to create an additional data source in the physical layer. I do not think you can create relations between physical tables sourced from different data sources in your physical layer. This means that the data is related in the logical layer. By doing this, the BI Server has to join the data from both sources for each front-end request. Also, it will have to perform the last aggregations instead of shipping it to the database. This is a big performance hit in terms of response time.
    However! It can be much and much faster in terms of development effort required to support this. If it's only a limited number of columns and tables being added, this may be a valid option. You can also use this approach to prototype option b.
    b) adding data from an additional source using ETL:
    Quite some work in terms of development effort. However, all complexity and performance hits are moved to the bottom of the stack and process: database and ETL. You will need to create an additional data source in the DAC, additional custom folder(s) in Informatica and the ETL logic to update the existing tables and/or load new tables.
    Additionaly, you need to expand the RPD with the new columns / tables, just as you would do in option a. However, now it will be sourced from the same datasource: less work for the BI Server to deliver the dataset to satisfy the request.
    So basically, I would consider:
    - How does the system currently perform: response times in the front end ( bad -> go for option b )
    - How many columns will be added and how often will they be used in the front-end
    - Informatica / DAC / OBI expertise available
    - How long do you have to facilitate reporting on data from the 2nd source
    Good luck!

  • How to search tables and views used in the code of oracle fmb 6i from another form???

    Hii guys, this is a very interesting question and i hope that it will have ample amount of answers.
    My requirement is to know the number of tables and views and backend functions/procedures which are used in the code written in the oracle forms 6i,
    all i want is to display whole views, tables or functions/procedures which are written  in the code of a particular fmb, i do have the path of that fmb and i want to read the code and search through it's entire code for the tables/views/backend procedures/functions written in the code. So how to search through the entire code of a particular form (6i) and make it display through another form.
    I am using oracle forms 6i.
    Please help me out....
    With Regards:
    Ankit Chandra

    Here is a modified dealForm.jsp that merges the 2 steps - both symbol submission and Yahoo convert is done by it. Play with it and add your DB code to it:
    <html>
    <head><title>IPIB Database Selection</title></head>
    <body bgcolor="#DFDFFF">
    <H1><CENTER>IPIB Database Selection</CENTER></H1>
    <font size=4>
    <%@ page language="java" %>
    <%@ page import="java.net.*,java.io.*,java.util.*" %>
    <%
    String symbol = request.getParameter("symbol");
    if (symbol != null) {
    String urlString = "http://finance.yahoo.com/download/javasoft.beans?SYMBOLS=" + symbol + "&format=ab";
    try {
    URL url = new URL(urlString);
    URLConnection con = url.openConnection();
    InputStream is = con.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = br.readLine();
    StringTokenizer tokenizer = new StringTokenizer(line,",");
    String name = tokenizer.nextToken();
    name = name.substring(1, name.length()-2);
    String price = tokenizer.nextToken();
    price = price.substring(1, price.length()-2);
    %>
    <p>
    Original line from yahoo <%= line %>
    </p> <p>
    Name: <%= name %>
    </p> <p>
    Price: <%= price %>
    </p> <p>
    Pub DB processing code from dealLoad.jsp here
    </p>
    <%
    } catch (IOException exception) {
    System.err.println("IOException: " + exception);
    } else { %>
    <form action="dealForm.jsp"method="GET">
    <p>Enter Symbol: <input size="20" name="symbol">
    <inputtype="submit" value="Submit">
    </p></form>
    <% } %>
    </font>
    </body>
    </html>

  • How to query 2 hierarchical tables and join?

    Hi
    I've been bashing my head against a well to get this to work efficiently in 10g. I can solve the following writing some pretty horrible SQL, but can't figure out how to do it elegantly and optimally.
    We have two hierarchical tables as follows:
    select * from data_categories dac
    dac_code name parent_dac_code
    10 MANAGEMENT
    20 MEDICATION 10
    30 PROCEDURE 10
    40 SURVEY
    50 ASSESS
    60 NATURE 50
    70 OBSERVE 60
    select * from data_elements des
    des_id name parent_des_id dac_code display_seq
    100 DOSE MEDICATION 1
    110 1MG 100 1
    120 2MG 100 2
    130 3MG 100 3
    140 ROUTE MEDICATION 2
    150 ET 140 1
    160 EM 140 2
    170 RESPONSE MEDICATION 3
    180 IMPROVED 170 1
    190 NOCHANGE 170 2
    200 FILED MANAGEMENT 1
    210 INPUT OBSERVE 1
    You'll note:
    1) We have hierarchies in both tables, and a fk from data_elements to data_categories via the dac_code.
    2) The depth of both data_categories and data_elements is unlimited.
    3) There is no single root node record in either table.
    4) The appropriate PK and FK indexes exist.
    We need to write a query that returns the following results:
    root_dac_code parent_dac_code des_level des_id name display_seq
    ASSESS OBSERVE 1 210 INPUT 1
    MANAGEMENT MEDICATION 1 100 DOSE 1
    MANAGEMENT MEDICATION 2 110 1MG 1
    MANAGEMENT MEDICATION 2 120 2MG 2
    MANAGEMENT MEDICATION 2 130 3MG 3
    MANAGEMENT MEDICATION 1 140 ROUTE 1
    MANAGEMENT MEDICATION 2 150 ET 1
    MANAGEMENT MEDICATION 2 160 EM 2
    MANAGEMENT MEDICATION 1 170 RESPONSE 3
    MANAGEMENT MEDICATION 2 180 IMPROVED 1
    MANAGEMENT MEDICATION 2 190 NOCHANGE 2
    MANAGEMENT MANAGEMENT 1 200 FILED 1
    You'll also note we need to return the data in order of the root_dac_code, then parent_dac_code, followed by the display_seq.
    Does anybody know how to write this query in an elegant and optimal manner?
    Many thanks for any help!
    Cheers,
    CM.

    Flakey model.
    Why does data_elements.dac_code appear to refer to data_categories.name rather than data_categories.dac_code?
    You do not appear to be ordering by root_dac_code, parent_dac_code and display_seq (if you were MANAGEMENT/MANAGEMENT would not be at the end). Did you perhaps mean ORDER BY root_dac_code, des_id, display_seq?
    Something like this perhaps?
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE TABLE data_categories (
      2    dac_code NUMBER,
      3    name VARCHAR2 (30),
      4    parent_dac_code NUMBER);
    Table created.
    SQL> INSERT INTO data_categories VALUES (10, 'MANAGEMENT', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (20, 'MEDICATION', 10);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (30, 'PROCEDURE', 10);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (40, 'SURVEY', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (50, 'ASSESS', NULL);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (60, 'NATURE', 50);
    1 row created.
    SQL> INSERT INTO data_categories VALUES (70, 'OBSERVE', 60);
    1 row created.
    SQL> CREATE TABLE data_elements (
      2    des_id NUMBER,
      3    name VARCHAR2 (30),
      4    parent_des_id NUMBER,
      5    dac_code VARCHAR2 (30),
      6    display_seq NUMBER);
    Table created.
    SQL> INSERT INTO data_elements VALUES (100, 'DOSE', NULL, 'MEDICATION', 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (110, '1MG', 100, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (120, '2MG', 100, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (130, '3MG', 100, NULL, 3);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (140, 'ROUTE', NULL, 'MEDICATION', 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (150, 'ET', 140, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (160, 'EM', 140, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (170, 'RESPONSE', NULL, 'MEDICATION', 3);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (180, 'IMPROVED', 170, NULL, 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (190, 'NOCHANGE', 170, NULL, 2);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (200, 'FILED', NULL, 'MANAGEMENT', 1);
    1 row created.
    SQL> INSERT INTO data_elements VALUES (210, 'INPUT', NULL, 'OBSERVE', 1);
    1 row created.
    SQL> SELECT dc.root_dac_code, de.parent_dac_code,
      2         de.des_level, de.des_id, de.name, de.display_seq
      3  FROM  (SELECT LEVEL des_level, des_id, name, parent_des_id,
      4                CONNECT_BY_ROOT (dac_code) parent_dac_code, display_seq
      5         FROM   data_elements da
      6         START WITH parent_des_id IS NULL
      7         CONNECT BY PRIOR des_id = parent_des_id) de,
      8        (SELECT CONNECT_BY_ROOT (name) root_dac_code, name dac_code
      9         FROM   data_categories
    10         START WITH parent_dac_code IS NULL
    11         CONNECT BY PRIOR dac_code = parent_dac_code) dc
    12  WHERE  de.parent_dac_code = dc.dac_code
    13  ORDER BY dc.root_dac_code, de.des_id, de.display_seq;
    ROOT_DAC_CODE  PARENT_DAC_CODE   DES_LEVEL DES_ID NAME    
    ASSESS         OBSERVE                   1    210 INPUT   
    MANAGEMENT     MEDICATION                1    100 DOSE    
    MANAGEMENT     MEDICATION                2    110 1MG     
    MANAGEMENT     MEDICATION                2    120 2MG     
    MANAGEMENT     MEDICATION                2    130 3MG     
    MANAGEMENT     MEDICATION                1    140 ROUTE   
    MANAGEMENT     MEDICATION                2    150 ET      
    MANAGEMENT     MEDICATION                2    160 EM      
    MANAGEMENT     MEDICATION                1    170 RESPONSE
    MANAGEMENT     MEDICATION                2    180 IMPROVED
    MANAGEMENT     MEDICATION                2    190 NOCHANGE
    MANAGEMENT     MANAGEMENT                1    200 FILED   
    12 rows selected.
    SQL>

  • Use SQL to INSERT a record into an Access table and populate using variables

    I am having difficulties with the following code:
    'Get my username
    UserNameWindows = GetUserName
    'Assemble my name and request corrections
    MsgBoxTitle = "What name do you want to use?"
    NewDefault = Replace(UserNameWindows, ".", " ")
    NewDefault = StrConv(NewDefault, vbProperCase)
    MyValue = InputBox(Message, MsgBoxTitle, NewDefault)
    RealName = MyValue
    'Assemble your email address
    MsgBoxTitle = "What is your email address?"
    NewDefault = UserNameWindows & "@calibreglobal.com.au"
    MyValue = InputBox(Message, MsgBoxTitle, NewDefault)
    EmailAddress = MyValue
    MsgBox "Your UserNameWindows value is " & UserNameWindows & "."
    'Insert UserNameWindows into the tblAuthorisedPeople table
    strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (" & UserNameWindows & ",""" & RealName & """, """ & EmailAddress & """)"
    DoCmd.RunSQL (strSQL)
    It asks me to enter the value for the Person field into a dialogue box instead of using the value of UserNameWindows.
    After entry, it accepts the other values and enters the record correctly.
    I have also tried this SQL string without success
    strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (" & Forms!frmCreateNew!UserNameWindows & ",""" & RealName & """, """ & EmailAddress & """)"
    Any comments?
    Barry Cuthbertson

    Found the error. I had used the rules for the syntax from a web forum reply which appears to have been incorrect!
    strSQL = "INSERT INTO tblAuthorisedPeople (Person, RealName, EmailAddress) VALUES (""" & UserNameWindows & """,""" & RealName & """, """ & EmailAddress &
    This seems to be working well as the moment
    All finished.
    Barry GC
     

  • Create Tables and UDO using Addon

    Hi,
    I created addon using simple installer. Before installing that add on i have manually create UDO and tables. is there any way i can modify my Addon which will create UDO and tables when i install addon in server.
    Developed my Add on using C#. for package using  B1DE Simple installer.
    Can some send me sample code for this at [email protected] or reply to this post your suggestions.
    Appreciate your help

    > UDO's are not accessable via code. 
    Hi Edward,
    but I created UDO via code and it works correctly.
    P Guddimath, here is a thread where I paste a code to create UDF, UDT and UDO Problem With Tables
    Regards,
    Hmg

  • Need help with create trigger based on more then 1 table and join.

    Hello,
    Here i have 3 tables
    1. Employee
    PERSON_ID
    1
    1
    N
    NUMBER
    None
    ORG_ID
    2
    N
    NUMBER
    Frequency
    LOC_ID
    3
    N
    NUMBER
    Frequency
    JOB_ID
    4
    Y
    NUMBER
    Height Balanced
    FLSA_STATUS_ID
    5
    Y
    NUMBER
    Frequency
    FULL_NAME
    6
    N
    VARCHAR2 (250 Byte)
    Height Balanced
    FIRST_NAME
    7
    N
    VARCHAR2 (20 Byte)
    Height Balanced
    MIDDLE_NAME
    8
    Y
    VARCHAR2 (60 Byte)
    Height Balanced
    LAST_NAME
    9
    N
    VARCHAR2 (40 Byte)
    Height Balanced
    PREFERRED_NAME
    10
    Y
    VARCHAR2 (80 Byte)
    None
    EMAIL
    11
    Y
    VARCHAR2 (250 Byte)
    None
    MAILSTOP
    12
    Y
    VARCHAR2 (100 Byte)
    None
    HIRE_DATE
    13
    N
    DATE
    None
    2. ems_candidate
    EMS_CANDIDATE_ID
    1
    1
    N
    NUMBER
    None
    EMS_JOB_ID
    2
    Y
    NUMBER
    Frequency
    NAME
    3
    N
    VARCHAR2 (255 Byte)
    Frequency
    EMAIL
    4
    Y
    VARCHAR2 (255 Byte)
    None
    TELEPHONE
    5
    Y
    VARCHAR2 (25 Byte)
    None
    EMS_SOURCE_ID
    6
    Y
    NUMBER
    Frequency
    RECEIVED_DATE
    7
    Y
    DATE
    Frequency
    COMMENTS
    8
    Y
    VARCHAR2 (4000 Byte)
    None
    3. employee_resources
    EMP_RES_ID
    1
    1
    N
    NUMBER
    None
    PERSON_ID
    2
    Y
    NUMBER
    Height Balanced
    CANDIDATE_ID
    3
    Y
    NUMBER
    Frequency
    EMP_START_DATE
    4
    Y
    DATE
    None
    CUSTOM_RESOURCE_FLAG
    5
    Y
    NUMBER (1)
    None
    RESOURCE_GROUP_ID
    6
    N
    NUMBER
    Frequency
    RESOURCE_STATUS_ID
    7
    N
    NUMBER
    Frequency
    GROUP_LOC_ID
    8
    N
    NUMBER
    Height Balanced
    ASSIGNED_JIRA
    9
    Y
    VARCHAR2 (250 Byte)
    None
    REVOKED_JIRA
    10
    Y
    VARCHAR2 (250 Byte)
    None
    CREATED_DATE
    11
    Y
    DATE
    SYSDATE
    None
    UPDATED_DATE
    12
    Y
    DATE
    None
    Now i want to create trigger when new record get inserted in employee table wanted to update person_id in employee_resources table.
    So i want to match ems_candidate.name with employee.full_name , ems_candidate.ems_job_id with employee.ems_job_id. And if it matched then update person_id in employee_resources table else through an exception and insert record in temp table.
    If anybody has an idea can u please help me.
    Thanks,
    Gayatri.

    I created below trigger
    CREATE TRIGGER emp_resources_upd_person_id
    AFTER INSERT ON ems.employee
    FOR EACH ROW
    BEGIN
        UPDATE ems.employee_resources
           SET person_id = :new.person_id
         WHERE candidate_id = (SELECT ems_candidate_id  
                                 FROM ems.ems_candidate cand, ems.employee emp
                                WHERE TRIM(UPPER(emp.first_name)) = TRIM(UPPER(SUBSTR (cand.name, 1, INSTR (cand.name, ' ') - 1)))
                                  AND TRIM(UPPER(emp.last_name)) = TRIM(UPPER(SUBSTR (cand.name,INSTR (cand.name, ' ') + 1,DECODE (INSTR (SUBSTR (cand.name, INSTR (cand.name, ' ') + 1), ' '),0,LENGTH (cand.name),(INSTR (SUBSTR (cand.name, INSTR (cand.name, ' ') + 1), ' ') - 1)))))
                                  AND emp.person_id = :new.person_id);
    EXCEPTION
      WHEN OTHERS THEN
        INSERT INTO ems.update_person_id_exception(person_id,first_name,last_name,full_name) VALUES(:new.person_id,:new.first_name,:new.last_name,:new.full_name);
    END;
    Now when i am trying to insert row in ems.employee  table it gives me an error
    ORA-04091
    table string.string is mutating, trigger/function may not see it
    Cause: A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.
    Action: Rewrite the trigger (or function) so it does not read that table.
    Can anybody please help me to come out from these error.
    Thanks,
    Gayatri.

  • Exception raised while trying to join Table and Stream

    I have written a sample Project to fetch the data from a Table and join it with the Input Stream. Followed the same procedure specified at http://download.oracle.com/docs/cd/E17904_01/doc.1111/e14301/processorcql.htm#CIHCCADG
    I am getting the exception:
    <Error> <Deployment> <BEA-2045016> <The application context "Plugin" could not be started. Could not initialize component "<unknown>":
    Invalid statement: "select PROMOTIONAL_ORDER.ORDER_ID as orderId ,PROMOTIONAL_ORDER.UFD_ID as ufdId, PROMOTIONAL_ORDER.WEB_USER_ID as webUserId
                   from helloworldInputChannel [now] as dataStream, PROMOTIONAL_ORDER where >>PROMOTIONAL_ORDER.ORDER_ID = dataStream.ORDER_ID<<"
    Cause: wrong number or types of arguments in call to et
    Action: Check the spelling of the registered function. Also confirm that its call is correct and its parameters are of correct datatypes.>
    If the where condition is removed then the application runs fine fetching the data from the Tables.
    Following is the config.xml for processor:
    ======================================
    <?xml version="1.0" encoding="UTF-8"?>
    <n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
         <processor>
              <name>helloworldProcessor</name>
              <rules>
                   <query id="dummyRule"> <![CDATA[
                   select PROMOTIONAL_ORDER.ORDER_ID as orderId ,PROMOTIONAL_ORDER.UFD_ID as ufdId, PROMOTIONAL_ORDER.WEB_USER_ID as webUserId
                   from helloworldInputChannel [now] as dataStream, PROMOTIONAL_ORDER where PROMOTIONAL_ORDER.ORDER_ID = dataStream.ORDER_ID
                   ]]></query>
              </rules>
         </processor>
    </n1:config>
    Following is the assembly file:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
         xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
         xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/osgi
    http://www.springframework.org/schema/osgi/spring-osgi.xsd
    http://www.bea.com/ns/wlevs/spring
    http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd">
         <wlevs:event-type-repository>
              <wlevs:event-type type-name="CorpInterfaceEvent">
                   <wlevs:class>com.bea.wlevs.event.example.helloworld.CorpInterfaceEvent</wlevs:class>
              </wlevs:event-type>
              <wlevs:event-type type-name="PromotionalOrderEvent">
                   <wlevs:properties>
                        <wlevs:property name="ORDER_ID" type="bigint" />
                        <wlevs:property name="UFD_ID" type="bigint"/>
                        <wlevs:property name="WEB_USER_ID" type="bigint" />
                   </wlevs:properties>
              </wlevs:event-type>
              <wlevs:event-type type-name="DummyEvent">
                   <wlevs:properties>
                        <wlevs:property name="ORDER_ID" type="bigint" />
                        <wlevs:property name="UFD_ID" type="bigint"/>
                        <wlevs:property name="WEB_USER_ID" type="bigint" />
                   </wlevs:properties>
              </wlevs:event-type>
         </wlevs:event-type-repository>
         <!--
              Adapter can be created from a local class, without having to go
              through a adapter factory
         -->
         <wlevs:adapter id="helloworldAdapter"
              class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter">
              <wlevs:instance-property name="message"
                   value="HelloWorld - the current time is:" />
         </wlevs:adapter>
         <wlevs:channel id="helloworldInputChannel" event-type="CorpInterfaceEvent">
              <wlevs:listener ref="helloworldProcessor" />
              <wlevs:source ref="helloworldAdapter" />
         </wlevs:channel>
         <!-- The default processor for OCEP 11.0.0.0 is CQL -->
         <wlevs:processor id="helloworldProcessor">
              <wlevs:table-source ref="PROMOTIONAL_ORDER" />
         </wlevs:processor>
         <wlevs:channel id="helloworldOutputChannel" event-type="CorpInterfaceEvent"
              advertise="true">
              <wlevs:listener>
                   <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean" />
              </wlevs:listener>
              <wlevs:source ref="helloworldProcessor" />
         </wlevs:channel>
         <wlevs:table id="PROMOTIONAL_ORDER" event-type="PromotionalOrderEvent"
              data-source="wlevsDatasource" />
    </beans>
    CorpInterfaceEvent.java:
    package com.bea.wlevs.event.example.helloworld;
    public class CorpInterfaceEvent {
    private Long orderId;
    public Long ORDER_ID;
    private Long ufdId;
    private Long webUserId;
    public CorpInterfaceEvent(){
         super();
    public Long getOrderId() {
         return orderId;
    public void setOrderId(Long orderId) {
         this.orderId = orderId;
    public Long getORDER_ID() {
         return ORDER_ID;
    public void setORDER_ID(Long oRDERID) {
         ORDER_ID = oRDERID;
    public Long getUfdId() {
         return ufdId;
    public void setUfdId(Long ufdId) {
         this.ufdId = ufdId;
    public Long getWebUserId() {
         return webUserId;
    public void setWebUserId(Long webUserId) {
         this.webUserId = webUserId;
    Adapter:
    /* (c) 2006-2009 Oracle. All rights reserved. */
    package com.bea.wlevs.adapter.example.helloworld;
    import java.math.BigDecimal;
    import java.text.DateFormat;
    import java.util.Date;
    import com.bea.wlevs.ede.api.RunnableBean;
    import com.bea.wlevs.ede.api.StreamSender;
    import com.bea.wlevs.ede.api.StreamSource;
    import com.bea.wlevs.event.example.helloworld.CorpInterfaceEvent;
    public class HelloWorldAdapter implements RunnableBean, StreamSource {
    private static final int SLEEP_MILLIS = 300;
    private DateFormat dateFormat;
    private String message;
    private boolean suspended;
    private StreamSender eventSender;
    public HelloWorldAdapter() {
    super();
    dateFormat = DateFormat.getTimeInstance();
    /* (non-Javadoc)
    * @see java.lang.Runnable#run()
    public void run() {
    suspended = false;
    while (!isSuspended()) { // Generate messages forever...
    generateHelloMessage();
    suspend();// This would generate the messages only once..
    try {
    synchronized (this) {
    wait(SLEEP_MILLIS);
    } catch (InterruptedException e) {
    e.printStackTrace();
    public void setMessage(String message) {
    this.message = message;
    private void generateHelloMessage() {
    String message = this.message + dateFormat.format(new Date());
    CorpInterfaceEvent event = new CorpInterfaceEvent();
    //event.setOrderId(1);
    event.setORDER_ID(Long.valueOf(1));
    eventSender.sendInsertEvent(event);
    /* (non-Javadoc)
    * @see com.bea.wlevs.ede.api.StreamSource#setEventSender(com.bea.wlevs.ede.api.StreamSender)
    public void setEventSender(StreamSender sender) {
    eventSender = sender;
    /* (non-Javadoc)
    * @see com.bea.wlevs.ede.api.SuspendableBean#suspend()
    public synchronized void suspend() {
    suspended = true;
    private synchronized boolean isSuspended() {
    return suspended;
    Kindly let me know if you need further info.

    Issue identified. The datatypes of the stream order id and the one from the tables differ.
    The Long could not be casted to the bigint format of CQL.
    On changing the datatype of ORDER_ID in the CorpInterfaceEvent to int, the join is successful.

  • How to find Tables and Fields from R3 that some InfoSource use

    Hi people,
    I already know how to get the table or fields from R3 that some InfoSource use by "Portal SAP" that our friend here answered.
    Now, I would like to know if there is some way to get this but using some transaction in the ECC6 (R3) or BW.
    I ask by that because I will be some situation that I will have to  know tables and fields that some InfoSource use and maybe there isn't in the Portal SAP.
    Obs.: I don't know ABAP, so I would like some way that doesn't use Debug (ABAP), if it is possible.
    Thank you,
    Rosana.

    Hi Rosanna
    In many cases you will be able to get documentation from help.sap.com regarding the tables and fields used by standard datasources. For example for all the Sales and Distribution datasources you can refer the below link
    http://help.sap.com/saphelp_nw70/helpdata/en/17/cd5e407aa4c44ce10000000a1550b0/frameset.htm
    Here you can click on the different datasources and see both the table and field names. If you are looking for any specific datasource let me know...may be i can help.
    Thanks.

  • Drag-n-n-drop query joins uses WHERE, not INNER JOIN syntax

    When I highlight a few tables and drag them onto the sql worksheet, it will build a select statement for me and join the tables by their foreign keys.
    That's a nice feature, thanks!
    Three questions. Is it possible to:
    1. get it to use the INNER JOIN and LEFT OUTER JOIN syntax instead of joining the tables in the WHERE clause?
    2. control the table aliases so that it will automatically use the "standard alias" for the table instead of A, B, C, etc.?
    3. get it to not put the schema name into the query?
    Thanks!
    Edited by: David Wendelken on Nov 22, 2008 1:48 PM. Grammar mistake.

    Hi Gopi,
    Your code is Good.
    But try to avoid Inner join with more number of Tables ...because this is a performance issue..
    try to use..
    select (primary key fields mainly,other fields) from LIKP into itab where bolnr in p_bolnr(paramater).
    next try to use for all entries option..
    select (primary key fields mainly,other fields) from VBFA for all entries in itab where (give the condition)....
    simillarly do for the other select ....ok this will try to reduce the performance issue....
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

Maybe you are looking for

  • Cannot Create RDF View in R2RML Conversion Example

    Hi All, In a project I want to do a R2RML conversion. I folowed below steps according to 12c Release 1 tutorial. 1. Create a stage table with below command. CREATE TABLE stage_table_name(                      RDF$STC_sub varchar2(4000) not null,     

  • PC suite need dial pad

    Hello I would like to have in PCsuite dial panel for dialing numbers not in my contact list. I use PC Suite as follows: Phone + set BH-700 + the computer I accept calls simply pressing the button on dialog window which gives out PC Suite, therefore I

  • Quality of black text printing with 7960

    My 7960 does not print black.  It has a blue tint to it.  Ink cartridge has been changed

  • Setups in Database installation or patch application

    Hi all, In the database installation or patch application, in the unzipped directories you have multiple setup.exe files along with oui.exe. For example: in 10g you have one setup.exe under directory 10gR2_server\database also you have one setup.exe

  • When watching news movies, I go to full screen, and screen goes blank.

    The small video image which shows the news has a button to make the image full screen. When I press that, the whole screen goes blank. When I use Internet Explorer, it works OK. I think It was also OK when I used the previous version of Firebird.