How to get the default data in the child table?

Hi all
I am using oracle 11g

I have it here is the structure of the table

"CREATE TABLE"SCOTT" EMP_DET ".

(

ACTIVATE THE 'EMP_ID' NUMBER NOT NULL,

"EMP_NAME' VARCHAR2 (20 BYTE),

NUMBER OF "DEPT_ID",.

"KEY FOREIGN CONSTRAINT"EMP_DET_DEPT_MASTER_FK1"("DEPT_ID") REFERS TO"SCOTT" ENABLE DEPT_MASTER"("DEPT_ID")

)

"CREATE TABLE"SCOTT" DEPT_MASTER ".

(

ACTIVATE THE "DEPT_ID" NUMBER NOT NULL,

"DEPT_NAME" VARCHAR2 (20 BYTE),

'DEPT_MASTER_PK' CONSTRAINT PRIMARY KEY ("DEPT_ID")

)

Dept_master table given below

Dept_ID, Dept_name

1 X

2. IS

but emp_det contains no data.

but I need to see data like this in the emp_det table

Emp_det

Dept_ID emp_id, emp_name

missingdata 1-1

2. 2 missingdata

Concerning

Dale

Not sure this is what you are looking for.

SELECT DEPT_MASTER. DEPT_ID,

NVL (EMP_DET. EMP_ID, -(DEPT_MASTER. DEPT_ID)),

NVL (EMP_DET. EMP_NAME, "missing data"),

OF EMP_DET RIGHT OUTER JOIN DEPT_MASTER

ON EMP_DET. DEPT_ID = DEPT_MASTER. DEPT_ID;

Tags: Database

Similar Questions

  • How to get the underlying tables

    Hi all

    EBS R12.2

    How can I get the underlying tables of the following form?

    Capture.PNG

    Thank you very much

    Jen

    Hello

    Go to help-> review-> properties-> point.

    That's how you get the base table (FND_USER_RESP_GROUPS_INDIRECT):

    Kind regards

    Bashar

  • How to load the child table by using a simple slider...?

    How can I loa the child table by using a PL/SQL block cursor...

    for example, I have a table of the source called method

    EmpNo, empname, deptid deptname

    and I have 2 tables of taget... EMP and Dept.

    EMP
    ===
    EmpNo, empname, deptid

    Dept
    ====
    deptID, deptname


    Here, I want to load method for emp data and... Dept where dept does not contain data in double...

    For now... I used the cursor and in the same cursor, I'm loading data first dept table and then to the emp table.
    I use for dept, exceptional setting, which will manage a PK constraint violation error by doing nothing...

    in this way, there will be no duplicates... but it is not advisable because I 15,00,000 lines in the method table.

    Is there another way to do it?

    OK, I'd probably go with the method two insert, but as an alternative, here's a way to do it in a single insert:

    create table emp_info as
    select 1 empno, 'a' empname, 101 deptid, 'aaa' deptname from dual union all
    select 2, 'b' empname, 201 deptid, 'bbb' deptname from dual union all
    select 3, 'c' empname, 101 deptid, 'aaa' deptname from dual union all
    select 4, 'd' empname, 101 deptid, 'aaa' deptname from dual union all
    select 5, 'e' empname, 301 deptid, 'ccc' deptname from dual;
    
    create table emp (empno number primary key, empname varchar2(3), deptid number);
    
    create table dept (deptid number primary key, deptname varchar2(3));
    
    insert all
      WHEN rn = 1 THEN
           into dept (deptid, deptname)
           values (deptid, deptname)
      WHEN rn > 0 THEN
           into emp (empno, empname, deptid)
           values (empno, empname, deptid)
    select empno, empname, deptid, deptname, rn
    from   (select empno,
                   empname,
                   deptid,
                   deptname,
                   row_number() over (partition by deptid order by empno) rn
            from   emp_info);
    
      8 rows inserted
    
    commit;
    
    select * from emp;
    
         EMPNO EMP     DEPTID
    ---------- --- ----------
             1 a          101
             3 c          101
             4 d          101
             2 b          201
             5 e          301
    
    select * from dept;
    
        DEPTID DEP
    ---------- ---
           101 aaa
           201 bbb
           301 ccc
    

    You must test these two methods to see which is more efficient.

  • How to get the child elements of the ArrayCollection collection?

    Hi all

    I want to analyze collection ArrayCollection and want the child node element.

    How to parse the arraycollection collection?

    for (var i: int = 0; i<>

    {if (arrayCollectionObject.getItemAt (i). Item is "requireditem")}

    your code

    break;

    }

    }

    Let me know if it helps

  • How to find the child tables

    Hello

    y at - it (quesry) way to find the list of children tables for a given table.

    tried to interview user_constraints and USER_CONS_COLUMNS, but not be able to find a way.

    Thank you

    Hello

    You can use the query as follows - it will list the children tables and the FK name for table HR.JOBS:
    Select
    a.Owner, a.table_name, a.constraint_name
    sys.all_constraints a.,
    (select master, constraint_name from sys.all_constraints where owner = * 'HR' * and table_name = * "JOBS" * and constraint_type in ('P', 'U')) b
    where
    a.CONSTRAINT_TYPE = 'R' and a.r_constraint_name = b.constraint_name and a.r_owner = b.owner

    If you do not need name FK, then put separate:
    Select
    a.owner, separate a.table_name
    sys.all_constraints a.,
    (select master, constraint_name from sys.all_constraints where owner = 'HR' and table_name = 'JOBS' and constraint_type in ('P', 'U')) b
    where
    a.CONSTRAINT_TYPE = 'R' and a.r_constraint_name = b.constraint_name and a.r_owner = b.owner

    Philippe

  • How to get the a table check constraint.

    I don't see the function to get forced check.
    I try the table.getCheckConstraints () function
    but I return nothing.

    Hello

    table.getCheckConstraints () will return to check the constraints defined at the Table level in the Data Modeler.

    You can also call column.getCheck (). This will return a check constraint defined on a column object in the Data Modeler.

    David

  • How to get the default path of the data of a table space file

    I used below the sql statement to create a table space:

    CREATE A TABLESPACE DATAFILE AAA BBB SIZE 10 M AUTOEXTEND OFF...

    Notice, I do not give a full path instead of a file name, and then ask questions relevant to tables

    get the full path of the data file, assume that it's path below:

    d:\oracle\...\BBB

    So I don't think that there is a default path that oracle can use it to create the data file. My question

    is how to get this default path before creating a table space.

    Thank you very much.

    Hello

    I did similar simulations for you, then it could be seen easily:

    SQL > Show parameter db_create_file_dest

    VALUE OF TYPE NAME

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

    db_create_file_dest chain

    SQL > SELECT NAME, VALUE OF V$ PARAMETER

    2 where lower (name) = "db_create_file_dest;

    NAME

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

    VALUE

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

    db_create_file_dest

    It has the value NULL. Then where my datafile is going?

    SQL > create tablespace TEST datafile 'test01.dbf' size 10 M;

    Created tablespace.

    SQL > select file_name

    2 of dba_data_files

    3 where nom_tablespace = 'TEST ';

    FILE_NAME

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

    /U01/app/Oracle/product/12.1.0/Db_1/DBS/Test01.dbf

    When you check the alert logs, it will not show you the location of the data file. It will tell you what exactly you ran.

    ..

    ..

    Completed: drop tablespace test whose content and data files

    create tablespace datafile 'test01.dbf' size 10 M TEST

    Completed: create tablespace TEST datafile 'test01.dbf' size 10 M

    ..

    ..

    You can not SQL user * more? Well, I would say that, when you run the CREATE TABLESPACE command, is where you run the command:

    SQL > select file_name

    2 of dba_data_files

    3 where nom_tablespace = 'TEST ';

    FILE_NAME

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

    /U01/app/Oracle/product/12.1.0/Db_1/DBS/Test01.dbf


    So, you should get the location of your data file. Alternatively, you can run the query in the parameter $ v so that you know your default data file location.

    I hope this helps.

    Thank you.

    Kind regards

    Gaetan

  • How to get back my data for the health and the watch Apps once I've restored my phone?

    How to get back my data for the health and the watch Apps once I've restored my phone?

    From the backup, you're going to be restoration.

    If you back up to iTunes, make sure that it is an encrypted backup.

  • How to get the timestamp of data DAQmx Read

    Hello

    I have to read 4 analog channels using DAQmx AI read in LabVIEW 2012. I am using screws DAQmx.

    Acquisition rate is 4000 samples per second, and the number of samples per channel is 200.

    I use only one task DAQmx to read the data. I get 4 data tables for 4 channels each table length is 200, every time, DAQmx Read happens.

    But I want to get the seal of these 200 samples per channel. How to get the seal of these samples, made me know.

    Thank you

    You have not indicated your code. If you choose to read the waveform data, the cluster includes t0 and dt. That's all the information you need.

  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • How to get the logical tab in the main area of 4.1.2 Data Modeler?

    Data Modeler.jpgI just installed Oracle Developer Data Modeler: Version 4.1.2.895.

    I was following section 2.1 development of the logic model

    http://docs.Oracle.com/CD/E48219_01/doc.40/e48205/tut_data_modeling.htm#DMDUG36169

    I used the example of library. I added the areas.

    Then I tried to create the books.

    The document says:

    1. In the main area (right) of the Data Modeler window, click the logical tab.
    2. Click the icon of the new entity.

    But I don't see the logical TAB on the right side at all.

    I see the Start Page. On the far right is the browser window. Basically, I see Messages - Log.

    On the left side, I have the browser window.

    Can someone tell me please how to get the logical TAB in the main area?

    Thanks in advance.

    Hello!

    In the browser with the right button on the logic model and select view.

    I hope this helps!

    Heli

  • How to get the specific information of hardware and software data center

    How to get the specific information of hardware and software data center with powercli...

    What kind of information you need?

    No matter what Esxi host hardware info., if so could below thread is useful.

    Information about the host material with information on the nic and HBA drivers

  • How to get the second Monday of each month in a given date range?

    In Oracle forms, how to get the second Monday of each month in a given date range?

    I tried below using the query WITH the Clause, but it seems that WITH Clause does not work in Oracle forms. So is there another way to do this in Oracle forms?

    WITH month_range AS

    (

    SELECT TO_DATE ('Dec 2013', 'Mon YYYY') AS first_month

    , TO_DATE ('Mar 2014', 'Mon YYYY') AS last_month

    OF the double

    )

    SELECT NEXT_DAY (6 + ADD_MONTHS (first_month

    , LEVEL - 1

    )

    , 'MONDAY '.

    ) AS second_monday

    OF month_range

    CONNECTION OF LEVEL < = 1 + MONTHS_BETWEEN (last_month, first_month)

    ;

    Thanks in advance.

    Good fishing, when the first day of the month is Thursday... So I changed the query accordingly... Try the below

    SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'game '.

    THEN NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'THU')

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'Game') + 7

    END AS second_day

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • How to get the ip address of the data storage device

    Hi all

    I developed a project now and you need to distinguish a virtual machine is saved to the device local ESX or remote network storage device.

    I found the data store object in which the virtual machine resides by vi sdk, but could not find the address of the device that includes this data store.

    How to get the ip address of the coding data storage device, which includes the virtual machine? I need your help.

    Thank you in advance.

    How do you try to make a query. Storage devices provides a logic unit number no, there is no IP address for it.

    You can check the same for the storage on vCenter view

Maybe you are looking for