Join as a Condition

Hello

I'd like to get the code from location_lookup table based on a descriptive text of the location_source table, but this would require a join by using a like condition. There are also several research location with unique codes, but the requirement would be to select the first code:

create the table location_source
(code number,
Description varchar2 (100)
);

insert into location_source values (", 'visit London');
insert into location_source values (", 'flight Paris 9,30');
insert into location_source values (", 'baggage 20kg Hong kong');
insert into location_source values (", 'check out 6.30');
insert into location_source values (", 'new york, 23 Jul');
insert into location_source values (", 'jy688 of flight sydney');

create the table location_lookup
(code number
location_lookup varchar2 (10)
);

insert into location_lookup values (001, "London");
insert into location_lookup values (002, "London");
insert into location_lookup values (003, 'Paris');
insert into location_lookup values ('004, Hong Kong");
insert into location_lookup values (005, 'Paris');
insert into location_lookup values ('006, New York");

The SQL looks like this:

Select s.*, min (l.code), l.location_lookup

of location_source s, locaction_lookup l

and SUPERIOR (s.description |) "%') as superior (l.location_lookup |) » %')

Group of s.*, l.location_lookup

Power required:

CodeDescriptionCodeLocation_Lookup
check in London001London
Paris 9:30 flight003Paris
baggage 20kg Hong kong004Hong Kong
starting at 6:30
New york 23 Jul006New York City
flight sydney jy688

You try to use Oracle Text.

How to prepare the SCOTT to use Oracle Text:

SQL>
SQL> SHOW USER
USER is "SYS"
SQL>
SQL> GRANT ctxapp TO scott;

Grant succeeded.

SQL> GRANT EXECUTE ON CTXSYS.CTX_CLS TO scott;

Grant succeeded.

SQL> GRANT EXECUTE ON CTXSYS.CTX_DDL TO scott;
GRANT EXECUTE ON CTXSYS.CTX_DOC TO scott;
GRANT EXECUTE ON CTXSYS.CTX_OUTPUT TO scott;
GRANT EXECUTE ON CTXSYS.CTX_QUERY TO scott;
GRANT EXECUTE ON CTXSYS.CTX_REPORT TO scott;
GRANT EXECUTE ON CTXSYS.CTX_THES TO scott;
GRANT EXECUTE ON CTXSYS.CTX_ULEXER TO scott;
Grant succeeded.

SQL>
Grant succeeded.

SQL>
Grant succeeded.

SQL>
Grant succeeded.

SQL>
Grant succeeded.

SQL>
Grant succeeded.

Now the test itself:

SQL> SHOW user
USER is "SCOTT"
SQL> --My database version.
SQL> SELECT * FROm v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> SELECT * FROM location_source;

      CODE DESCRIPTION
---------- ----------------------------------------------------------------------------------------------------
           check in london
           flight Paris 9.30
           baggage allowance 20kg Hong kong
           check out 6.30
           new york 23rd Jul
           flight jy688 sydney

6 rows selected.

SQL> SELECT * FROM location_lookup;

      CODE LOCATION_L
---------- ----------
         1 London
         2 London
         3 Paris
         4 Hong Kong
         5 Paris
         6 New York

6 rows selected.

SQL> CREATE INDEX location_source_idx ON location_source(description) INDEXTYPE IS CTXSYS.CONTEXT;

Index created.

SQL>  EXEC DBMS_STATS.GATHER_TABLE_STATS(USER, 'LOCATION_SOURCE', cascade=>TRUE);

PL/SQL procedure successfully completed.

SQL> ed
Wrote file afiedt.buf

  1  SELECT ls.code,
  2    ls.description,
  3    MIN(ll.code) new_code,
  4    ll.location_lookup
  5  FROM location_source ls
  6  LEFT OUTER JOIN location_lookup ll
  7  ON contains(ls.description,ll.location_lookup)>0
  8  GROUP BY ls.code,
  9    ls.description,
 10*   ll.location_lookup
SQL> /

      CODE DESCRIPTION                                                                                            NEW_CODE LOCATION_L
---------- ---------------------------------------------------------------------------------------------------- ---------- ----------
           check in london                                                                                               1 London
           baggage allowance 20kg Hong kong                                                                              4 Hong Kong
           check out 6.30
           new york 23rd Jul                                                                                             6 New York
           flight Paris 9.30                                                                                             3 Paris
           flight jy688 sydney

6 rows selected.

Tags: Database

Similar Questions

  • VO join EOs 2: conditionally updating only 1 EO.

    I have a view object that joins the tables of 2 DB/EOs, mainly to display data attached in an ADF Faces table.

    However, I now apply for the user to be able to update the attached data. The user will be able to update the data that would go in one or both of the DB tables.

    Now, let's say that in a given table ADF Faces line, a user updates the data happens in A DB Table, but does not change the DB table B data. It seems that during the validation of the task flow operation runs, the framework commits data at the same time table DB A and B. This is not, I can present our application functionality - without going into details, it has to do with the UPDATE BEFORE and AFTER the UPDATE DB triggers.

    So, is there a way to configure or code so that the update only occurs when the DB Table, for which the data has actually changed? in other words, in the example above, since no data for table B has been changed, I would that the DB to update only to the Table has.

    I know that another approach is just to not use has the VO attached; However, it would be much more productive if there is a way to do it, where the question.

    Using 11g.

    Thanks for your help.

    Well, there is always a way to prevent the operation of update at the level of the entities.
    In the entity class that corresponds to table B, you can do the following:

        protected void doDML(int operation, TransactionEvent e) {
           if (operation != DML_UPDATE)
              super.doDML(operation, e);
        }
    

    Of course, you can examine the additional conditions, for example (in pseudocode):

        if ((operation == DML_UPDATE) && theUserHasReallyChangedThisEntity())
               super.doDML(DML_UPDATE, e);
        else
              super.doDML(operation, e);
    
  • outer join and OR condition

    Hello world

    I have a query that is not working properly. I'm trying to join two tables and I or condition and outer join
    I get the error message
     ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    
    my query is as follow
    
    SELECT l.* FROM table1 l, table2 map
    WHERE (NVL(l.id, '-99') = NVL(map.id(+), NVL(l.id, '-99'))
            AND  l.TYPE = 'TKE')
          ) OR 
        (NVL(l.id, '-99') = NVL(map.id(+), NVL(l.id, '-99'))
    AND NVL(l.type, '-99') = NVL(map.type(+), NVL(l.type, '-99'))
    AND NVL(l.pos_22, '-99') = NVL(map.pos_22(+),NVL(l.pos_22, '-99'))
    AND NVL(l.pos_27, '-99') = NVL(map.pos_27(+),NVL(l.pos_27, '-99'))
    AND NVL(l.pos_17, '-99') = NVL(map.pos_17(+),NVL(l.pos_17, '-99'))
    AND NVL(l.pos_18, '-99') = NVL(map.pos_18(+),NVL(l.pos_18, '-99'))
    AND NVL(l.pos_12, '-99') = NVL(map.pos_12(+),NVL(l.pos_12, '-99'))
    AND NVL(l.pos_16, '-99') = NVL(map.pos_16(+),NVL(l.pos_16, '-99'))
    AND NVL(l.pos_34, '-99') = NVL(map.pos_34(+),NVL(l.pos_34, '-99'))
    AND NVL(l.pos_43, '-99') = NVL(map.pos_43(+),NVL(l.pos_43, '-99'))
    AND NVL(l.pos_14, '-99') = NVL(map.pos_14(+),NVL(l.pos_14, '-99'))
    AND NVL(l.status_cd, '-99') = NVL(map.status(+),NVL(l.status_cd, '-99'))
    AND NVL(l.action_cd,'-99') = NVL(map.action_cd(+), NVL(l.action_cd,'-99'))
    AND NVL(l.sys,'-99') = NVL(map.sys(+), NVL(l.sys,'-99'))
    AND NVL(l.ind,'-99') = NVL(map.ind(+), NVL(l.ind,'-99'))
      )
    So, basically in the above query I say that if the type = "TKE" do not join on all columns of pos. If type is not TKE then do all the joints on all columns POS etc.
    How do I rewrite query so that I can use OR and the outer JOIN in the same query?

    Hello

    It is one of several good reasons to use the ANSI join syntax. Move all the join conditions in the clause on, not the WHERE clause, and you do not use the sign +.

    SELECT  l.*
    FROM           table1 l
    LEFT OUTER JOIN  table2 map  ON   (    NVL(l.id, '-99') = COALESCE (map.id, l.id, '-99')
                                        AND  l.TYPE = 'TKE'
                          )
                                 OR  (     NVL (l.id, '-99') = COALESCE (map.id, l.id, '-99')
                              AND   NVL (l.type, '-99') = COALESCE (map.type), l.type, '-99')
                         ...
    

    Instead of nesting the NVL statements, use COALESCE, as illustrated above. It is independent of the issue of the join.

  • Outer join with Oracle syntax

    Hi, I am new to oracle and I worked this request for reports for about 2 weeks, please take a look at my request
    SELECT mmt.transaction_date "Transaction Date", 
                msib.segment1 "Item", 
                gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4||'-'||gcc.segment5||'-'||gcc.segment6||'-'||(nvl(gcc.segment7,'000000')) "account",
                (CASE mttype.transaction_type_name
                WHEN 'Average cost update' THEN
              ((nvl(mmt.new_cost,0) - nvl(mmt.prior_cost,0)) * nvl(mmt.quantity_adjusted,0)) + nvl(mmt.variance_amount,0)
                ELSE
                 (mmt.Primary_quantity * nvl(mmt.actual_cost, 0) + nvl(mmt.variance_amount, 0))
               END) "Transaction Value",
                mttype.description "Transaction Type",
                mmt.subinventory_code "Subinventory",
                ood.organization_code "Org",
                msib.Primary_UOM_Code "UOM",
                mmt.Primary_Quantity "Primary Quantity",
                mtr.description "Reason",
                mmt.transaction_reference "Reference"
    FROM mtl_material_transactions mmt,
             mtl_system_items_b msib,
             mtl_transaction_accounts mta,
             gl_code_combinations gcc,
             mtl_transaction_types mttype,
             Org_Organization_Definitions ood,
             mtl_transaction_reasons mtr
    WHERE mmt.transaction_date >= :P_DATE_FROM 
               and mmt.transaction_date  < :P_DATE_TO +1
               and mmt.organization_id = :P_ORGANIZATION 
               and msib.organization_ID = mmt.organization_ID  
               and msib.inventory_item_id=mmt.inventory_item_id 
               and mta.transaction_id=mmt.transaction_id
               and gcc.code_combination_id = mta.reference_account
               and mttype.transaction_type_id=mmt.transaction_type_id
               and mmt.reason_id=mtr.reason_id(+)
               and ood.organization_id=mmt.organization_id
               and mttype.transaction_type_id = :P_TRANSACTION_TYPE
               and msib.segment1 = :P_ITEM
               AND gcc.segment2 = :P_ACCOUNT
    null values is on the mtl_material_transactions table, which is reason_id, subinventory_code and transaction_reference
    put desired option on would show all archives on mtl_material_transactions with null values
    so I put the symbol of the outer join right?
    BTW
    I tried to put the (+) sign on various locations but it still not good and I am really at a loss

    Hello

    Whenever you have any questions, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and the desired results from these data. I know that's not always easy, but it is really necessary. Compounds that, I do not understand your problem.
    It could be useful that simplify you the problem. If you were not interested in, say, the mta, gcc, tables msib and ood, would you still have the same problem? If so, forget all these tables and just after, CREATE TABLE and INSERT statements for the remaining tables and the results you want from this data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

    The query you posted will not exclude any line of mmt just because it doesn't have a corresponding line in the mtr; That's what the condition:

    and mmt.reason_id=mtr.reason_id(+)
    

    but it will exclude mmt lines if they do not have matching rows in other tables. Maybe you need + plus join and may under certain conditions non-join, such as conditions

    gcc.segment2 (+) = :P_ACCOUNT
    

    Too much. It's just a guess. Without seeing your sample data and the correct results, you should get from this data, I can't say.

  • unfavourable update when joining two tables

    Hello


    ORACLE VERSION
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    "CORE     11.1.0.7.0     Production"
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    create the table and anonymous blocks to insert data into tables
    create table TAB_ONE(LOC_ID NUMBER,OPENDATE VARCHAR2(30),CLOSEDATE VARCHAR2(30));
    
    create table TAB_TWO(ID NUMBER,LOC_ID VARCHAR2(30),INSERTDATE VARCHAR2(30));
    
    
    
    DECLARE 
    BEGIN
    FOR I IN 1 .. 10 LOOP
    INSERT INTO TAB_ONE VALUES(i,trunc(sysdate),NULL);
    INSERT INTO TAB_ONE VALUES(i+1,NULL,NULL);
    INSERT INTO TAB_ONE VALUES(i+2,NULL,NULL);
    END LOOP;
    COMMIT;
    END;
    
    select * from TAB_ONE;
    
    DECLARE
    BEGIN
    FOR I IN 1..10 LOOP
    INSERT INTO TAB_TWO values(i,i+1,trunc(sysdate));
    END LOOP;
    COMMIT;
    END;
    
    select * from TAB_TWO;
    Here, I want to update the TAB_ONE table where opendate is null with the insertdate of TAB_TWO;

    join on LOC_ID condition.
    I tried this so far... but get SQL error: ORA-01427: einreihig subquery returns multiple rows
    01427 00000 - "einreihig subquery returns several lines.
    update TAB_ONE SET OPENDATE=(select INSERTDATE from TAB_TWO T2,TAB_ONE T1 where T2.LOC_ID=T1.LOC_ID and T1.OPENDATE is NULL)
    where  exists (select 1 from TAB_TWO T2,TAB_ONE T1 where T2.LOC_ID=T1.LOC_ID and T1.OPENDATE is NULL) and OPENDATE is NULL;
    could someone give me suggestion to acheieve this?


    Thank you
    Mike
    SQL> update TAB_ONE T1
      2  SET OPENDATE=(select INSERTDATE from TAB_TWO T2 where T2.LOC_ID=T1.LOC_ID)
      3  where T1.OPENDATE is NULL;
    
    20 rows updated.
    
    SQL> select * from TAB_ONE;
    
        LOC_ID OPENDATE                       CLOSEDATE
    ---------- ------------------------------ ------------------------------
             1 15-JUN-11
             2 15-JUN-11
             3 15-JUN-11
             2 15-JUN-11
             3 15-JUN-11
             4 15-JUN-11
             3 15-JUN-11
             4 15-JUN-11
             5 15-JUN-11
             4 15-JUN-11
             5 15-JUN-11
             6 15-JUN-11
             5 15-JUN-11
             6 15-JUN-11
             7 15-JUN-11
             6 15-JUN-11
             7 15-JUN-11
             8 15-JUN-11
             7 15-JUN-11
             8 15-JUN-11
             9 15-JUN-11
             8 15-JUN-11
             9 15-JUN-11
            10 15-JUN-11
             9 15-JUN-11
            10 15-JUN-11
            11 15-JUN-11
            10 15-JUN-11
            11 15-JUN-11
            12
    
    30 rows selected.
    

    Max

  • [Help] Join the query from 3 tables

    Hi, I'm new to database. I have a question about joining 3 tables, forgive me for my bad English.

    My paintings look like this

    Table 1: person (id, firstname, lastname)
    Table 2: AssignPersonAddress (id, personid, addressid, type)
    Table 3: address (id, phone, street, etc.)

    I need AssignPersonAddress table, because in my data structure, a person may have more than 1 address and address type must be registered (for example: private, work)


    I want to do a select query to the State any person with his private phone and work phone, like this.
    NOBODY | PRIVATE | WORK



    Right now my query looks like this
    select p.name , a1.tel AS Private, a2.tel AS Work
    from person p, 
    addresse a1 , 
    AssignPersonAddress apd1, 
    AssignPersonAddress  apd2, 
    addresse a2
    
    where p.id  = apd1.person (+)
    and apd1.adresse  = a1.id 
    and apd1.art = 'Private' 
    and p.objectid = apd2.person (+)
    and apd2.adresse  = a2.id 
    and apd2.art = 'Work'
    the problem is that I only get the person who has a private address and the job. But what I want is all anyone no matter if the person has only 1 or 2 address.

    As you can see I put the left outer join in where condition, but I always get the wrong result.


    THX in advance


    Danny

    Published by: raitodn on October 1st, 2009 03:51

    Published by: raitodn on October 1st, 2009 04:12
  • Outer join does not

    Hello

    Pls help me my request. I tried the following, but it does not give the expected results.

    Tab1
    EmplId, RepDt, Code, Hrs
    1/100,1/2009,199,8
    1/100,1/2009,200,4
    1/100,1/2009,255,3
    200,1/1/2009,200,4
    100.5/1/2009,199,8


    Tab2
    EmplId, RepDt, Code, Hrs
    1/100,1/2009,200,6
    200,1/1/2009,200,3

    I need output like this - 4 rows - need of all the rows from TAB1 when EMPLID, REPDT match TAB2, field values: need at a time when Code is also, when emlid, correspondence of the date, the Code missing so need A hrs, display ZERO as Tab2 hours.

    1/100,1/2009,199,8,0 - did not exist is not in tab2, so hrs Tab2 is ZERO
    1/100,1/2009,200,4,6 - Emplid, RepDt, Code match existence in Tab2, Tab1 Hrs 8, 6 Hrs Tab2
    1/100,1/2009,255,3,0 - did not exist is not in Tab2, so Tab2 hrs is equal to ZERO
    200,1/1/2009,200,4,3 - Emplid, Repdt, Code Match existed in Tab2, 4 Hrs of Tab1, Tab2 3 Hrs

    We are in 10g, Oracle.

    I tried the following
    T1. EmplId = T2.emplid AND T1.repdt = T2.repdt AND T1.code, T2.code = (+) - returns the unique corresponding lines, 2 rows.

    Pls help.

    Thanks in advance.

    Published by: NL 23 February 2009 09:20

    Hello

    See the Boneist first message in this thread:

    select t1.emplid, t1.repdt, t1.code, t1.hrs, nvl(t2.hrs, 0)
    from   tab1 t1,
           tab2 t2
    where  t1.emplid = t2.emplid (+)
    and    t1.repdt = t2.repdt (+)
    and    t1.code = t2.code (+)
    and    (t1.emplid, t1.repdt) in (select emplid, repdt
                                     from   tab2)
    order by repdt, emplid, code;
    

    As Boneist said, this fact corresponds to option (b)
    "(b) do just an outer join, with a condition EXISTS (or IN) in the WHERE clause to find corresponding repdts.
    The

    (+)
    

    an outer join are signs.

  • Reg: XQuery/XPath expr.

    Hi Experts,

    I was trying to learn/experience the XQuery/XPath expressions and had some doubts.

    I learn here-http://www.w3schools.com/xquery/xquery_example.asp

    Configuration script:

    CREATE TABLE a (col1 XMLTYPE);

    INSERT INTO a VALUES (XMLTYPE ("<?")) XML version = "1.0" encoding ="ISO-8859-1"? >

    < library >

    < Book category = "COOKING" >

    < title lang = "fr" > < /title > Italian newspaper

    < author > Giada De Laurentiis < / author >

    < year > 2005 < / year >

    < price > 30.00 < / price >

    < / book >

    < Book category = "CHILDREN" >

    < title lang = "fr" > Harry Potter < /title >

    < author > J K Rowling < / author >

    < year > 2005 < / year >

    < price > 29.99 < / price >

    < / book >

    < Book category = "WEB" >

    < title lang = "fr" > XQuery Kick Start < /title >

    < author > James McGovern < / author >

    < author > per Bothner < / author >

    < author > Kurt Cagle < / author >

    < author > James Linn < / author >

    < author > Vaidyanathan Nagarajan < / author >

    < year > 2003 < / year >

    < price > 49.99 < / price >

    < / book >

    < Book category = "WEB" >

    < title lang = "fr" > Learning XML < /title >

    < author > Erik T. Ray < / author >

    < year > 2003 < / year >

    < price > 39.95 < / price >

    < / book >

    ((< / book > '));

    It worked:

    RANIT@XE11GR2 > > ed

    A written file afiedt.buf

    1 Select xt.colx

    2 a, XMLTable ('/ bookstore/book[price < 40]')

    3 passage a.col1

    4 columns

    5 way XMLTYPE colx '.'

    6 *) xt

    RANIT@XE11GR2 > >.

    COLX

    ----------------------------------------------------------------------------------------------------------------------------------

    < Book category = "COOKING" >

    < title lang = "fr" > < /title > Italian newspaper

    < author > Giada De Laurentiis < / author >

    < year > 2005 < / year >

    < price > 30.00 < / price >

    < / book >

    < Book category = "CHILDREN" >

    < title lang = "fr" > Harry Potter < /title >

    < author > J K Rowling < / author >

    < year > 2005 < / year >

    < price > 29.99 < / price >

    < / book >

    < Book category = "WEB" >

    < title lang = "fr" > Learning XML < /title >

    < author > Erik T. Ray < / author >

    < year > 2003 < / year >

    < price > 39.95 < / price >

    < / book >

    Elapsed time: 00:00:00.16

    But when tried to join another filter condition, it gives me the error:

    RANIT@XE11GR2 > > ed

    A written file afiedt.buf

    1 Select xt.colx

    2 a, XMLTable ('/ bookstore/book[< 40 year AND price < 2004]')

    3 passage a.col1

    4 columns

    5 way XMLTYPE colx '.'

    6 *) xt

    RANIT@XE11GR2 > >.

    a XMLTable ('/ bookstore/book [price < 40 year AND < 2004] ")

    *

    ERROR on line 2:

    ORA-19114: XPST0003 - error during parsing of the XQuery expression:

    LPX-00801: to "AND" XQuery syntax error

    1/bookstore/book [price < 40 year AND < 2004]

    -                           ^

    Elapsed time: 00:00:00.04

    RANIT@XE11GR2 > > ed

    A written file afiedt.buf

    1 Select xt.colx

    2 a, XMLTable ('/ bookstore/book[price < year 40, < 2004]')

    3 passage a.col1

    4 columns

    5 way XMLTYPE colx '.'

    6 *) xt

    RANIT@XE11GR2 > >.

    ERROR:

    ORA-19169: FORG0006: invalid argument in «fn:boolean()» type

    no selected line

    Elapsed time: 00:00:00.20

    Could you please help me how to add multiple condition filter here?

    Thank you

    -Nordine

    (on Oracle 11.2.0.3.0)

    There "and" lowercase:

    / bookstore/book [price<40 and=""><>

    If I may ask another site to start learning: Tutorials of XQuery

    And of course, the W3C recommendation official, always useful to get information about the base language: http://www.w3.org/TR/xquery/

    For the Oracle specifics, see DB XML Dev Guide:

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_xquery.htm

    Also, as you should know by now, this kind of questions belong to the forum DB XML or XQuery forum (for a general discussion of the language).

  • Correct answer? (SQL)

    I read the question from a book.

    If we are forced to build an equi-join of 30 tables, how to join

    Have conditions?

    a. 30

    b. 20

    c. 29

    d. the number cannot be determined

    I wonder what is the correct answer to the following question, C or D?

    The book says is correct C.

    The theory says

    "To join the tables together n, you need a minimum of n-1 join conditions.

    For example, to join the four tables, a minimum of three joints is necessary.

    This rule do not apply if your table has a concatenated primary key.

    in this case more than one column is required to uniquely identify each row. »

    What should I answer if this issue was in a test 1Z0-051?

    I would answer D. Is this wrong?

    That's the problem with people who write these test questions.  They forget to check their questions of ambiguity.

    So, assuming that each table has a single unique primary key that relates to foreign keys in other tables, then the answer would be 29.

    However, suffice it to say there are 30 paintings, does not the number of columns is required of each table to perform joins, so the answer is that it cannot be determined.  If the other answers had said for example "at least 29" which would have been okay, but as it gives an exact "29", it is not necessarily true.

    I hate ambiguous questions.

  • Studio-based members of financial reports

    Hello

    I'm building a HFM to the reconciliation report Essbase en (with a grid for HFM and a grid for Essbase + calc column with the values of essbase-hfm). Metadata between Essbase and HFM is synchronized.

    I want to generate the report as dynamic as possible, so for my selection of account HFM, I selected members of the basis of a hierarchy of void (Total assets that wraps to the Trial Balance).

    I want to reproduce this in Essbase but cannot figure out how to select the members of a hierarchy of sub base.

    Any help would be greatly appreciated.

    Hello

    EN studio, when you select members, you can make a preliminary selection. first of all, in the member selection window, select option ahead of upper right button (view) then you can put a list descendant (member) and Level0 and use new options to join these two conditions (you can use and/or to join)

    I hope it helps you.

    concerning

  • How to open LOV for Details of the subject in the form of Qualification subject

    Dear Experts,

    I want to open LOV for the subject field in the form of Qualification in HRMS. Please can you guide me to the name of the field and and the process for doing this. Please also guide me how to do a field if I decide that?

    waiting for your expert opinions

    Published by: MNS on January 3, 2012 03:49

    Published by: MNS on January 3, 2012 03:51

    I don't think that you can easily do, apart from maybe a customized version of the form with a customized view of the underlying data.

    The problem you have is that data are presented on the screen with a view; in the definition of the view, part of the join to retrieve condition meaning object will be based on the presence of a code corresponding to the hr_lookups to get the code that represents the object. So, even if you took out of the logic of the field research (assuming that it is even possible to do), there is a high probability that the data 'free format' will not be found in any question.

    Clive

  • Other new lines in SQL script file and problem with SQL * more

    Hi all


    I would like to ask a question on the characters of new line inside files SQL scripts. I have a very long SQL query, stored in a file txt (ANSI encoding). Because query instructions are very long (several table joins and WHERE conditions) tried to separate, WHERE and ORDER BY clauses by inserting several new characters of lines (just hit the entrance) among them in order to improve the clarity of the source code. Now the problem is, whenever these newline characters are inserted in the file, apparently SQL * Plus cannot parse the file properly and gives me the following error message:
    SP2-0042: unknown command "FROM" - rest of line ignored.
    SP2-0734: unknown command beginning "myenterpri..." - rest of line ignored.
    The problem is definitely related to these new line because characters that when I remove them, the scripts runs without any problem. I would appreciate that you could kindly guide me how should I deal with this problem. Is there any SQL * Plus command to run to correctly interpret the new line characters?


    Thanks in advance,


    Kind regards
    Dariyoosh

    Hello

    In [SQL * Plus 9 | http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013073] (and), you can tell

    SET     SQLBLANKLINES   ON
    

    allow to completely empty rows in an SQL statement.

  • INSERT BUSINESS

    Hello



    I want to execute insert statemnt that is where expression is possible.

    IAM having the qury like this:

    Select case when LENGTH (REGEXP_REPLACE ('iuewuiweui', ' [^ t]')) > 3 then
    ((insert into values xx (1,1,1,1,1))) any other purpose XX;


    Help out me

    Thank you

    Yes it gives Cartesian product and also you saidTN1 table a number of records. So you may be required to use a join or else condition in your case.

    Ravi Kumar

  • Any suggestions on the elimination of the error ORA-01417?

    Just a question here. I'm developing a workbook in Discoverer Plus. I get a message ORA-01417 - a table can be external joined as another table. Just trying to see if there is a way to eliminate this error message. What I do is the following. I join table PA_EXPENDITURE_ITEMS_ALL to PA_EXPENDITURES_ALL. It is a standard join. Detail exists in master. Then I join PA_EXPENDITURES_ALL to PER_ALL_EMPLOYEES_F. Since I have a lot of spending on projects that aren't payroll/labor partner, my id of the person spending all the table is often null. This particular join must be an outer join, where I want to go back the detail that corresponds to a master document and detail that does not match. So far, nothing unusual there. The problem is that an employee may have multiple records in the employee file. Which would give me the detail data duplicate lines when I do not have a match, which would be bad. So what I do is to add a condition to test the article date of expenditure between the employee effective start date and the date of actual end of the employee. It is a condition that I add to the workbook. There is NO join defined between PA_EXPENDITURE_ITEMS_ALL and PER_ALL_EMPLOYEES_F. But what does the discoverer is when it generates the SQL, is to put the symbol of outer join on this condition. That does not seem logical, why he would do this. After all, I'm having some retail spending with no record of employee for them. So I have to have a way to deal with situations of nowhere. In any case, when I added this condition and try to refresh the workbook when I get the message ORA-01417. So I did some playing. I realized that if I build a condtion like that - AND ei.expenditure_item_date BETWEEN nvl(per.effective_start_date,ei.expenditure_item_date-1) AND nvl (per.effective_end_date, ei.expenditure_item_date + 1)
    then manually running a SQL query, I get good results. When I create this condition in discoverer, discoverer always ends by adding the symbol of the left outer join and I always get my message ORA-01417. Does anyone know of a sneaky way to keep discoverer of the addition of this symbol of outer join on my condition when discoverer built its SQL statement? I hope that I have explained the situation pretty well. Always a challenge to adequately describe a question.

    John Dickey

    Hello

    The error ORA-01417 is a restriction of the database rather than an a discoverer. If you get wrong this discoverer entirely in. Here are some things you can do:

    1. you can set a condition:

    Nvl (per.effective_start_date, ei.expenditure_item_date) AND nvl(per.effective_end_date,ei.expenditure_item_date) OR ei.expenditure_item_date BETWEEN EI.expenditure_item_date BETWEEN nvl(per.effective_start_date,ei.expenditure_item_date) AND nvl(per.effective_end_date,ei.expenditure_item_date)

    GOLD tells discoverer an outer join cannot be used, and it is why the sign (+) will not be added. This is not a real outer join but might work, as the dates are never null in the per_all_employees_f table.

    2. you can create a folder complex, combining the fields you wanted two tables PA. Then outer join this folder to the employee record, including the date of track conditions.

    3. If you only want the name of the employee in the per_all_employees_f table, and then you could implement a search function to translate the person_id in name of the employee. The function could be brought from the workbook so no join would be necessary. You might have to cache the result in the output function.

    Rod West

  • Dealing with maps

    Hi all

    I have two tables that I'm under certain conditions to join a specific condition in the expression of the join operator that is only the first part of an if statement. Operator to join even how I implicitly understand the continuum of the other as I'm just another arrow that represents the condition else and no need to create another join operator representing the explicit if condition else condition? Please refer to the following pseudocode:

    Join tables 1 and 2.

    If the variable x is not null
    then include records with not null for table 3 variable x
    on the other
    include records with the variable x = null, table 4.

    Hello

    After joining tables 1 and 2

    spend everything, including the variable x to Splitter and

    In a group take variable x is not null
    join table 3

    In the second group to take variable x is null
    Join the in table 4.

    Then union them.

Maybe you are looking for