Pls help me in creating a view

Hi all

We have a few tables in Oracle HRMS, per_jobs table gives details of all defined jobs,
PAY_JOB_WC_CODE_USAGES table contains all the compensation codes defined and PAY_STATE_RULES
table contains all status codes.

Now SELECT WC. STATE_CODE,
PJ. JOB_ID,
PSR.NAME STATE_NAME,
PJ.NAME JOB_NAME
OF per_jobs pj,.
PAY_JOB_WC_CODE_USAGES WC,
ESP PAY_STATE_RULES
WHERE PJ. JOB_ID (+) IS WC. JOB_ID
AND WC. STATE_CODE (+) IS ESP. STATE_CODE
This query gives the job_names that are defined in a State...

But, now, is what I want

I want to get the names of work that are not defined in each State for this I want to create a view
So, could u pls help me to write this query.

Example,
SELECT * FROM PER_JOBS
If job_id in (select job_id from PAY_JOB_WC_CODE_USAGES where STATE_CODE = "GO")
This will give you the details on employment that are not defined in the State called "WILL"...

But I want that all the jobs that are not defined in all States...

Thank you
select psr.state_code, pj.*
  from per_jobs pj
      ,pay_job_wc_code_usages wc
      ,pay_state_rules psr
 where pj.job_id = wc.job_id
   and not exists (select 1 from pay_job_wc_code_usages wc1
                    where wc1.job_id = pj.job_id
                      and wc1.state_code = psr.state_code);

I think that could do it. Not tested.

Tags: Database

Similar Questions

  • Can someone create a program for me to tension and calclate to the current aid concert. I need a graphic Visual and some nuts for aesthetic purposes. PLS HELP

    Hey someone create a labview program that uses the current and voltage to find the resistance. I also need a chart and buttons for aesthetic purposes. PLS HELP A GAL!

    COME ON GUYS.  HELP A GAL JAVA!

    HERE YA GO, GAL.

  • Failed to create the required registry key: vmware, Inc. error: 2 when installing the vm 7 wareinwin and the installation of any software of a few errors in registry pls help...

    Failed to create the required registry key: vmware, Inc. error: 2 when installing the vm 7 wareinwin and the installation of any software of a few errors in registry pls help...

    Hello mnaveen.kumar,

    Search the registry to see if this key was created. Sometimes, the installation program does not have permission to this key.

    HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.

    You can try to manually create the key to see if this will help.

    Please reply back and let us know if this can help.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • SQL help with creating a view

    Hi, I am looking to create a view that needs, based on a table.
    Table:
    Roll, Code, Qual, Date
    1 05 KO 112010
    1 35 01 112010
    1 98 01 132011
    etc...
    I need only the row (roll) code 05 and ko but this roller should have a line with Code 35 Qual 01 with the same Date. I am able to get all the lines have the right Codes (05 and KO with 35 and 01). I don't know how I can then join it on itself to give me just the line 05/ko where correspond to the date and rollers.

    Try this not tested.

    In addition, the date of which as column name isn't suggestable. Change it if possible.

    create view v1
    as
    select * from rolltable r
    where code=05
    and qual='KO'
    and exists (select * from rolltable where code= 35 and Qual='01' and roll=r.roll and date=r.date);
    
  • Help on creating the view to the oracle10g@redhat4 platform

    Hello

    I tried to create a view for a table that is specified at the client level Oracle10g that I previously installed on a platform of linux redhat4.

    If anyone can guide me how to do this.

    It is to show some nsuffisante privillage


    So how do I solve this problem

    More details needed...

    For the syntax.

    Create View view-name as Select...

    EG-
    CREATE VIEW view_emp
    AS
    SELECT EmpID FROM emp;

  • I was using my computer as a default administrator, I did another administrator account but I lost my old account that has gots my data all pls help me as soon as possible

    I was using my computer as a default administrator, I did another administrator account but I lost my old account that has gots my data all pls help me as soon as possible

    The system hides the built-in Administrator account on Windows XP Home Edition when you create a second administrator account and she is only available for use by visiting Mode safe.  You can copy the profile of the account administrator part of your new account.

    Follow the instructions here: to copy a user profile

    Note that you can not copy a profile to or from the account that you are currently connected, if you want to copy the user profile to user B, you must be connected with the C & C user the user must have administrator privileges.

    John

  • You can create a view that filters (ESX host) Linux machines on the view of the Infrastructure?

    Hello

    We have recently implemented Foglight and VMware plugin. As part of the VMware plugin, Foglight pulls in all the Linux VM machines including the ESX host. Our team of Linux only manages the running redhat Linux hosts. They fail the ESX VM guest. That said, is there a way to create a view that shows only the hosts running redhat Linux?

    For example the view of rail infrastructure below contains 88 Linux machines, but nearly half of them are ESX hosts for our Linux team would not see all these. Is it possible to filter these?

    Any help is appreciated.

    Thank you

    Tony

    The easiest way would be to create a personalized, pair it with Infrastructure and then create a dynamic management component.  This will help create you a rule for "All hosts" where you can find just the hosts that are not of the ESX host and run Linux.

    The query would be:

    detail.topologyTypeName! = "VMWESXServer" & os.longName like «% Linux»

  • How to remove network drives mapped Windows 7.i can't get to delete.pls help me to solve it.

    How to remove network drives mapped Windows 7.i can't remove. Already disconnected, but still its disk showing with red cross.i am not able to create new drive with the drive letter of Red Cross, pls help me to solve it.

    1. open a command prompt.

    2 in the command prompt, type the following command and press ENTER.

    NOTE: replaced by z: in the command below with the actual drive letter of the mapped network drive that you want to cancel your computer window (deletion) mapping .

    • NET use Z:/delete

    3 when finshed, close the command prompts. So the mapped network drive shoud be removed from the window of your computer.

    Kind regards
    J Chambers
  • problem with my cd/dvd drive... pls help!

    I have windows 7 ultimate! I have problem with my hard drive! I use lg drive and all of a sudden it reads only the CD-ROM and the dvd rom no! its disturbing me a lot! pls help! Thanks in advance

    Hello

    Having too many CD/DVD programs can cause strange problems, especially if they're loading of parts of
    themselves at the start because they will be competing for resources. This does not mean that this issue has been
    caused by those, however, it's a possibility depending on which and how many you have installed.

    You have disk problems as the CD/DVD is actually 4 discs in 1 case (CD & DVD burning and)
    Playback of CD and DVD). So it is not unusual for parts from 1 or 2 to not work so that others do
    correctly.

    Burning at low speed, or by using the master could help. A CD/DVD cleaner might help.

    Brand of the CD or DVD drive can also be the problem. Low quality (cheap brands) are always problematic.

    CD/DVDs have a tolerance + - and your can read/write on the edge outside these discs
    tolerances. They may be delivered, but it is generally more economical to replace the disk.

    Several good info here:
    http://Club.myce.com/

    CD/DVD units
    http://www.myce.com/storage/

    Notes on the troubleshooting and repair of readers of compact disks and CD-ROM Drives
    http://www.repairfaq.org/repair/F_cdfaq7.html#CDFAQ_014

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

    Follow these steps to remove corruption and missing/damaged file system repair or replacement.

    Start - type in the search box - find command top - RIGHT CLICK – RUN AS ADMIN

    sfc/scannow

    How to fix the system files of Windows 7 with the System File Checker
    http://www.SevenForums.com/tutorials/1538-SFC-SCANNOW-Command-System-File-Checker.html

    Then run checkdisk (chkdsk).

    How to run check disk in Windows 7
    http://www.SevenForums.com/tutorials/433-disk-check.html

    ==========================================================

    After the foregoing:

    References to Vista also apply to Windows 7.

    Step 1: Please do all the same underneath if you did some before as is often total
    a process that solves the problem.

    Try this - Panel - Device Manager - CD/DVD - double click on the device - driver tab.
    Click on update drivers (this will probably do nothing) - RIGHT click ON the drive - uninstall.
    RESTART this will refresh the default driver stack. Even if the reader does not appear to continue
    below.

    Then, work your way through these - don't forget the drive might be bad, could be a coward
    cable or slight corrosion on the contacts (usually for a laptop) and other issues.

    Your CD or DVD drive is missing or is not recognized by Windows or other programs
    http://support.microsoft.com/kb/314060 - a Mr Fixit

    Try this fix manually if the Fixit 314060 does not work
    http://www.pchell.com/hardware/cd_drive_error_code_39.shtml

    Your CD or DVD drive is missing or is not recognized by Windows or other programs-
    a Mr Fixit
    http://support.Microsoft.com/kb/982116

    The DVD player does not work after installing Windows 7
    http://support.Microsoft.com/kb/975270/

    The CD drive or the DVD drive does not work as expected on a computer that you upgraded to
    Windows Vista
    http://support.Microsoft.com/kb/929461

    When you insert a CD or a DVD, Windows Vista may not recognize the disc
    http://support.Microsoft.com/kb/939052

    Your CD or DVD drive cannot read or write media - A Mr Fixit
    http://support.Microsoft.com/GP/cd_dvd_drive_problems

    CD/DVD drive does not appear in Windows Vista, or you receive this error during Windows Vista
    Setup after booting from the DVD (AHCI)
    http://support.Microsoft.com/kb/952951
    Drive CD - R or CD - RW Drive is not recognized as a recordable device
    http://support.Microsoft.com/kb/316529/

    Hardware devices not detected or not working - A Mr Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    Another possibility is that the cables are loose. Remove ALL power, then make sure that the cables in both
    ends. Remove and replace, do not just tight. For laptops, you can often clean power and
    contacts data with a pencil eraser.

    Some DVD players do not use the Windows default drivers so check with the manufacturer of system and
    manufacturer of device to see if there is a firmware or drivers for your drive if necessary.

    ===============================

    Step 2: You have disc problems as the CD/DVD is actually 4 discs in 1 case (CD & DVD
    Burn and CD and DVD read). So it is not unusual for 1 or 2 operational so that other parts
    do it right.

    Did you follow the Troubleshooting Guide for the reader who still does not work? There are
    the entries in registry that the troubleshooter does not solve and those who "might" be the cause.

    Check with your Maker system and a device for the two possible firmware updates and the
    correct registry entries for your car.

    Here are the keys that I of course are those in question - for the subkeys of the CD/DVD drive
    as there will be other subkeys in these keys. Do not forget to ask specific keys involved as well as
    the parameters.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\IDE

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

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

    You can probably find more info here and maybe even the exact registry settings for your
    CD/DVD drive someone with the same model.

    Forums - a lot of expert real help
    http://Club.myce.com/

    CD/DVD units
    http://www.myce.com/storage/

    Use DevManView to locate the CD/DVD in the registry (be careful and do a prior Restore Point)
    nothing change) - find the DevManView device and then make a right click on it free in RegEdit.

    DevManView - free - an alternative to the standard Windows Device Manager, which displays
    all devices and their properties in flat table, instead of the tree viewer
    http://www.NirSoft.NET/utils/device_manager_view.html

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Create a view of RDF in Oracle 12 c of tables in an Oracle 11 g Server

    Hello!

    I have a relational database in Oracle 11 g server, but I need to create the view of RDF model in Oracle 12 c in the base tables.

    I created a database connection to connect to the server of Oracle 11 g Oracle 12 c, using the statement:

    CREATE DATABASE LINK myDBLink

    CONNECT to user_test

    IDENTIFIED BY test123

    WITH THE HELP OF '(DESCRIPTION=)

    (ADDRESS = (PROTOCOL = TCP)(HOST=192.0.56.158) (PORT = 1521))

    (CONNECT_DATA = (SID = orcl)))';

    The works of the SELECT statement:

    Select * from EMP@myDBLink;

    I also created a SYNONYM:

    CREATE the SYNONYM MY_EMP FOR EMP@myDBLink;

    The SELECT statement with the synonym also works:

    Select * from EMP@MY_EMP;

    Well, to create the view of RDF, I use a sem_apis.create_rdfview_model function. Now, I wrote the statement of the following two ways:

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List ('MY_EMP', 'MY_DEPT'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List('EMP@myDBLink','DEPT@myDBLink'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    And I get the following error:

    ORA-13199: fetchTabIDList: not found in tables:

    ORA-06512: at the 'MDSYS. SDO_RDF_INTERNAL', line 14308

    ORA-06512: at the 'MDSYS. SDO_RDF', line 3616

    ORA-06512: at the 'MDSYS. RDF_APIS', line 1253

    ORA-06512: at line 2


    I use examples of book of the Oracle tables.


    Thank you


    Yenier

    Yenier,

    Could you please try creating a view rather than a synonym? Here is an example:

    SQL >-create dblink

    SQL > create public database link

    2 mylink

    3 connect to

    Scott 4

    5 identified by

    6 Tiger

    using a 7 ':/';

    Database link created.

    SQL >

    SQL >-create view local using queries involving remote database objects

    SQL > create view dblink_scott_EMP in select * from EMP@mylink;

    Created view.

    SQL >

    SQL >-add the primary key (help requests on Direct mapping according to models RDFView to have shorter SubjectMaps)

    SQL > alter view dblink_scott_EMP add constraint pk_EMPNO primary key (EMPNO) disable;

    Altered view.

    SQL >

    SQL > - create model DM - based RDFview

    SQL > exec sem_apis.create_rdfview_model ('dblink_test_rv', sys.odcivarchar2list ('DBLINK_SCOTT_EMP'), "http://dm/");

    PL/SQL procedure successfully completed.

    SQL >

    Thank you

    -Smiled.

  • I had a big mistake, my Palm tungsten E2 counldn can't start! pls help me!

    It there!

    I had a big mistake when I installed PIM update for my tungsten E2, although it supports only for tungsten E.

    After installing the PIM update. It took reboot. I rebooted and it does not start. It displays the palm logo after 5 seconds and turned market and stop...

    I confused. My contacts still in there. How I recove my contacts or he'll go.

    Pls help me. Thank you very much!

    At this point, it seems that your device is in a reset in a loop because of the incompatible application.

    Try warming system reset in the following link to see if you can stop looping.

    Click on the following link for the Web page of kb.palm.com for the article about the reset procedure.

    http://www.Palm.com/cgi-bin/cso_kbURL.cgi?id=887

    If you can get the device to stop a loop, try hotsync and see if you can get your data backed up.

    After synchronization, you will need to do the following to remove the incompatible app of the sync process ' ing.

    Hard reset your device and rename your backup folder. Go to http://www.palm.com/cgi-bin/cso_kbURL.cgi?ID=887 and follow the directions to do a hard reset. Then before of you hotsync your data back you will need to rename your backup folder, to do than go here.

    XP
    C:\Program files\palm or palm one\ [hotsync username]------and rename your backup
    file Backup.Old

    Vista
    Start--> documents\Palm OS Desktop\ [hotsync username]------and rename your backup
    file Backup.Old

    Then hotsync from your current name of hotsync and all your contacts, calendar,
    tasks and memos coming back.

    Show the file extensions for XP or Vista

    XP
    If you cannot view the extensions of file on your PC I would you open a
    folder, go to Tools--> Folder Options--> View (tab) and under Show hidden
    files and folders to uncheck Hide extensions of known file types.

    Vista
    Open control Panel, go to--> View (tab) and under show hidden folder Options
    files and folders to uncheck Hide extensions of known file types.

    If the previous steps do not resolve your problem, you will need to hard reset.

    You can try a hard reset to fix the problem. The hard reset will erase all data on the device.

    For reference purposes, click the following link to the support page for your device on the kb.palm.com Web page.
    http://KB.Palm.com/wps/portal/KB/na/Tungsten/E2/unlocked/home/page_en.html

    There are links on the page the user Troubleshooting Guide, how to, downloads, etc.

  • Associate data to create a view.

    I am currently using a database of Oracle 10.2.0.4.0. I work for the Department of public safety and I am trying to create an Oracle Forms Application that will be used to track information of the mandate. I need to create a view that I can use in my form that will allow me to the warrants list who are associated with each other. In the forms I create these associations in a table by using primary keys for these records.

    I created a few fictitious tables with data that you can use to help me create the SQL I can use in the creation of the view, that I need, I hope.
    CREATE TABLE order_info
    (wp_id             number(12)   primary key,
     info              varchar2(10),
     order_no          number(12)   not null,
     order_name        varchar2(30) not null);
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (1, 'AXE', 123456, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (2, null, 245645, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (3, 'SHOVEL', 354654, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (4, 'PAIL', 432110, 'DOE, JONATHAN');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (5, null, 514654, 'DOE, JOHN');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (6, null, 687980, 'DOE, JONATHAN');
    
    commit;
     
    CREATE TABLE associate_order
    (wp_id             number(12)   not null,
     associated_wp_id  number(12)   not null,
     constraint assoc_wp_ip_fk
       foreign key (associated_wp_id)
       references order_info(wp_id));
     
    insert into associate_order (wp_id, associated_wp_id)
    values (2, 1);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (3, 1);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (5, 3);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (6, 4);
    
    commit;
     
    Once the tables are created, the table ORDER_INFO contains detailed information (in real life, it comes to the information related to a mandate). The ASSOCIATE_ORDER table contains the relationships between the records in the ORDER_INFO table. The ASSOCIATE_ORDER table is the one I want to use to create a view that I use in my Application Forms to list all of the warrants that are associated with each other.

    If you look at the data in the ASSOCIATE_ORDER table:
    WP_ID ASSOCIATED_WP_ID
    ----- ----------------
        2                1
        3                1
        5                3
        6                4
    WP_ID 2 is associated with WP_ID 1
    WP_ID 3 is associated with WP_ID 1
    WP_ID 5 is associated with WP_ID 3
    6 WP_ID is associated with 4 WP_ID

    I want to be able to do in the view that I have create is something like:
    SELECT associated_wp_id
      FROM ORDER_VIEW
     WHERE WP_ID = 3;
    And he have all the primary keys for the warrants (orders in this case) come back to me:
    ASSOCIATED_WP_ID
    ----------------
                   1
                   2
                   3
                   5
    The WP_ID of 1 is not included in the ASSOCIATE_ORDER table, because it is not associated with a previous mandate (order in this case), but because it is associated with WP_ID 2 and 3 I think.

    Here are all the commands associated together based on the data that is in the table. There may be 0 to many of these records in the ASSOCIATE_ORDER table, but if they reference a primary key (WP_ID) so I want to include in the view.

    I really hope that makes sense. I tried to play a little with analytics, but I'm not even close to the selection of any of the data that I want, so I can't yet show you what I've tried because it probably doesn't even have sense.

    Thanks in advance - mike

    In order to clean your database if you filled with the scripts above, you can do the following:
    drop table associate_order;
    drop table order_info;

    Hello

    I know right what you want the view to look like.
    Given the example of data you posted, that's what you want to the content of the view?

    WP_ID INFO         ORDER_NO ORDER_NAME       WP_ID_GRP
    ----- ---------- ---------- --------------- ----------
        1 AXE            123456 DOE, JOHN P              1
        2                245645 DOE, JOHN P              1
        3 SHOVEL         354654 DOE, JOHN P              1
        4 PAIL           432110 DOE, JONATHAN            4
        5                514654 DOE, JOHN                1
        6                687980 DOE, JONATHAN            4
    

    ? You will notice that it is just order_info, with an additional column, wp_id_grp, added. Wp_id_grp is the lowest related wp_id. For example, wp_ids 1, 2, 3, and 5 are all related, so they all have wp_id_grp = 1.

    Here's a way to do it:

    CREATE OR REPLACE VIEW order_info_grp
    AS
    WITH     got_pairs     AS
    (
         SELECT     wp_id               AS x_id
         ,     associated_wp_id     AS y_id
         FROM     associate_order
        UNION
         SELECT     associated_wp_id     AS x_id
         ,     wp_id               AS y_id
         FROM     associate_order
    )
    ,     got_relatives     AS
    (
         SELECT     CONNECT_BY_ROOT x_id     AS wp_id
         ,     y_id
         FROM     got_pairs
         CONNECT BY NOCYCLE     y_id     = PRIOR x_id
    )
    ,     got_wp_id_grp     AS
    (
         SELECT       wp_id
         ,       MIN (y_id)     AS wp_id_grp
         FROM       got_relatives
         GROUP BY  wp_id
    )
    SELECT       o.*
    ,       g.wp_id_grp
    FROM       order_info     o
    JOIN       got_wp_id_grp g  ON  o.wp_id  = g.wp_id
    ;
    

    If you want a view which only has the columns wp_id and wp_id_grp, then everything just omit the main request; got_wp_id_grp, it's just what you want.

    I guess that the associate_order relationship is reflexive. In other words, instead of:

    insert into associate_order (wp_id, associated_wp_id)
    values (2, 1);
    

    you have it, could just as well, says:

    insert into associate_order (wp_id, associated_wp_id)
    values (1, 2);
    

    In other words, all that matters is that 1 and 2 are linked. What number goes in which column is not relevant.

    In table assoiciate_order, why is there a foreign key on associated_wp_id constraint, but not on wp_id?

    CONNECT BY is never terribly effective, and NOCYCLE does only make it worse. Depending on your data, in particular how different wp_ids can be in a related group, this may not be practical. You might consider adding a column wp_id_grp in the associate_order table, rather than owning a view and containing a PL/SQL (which would be faster) procedure re - fill this column when associate_order is changed.

    Published by: Frank Kulash on April 17, 2013 18:33

    MLBrown wrote:
    I think I left mouth stumped the Panel...

    Be patient! It's true that the median time for a first response on this forum is less than 10 minutes, but it's because the first response often only pointed out that we need more information. When you provide all the sample data, and a good explanation of the problem, as you did, then people can begin to solve the problem instead of complaining, complaining is so much faster than problems.

  • We can create a view or table with a form button?

    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Gul says:
    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Yes. You can. Use the FORMS_DDL built-in. For example

    BEGIN
      Forms_DDL('create table temp(n NUMBER)');
      IF NOT FORM_SUCCESS THEN
        Message ('Table Creation Failed');
      ELSE
        Message ('Table Created');
      END IF;
    END; 
    

    Hope this helps

    Hamid

  • Reader Acrobat 7 I downloaded was not compatible with my laptop Windows 8, pls help!

    Dear friends,

    My name is Terry.

    Reader Acrobat 7 I downloaded was not compatible with my laptop Windows 8, pls help!

    Thanx.

    Why you try to install the Reader 7 expired?

    The current version is the free Adobe Reader XI

    PDF reader, PDF Viewer | Adobe Reader XI

  • create materialized view log on the table without a primary key

    Hi all
    CREATE TABLE client_months 
    (
      SUBJ_CODE         NUMBER(4),
      SERV_CODE         NUMBER(4),
      DEBIT_CODE        NUMBER(4),
      PERIOD_NUM        NUMBER(2),
      PERIOD_NAME       VARCHAR2(40 CHAR),
      FIRST_MON_DAY     DATE,
      LAST_MON_DAY      DATE,
      VALUE_MON_DAY     DATE,
      MONTHES           NUMBER(4,2),
      GARDENING_WEIGHT  NUMBER(5,4),
      REASON_CODE       NUMBER(5),
      STAMP_ACTION      VARCHAR2(1 CHAR),
      STAMP_CDATE       DATE                        DEFAULT SYSDATE,
      STAMP_DATE        DATE,
      STAMP_USER        VARCHAR2(15 CHAR),
      REGION_CODE       NUMBER(9)
    )
    table created.
    
    CREATE UNIQUE INDEX client_months_UK  ON client_months 
    (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
    index created.
    
    CREATE MATERIALIZED VIEW LOG ON client_months with rowid;
    
    CREATE MATERIALIZED VIEW client_months_mv 
    BUILD immediate 
    REFRESH FAST ON COMMIT 
    AS 
    SELECT * FROM client_months;
    
    ORA-12014: table 'CLIENT_MONTHS' does not contain a primary key constraint
    I don't want to refresh the mview when validation is performed on the base table.
    And I don't want to change the base table by adding a primary key.

    is it possible to create the mview journal using the unique index? or another solution?
    Please help
    Thanks in advance
    Naama

    Naamas wrote:
    No,
    I already read this post!

    Then you read wrong:

    SQL> CREATE TABLE client_months
      2  (
      3    SUBJ_CODE         NUMBER(4),
      4    SERV_CODE         NUMBER(4),
      5    DEBIT_CODE        NUMBER(4),
      6    PERIOD_NUM        NUMBER(2),
      7    PERIOD_NAME       VARCHAR2(40 CHAR),
      8    FIRST_MON_DAY     DATE,
      9    LAST_MON_DAY      DATE,
     10    VALUE_MON_DAY     DATE,
     11    MONTHES           NUMBER(4,2),
     12    GARDENING_WEIGHT  NUMBER(5,4),
     13    REASON_CODE       NUMBER(5),
     14    STAMP_ACTION      VARCHAR2(1 CHAR),
     15    STAMP_CDATE       DATE                        DEFAULT SYSDATE,
     16    STAMP_DATE        DATE,
     17    STAMP_USER        VARCHAR2(15 CHAR),
     18    REGION_CODE       NUMBER(9)
     19  )
     20  /
    
    Table created.
    
    SQL> CREATE UNIQUE INDEX client_months_UK  ON client_months
      2  (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
      3  /
    
    Index created.
    
    SQL> CREATE MATERIALIZED VIEW LOG ON client_months with rowid
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW client_months_mv
      2  BUILD immediate
      3  REFRESH FAST WITH ROWID ON COMMIT -- pay attention to WITH ROWID
      4  AS
      5  SELECT * FROM client_months
      6  /
    
    Materialized view created.
    
    SQL>
    

    SY.

Maybe you are looking for