Check the values in two columns, in the affirmative, then generate an error

Oracle 10g version

Hi gurus

I'm test1 table and it contains several columns, my requirement I want to create some sort of conditions or constraints before inserting data into test1, it will check that application_id or APPLICATION_TYPE_CD contains no values in the two columns...

I appreciate your advice. Thank you

/ / DESC test1

APPLICATION_ID NUMBER (10)

DATE OF APPLICATION_DT

APPLICATION_TYPE_CD VARCHAR2 (10)

DATE OF CREATED_DT

Concerning

MIT

You need a check as a constraint:

ALTER table test1 add constraint only_one

check ((application_id n'est pas null et application_type_cd est null) or)

(application_id is null and application_type_cd is not null))

John

Tags: Database

Similar Questions

  • Starting from two data tables, how do you get the values in two columns using values in a column (values get col. If col. A is not null values and get the pass. B if col. A is null)?

    Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?

    Guessing

    Select nvl (x.col_a, y.col_b) the_column

    from table_1 x,.

    table_2 y

    where x.pk = y.pk

    Concerning

    Etbin

  • Satellite A10 - failed at startup, check the system, then press F1

    Hi, I have this laptop old to repair.

    Main problem is that it starts. Display errors after all start-up:

    -#1 error - broken cdrom IDE
    -Check the system, then press F1 - ppl say it's a low cmos battery
    -File Boot.ini file is missing - is unable to repair itself, so that the CD does not work.

    Now, it looks like this. I turn on the laptop, shows the toshiba welcome screen, then theres the boot.ini of message end missing, begin on c:/windows and bam the phone keeps reseting showing again and again the same error. When I press ESC theres the message check system, then press F1 or IDE #1 - random error.

    If anyone has had this problem, Ive looked on the internet but did not get a decent answer, what to do with these cases.
    Looking forward to some good quality advice :)

    Hey,.

    I think the case is clear: Windows may start t because the boot.ini file is missing. You would be able to repair this file or reinstall Windows, but your work isn't CD player I think you need to replace the CD/DVD drive to get rid of this error.

    Then contact an authorized service provider, or take a look on eBay for second hand parts. Maybe you can find a compatible CD/DVD player that will work.
    Then you can boot from the Windows disc and repair Windows System.

    Of course, you can also restore factory settings using the Toshiba Recovery disk, but as a result, you must work of CD/DVD drive. ;)

  • Trigger to check a value in a column

    Hello!

    When inserting a new line or the update, I want to check the value of a specific column using the trigger. For example, to add '!' with existing value at the end in the case already not found. If not found, so no action.

    Column value: "Attention!" - no action
    Column value: 'Attention' - then he must add '!' at the end.

    Thanks in advance.

    Rgds,
    Shannura

    956579 wrote:
    Hello!

    When inserting a new line or the update, I want to check the value of a specific column using the trigger. For example, to add '!' with existing value at the end in the case already not found. If not found, so no action.

    Column value: "Attention!" - no action
    Column value: 'Attention' - then he must add '!' at the end.

    Thanks in advance.

    Rgds,
    Shannura

    Welcome to the forum!

    Please show us what you have tried and where you experience the problem. This requirement seems straight forward to me. Ask so try you first.

  • How to check multiple values with another column?

    Hi all

    create table xxc_abc (col1 , dept_id number number);

    create the table xxc_bbb (col2 number,sa_dept_id number);

    insert into xxc_abc values (1,10)

    insert into xxc_abc values (2,11)

    insert into xxc_abc values (3,12)

    insert into xxc_bbb values (20.10)

    insert into xxc_bbb values (20,11)

    insert into xxc_bbb values (20,12)

    SELCT

    xxc_abc a.,

    xxc_bbb b

    where a.dept_id = b.sa_dept_id

    Expected results

    a.Col1 b.col2

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

    1 20

    2 20

    3 20

    I need to get several values a.col1 with the same value of the b.col2 column

    a.Col1 b.col2

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

    1 20

    2 20

    3 20

    Thank you

    Post edited by: Rajesh123 added Test cases in the main Thread

    Select the number you want to


    with

    xxc_abc as

    (select 1 col1, 10 dept_id in union double all the)

    Select 2,11 Union double all the

    Select double 3.12

    ),

    xxc_bbb as

    (select col2 20, 10 sa_dept_id union double all the)

    Select 20,11 Union double all the

    Select 20,12 double

    )

    Select col1, col2, cnt_all, cnt_not_null, cnt_unique

    from (select a.col1, b.col2,

    Count (*) on cnt_all (b.col2 partition).

    Count (a.Col1) on cnt_not_null (b.col2 partition),

    Count (distinct a.col1) on cnt_unique (b.col2 score)

    xxc_abc a.,

    xxc_bbb b

    where a.dept_id = b.sa_dept_id

    )

    where least (cnt_all, cnt_not_null, cnt_unique) > 1

    order by col1

    COL1 COL2 CNT_ALL CNT_NOT_NULL CNT_UNIQUE
    1 20 3 3 3
    2 20 3 3 3
    3 20 3 3 3

    Concerning

    Etbin

  • Exchange of values between two columns

    I have a MEMBERS_SYSTEMS_ID table with three columns ID, B1, B2.
    I need to swap values between B1 and B2 for particular values of ID.
    IAM trying the following but is not working, please help solve + [If you can also tell why my SQL does not work which would be awesome] +.

    BEGIN
    DECLARE the temp varchar (50)
    UPDATE MEMBERS. MEMBERS_SYSTEMS_ID

    SET temp = B2,
    B2 = B1,
    B1 = temp
    WHERE ID IN ('85 ', ' 86');
    END

    You cannot update a variable as part of an update, only columns in the table. And, in fact, you don't have an intermediate variable, just do the update directly as:

    SQL> SELECT * FROM t;
    
            ID DESCR1     DESCR2
    ---------- ---------- ----------
             1 Descr2     Descr1
             1 Other2     Other2
             2 Two1       Two2
    
    SQL> UPDATE t
      2  SET descr1 = Descr2,
      3      descr2 = descr1
      4  WHERE id = 1;
    
    2 rows updated.
    
    SQL> SELECT * FROM t;
    
            ID DESCR1     DESCR2
    ---------- ---------- ----------
             1 Descr1     Descr2
             1 Other2     Other2
             2 Two1       Two2
    

    John

  • If I format my pc and do not check the driver, then my hard drive is destroyed. Is this true?

    hard drive Info

    HI.some people said that if the pc format and do not really check pilot the destroyed.is hard disk driver or is a fake.thank you

    Formatting erases everything, including device drivers.  Driver hard drive is usually part of the motherboard (unless your drive is connected to a PCI card).

    So once you reinstall Windows using the default SATA / IDE hard disk driver. Once you install the chipset driver for your matherboard you will use driver disk from the manufacturer of the computer or the motherboard.

    J W Stuart: http://www.pagestart.com

  • Overview of the data in the service Console Regional on the client machine generates an error.

    When I saw the data in the Regional (version 11.1.1.4) service console on a client workstation, I get a "cannot sign in the field. "Error of initialization of the ORB.java.io.FileNotFoundException: domain.db (access is denied)" error. Now, if I use the client URL to Admin Console on the same computer am able to preview the data correctly. Also when I saw the data on the client installed on the server can't correctly preview data. Just when I use the Admin console client installed on a workstation, I get this error. Any suggestions?

    Thank you
    Ted.

    Published by: Teddd on March 26, 2013 14:51

    TimG says:
    I certainly say it is your problem (I don't even know how to see / control when installing local vs. web-Launcher finds Java, or if indeed there is a difference) but I think it's plausible enough to a test value

    In 11.1.1.3 the Regional (not the web version) service console will resume java installed on the machine, if Java has not been installed it will use the settings in the admincon.lax file for example lax.nl.current.vm=E:\Hyperion\common\JRE\Sun\1.5.0\bin\java.exe
    So basically if you have installed Java 1.6 it will pick up and use that otherwise it will use the default JRE INSTALLED with Hyperion. The web console needs a version of Java installed in order to use Java Web Start.
    And I agree to have a different version of Java that sustained can cause problems using the Regional service console.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • I downloaded 8.0; saved; the scanner; then he ran: error msg 'file corrupted '?

    Unable to download the 8.0 because of "corrupted file".

    It is possible that your antivirus software is corrupt downloaded files or otherwise interfere with the download of files by Firefox.

    Try disabling analysis in real time (live) files in your software anti-virus temporarily to see if that makes working download.

    See "Antivirus disable in Firefox preferences - Windows."

  • How to simplify the code to generate custom error codes and messages

    I designed a vi that generates the error when any data entry is missing, it works correctly, but the problem is that I want to simplify, because it is part of the main program and its block diagram is great to use as such (I tried to use this vi as a Subvi in the main program, but that does not work correctly) so I need help to simplify the code or if there is no other better medium to generate the error message.

    Hello

    As shown in the previous example, to a different question of yours, it is always good to reduce with diagrams of huge block with repeated code.

    When you overwrite functionality even repeated several times, put it in a loop and run it to have recurrences of 4 or 5 of the same code.

    It will be evolving in the future.

    joined the vi changed for you.

    Note: when you want to simplify your program, isolate your code in functions, put each function inside a under vi.

    in your case, you can have the control to an empty string for all channels within a Subvi. build an array of strings and go through the subvi. Control in the sub that VI is that strings are empty.

    an array of Boolean output error. build your error string in another under vi. the wires together.

  • Filter the rows in a table, based on criteria in two columns

    Is there a way easy to filter a 2d array, based on the values in two columns? For example in my attached VI the output array has the following format:

    10:57:07.776

    Quick response:

    Convert your table 2d in a cluster table where the order of pole defines how broken are managed (first fields are equa on both serach the second point in cluster)

    Run by a kind of 1 table and convert back to a 2d array.

    Faster approach:

    Group only fields serach and an index. Do the research and then use the index to reorganize the original array.

    Ben

  • How to read the two columns of data in a file of PDM.

    Hi all

    I am reading two data columns for the 2nd of a PDM file two sheets, as shown below.

    Two columns of data must then be shared so they can be displayed in a xy chart and also apply a linear adjustment VI. I implemented the graph xy and linear adjustment using a txt file (see below), therefore all the outputs work, however this application with a tdms file turns a little more tax.

    So, essentially, that I don't know how read the correct leaf and therefore the columns in the PDM file and then how to produce the graph xy and linear adjustment of the data types produce. Here's my current attempt, which produces several errors of the type of terminal, as well as not being able to select the exact data in the PDM.

    Any help/suggestions/example vi on this asap would be greatly appreciated.

    Thanks in advance,

    Pete

    Also the PDM file viewer. VI helps you easily understand the structure of data files.

  • for the archive sequence # generated two days back

    What is point of view? script to check the archives (sequence #) generated two days back and are applied in settlement by then delete?

    Hello..

    I guess it would make on primary: -.

    select THREAD#, SEQUENCE#,COMPLETION_TIME,APPLIED,DELETED from  V$ARCHIVED_LOG where completion_time between '31-OCT-09' and '02-NOV-09'
    

    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_1016.htm#REFRN30011]

    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1035245]

    NOTE:-change according to your need.

    HTH
    Anand

    Published by: Anand... November 2, 2009 10:48

  • Checking the status of the main sequence in reminder PostUUT

    I'm checking the State of the main sequence in the PostUUT callback, running TS 2014 SP1.
    Say, the main sequence generates an error. PostUUT I check and get the following

    Parameters.Result.Status "error".
    Parameters.Result.Error.Code

    Parameters.Result.Error.Msg

    Parameters.Result.Error.Occurred False

    Parameters.Result.Error.Occurred should not be set to True? If this isn't the case, please explain why.

    Thank you.

    In the process model of the step that calls the MainSequence reminder is set to ignore errors.  It is for the rest of your group of main step can run.  That is why we only sets result false but retains all the error information.

    If it were me, I would trigger on the State channel.

    Hope this helps,

  • Full deployment of the Commerce Web store reference error

    Hi all

    I ve installed ATG Commerce reference shop 10.0.2 with cim and I started the server with the ear deployed. Every time, when I tried to launch the full deployment, it has always failed. The errors as follows:

    2011-09-28 19:25:53, ERROR 984 [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) atg.repository.ConcurrentUpdateException: no lines updates oldVersion = 38 for item = deploymentProgress:1100002 in GSATransaction=atg.adapter.gsa.GSATransaction@1685535 thread = RepositoryWorkerThread-1(Add-Update Phase) transaction TransactionImple = < ac, BasicAction: aaf04af:127f:4e830300:b4cf status: ActionStatus.RUNNING >
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.adapter.gsa.GSAItemDescriptor.updateItem(GSAItemDescriptor.java:7066)
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.adapter.gsa.GSARepository.updateItem(GSARepository.java:1047)
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.persistMarkerData(DeploymentWorkerThread.java:911)
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.checkpoint(DeploymentWorkerThread.java:963)
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.processMarkerPhase(DeploymentWorkerThread.java:583)
    2011-09-28 19:25:53, 984 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.run(DeploymentWorkerThread.java:307)
    2011-09-28 19:25:58, ERROR 921 [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) atg.repository.ConcurrentUpdateException: no lines updates oldVersion = 45 for item = deploymentProgress:1100002 in GSATransaction=atg.adapter.gsa.GSATransaction@c05514 thread = RepositoryWorkerThread-1(Add-Update Phase) transaction TransactionImple = < ac, BasicAction: aaf04af:127f:4e830300:d3e9 status: ActionStatus.RUNNING >
    2011-09-28 19:25:58, 921 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.adapter.gsa.GSAItemDescriptor.updateItem(GSAItemDescriptor.java:7066)
    2011-09-28 19:25:58, 936 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.adapter.gsa.GSARepository.updateItem(GSARepository.java:1047)
    2011-09-28 19:25:58, 983 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.persistMarkerData(DeploymentWorkerThread.java:911)
    2011-09-28 19:25:58, 983 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.checkpoint(DeploymentWorkerThread.java:963)
    2011-09-28 19:25:58, 983 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.processMarkerPhase(DeploymentWorkerThread.java:583)
    2011-09-28 19:25:58, 999 ERROR [STDERR] (RepositoryWorkerThread-1(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.run(DeploymentWorkerThread.java:307)
    2011-09-28 19:26:04, ERROR 889 [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) atg.repository.ConcurrentUpdateException: no lines updates oldVersion = 52 for item = deploymentProgress:1100002 in GSATransaction=atg.adapter.gsa.GSATransaction@13e8810 thread = RepositoryWorkerThread-7(Add-Update Phase) transaction TransactionImple = < ac, BasicAction: aaf04af:127f:4e830300:f3e8 status: ActionStatus.RUNNING >
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.adapter.gsa.GSAItemDescriptor.updateItem(GSAItemDescriptor.java:7066)
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.adapter.gsa.GSARepository.updateItem(GSARepository.java:1047)
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.persistMarkerData(DeploymentWorkerThread.java:911)
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.checkpoint(DeploymentWorkerThread.java:963)
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.processMarkerPhase(DeploymentWorkerThread.java:583)
    2011-09-28 19:26:04, 889 ERROR [STDERR] (RepositoryWorkerThread-7(Add-Update Phase)) to atg.deployment.DeploymentWorkerThread.run(DeploymentWorkerThread.java:307)
    2011-09-28 19:31:11, 121 ERROR [nucleusNamespace.atg.deployment.DeploymentManager] (main deployment :) thread all threads are stopped, but there are still some 750 more assets to deploy.) Marking this deployment as being down. Check the log files of specific errors that could have caused this condition. Return to the deployment to continue.

    Thank you.

    Try the full deployment with DeploymentManager.maxThreads = 1

Maybe you are looking for

  • Can I get the IP address used by other devices for synchronization?

    One of my machines was stolen. I wanted to know if I could find it using the synchronized information. I hope that there is a way to determine the IP address, and then contact the owner of this IP block to see if they can help me more. Is this is pos

  • AMD Radeon HD/Intel switchable graphics

    Hello Since I upgraded to window 10 I can't use my AMD Radeon hd graphics card. and I have not choice on most catalyst to switch from one card to the other, what I can do, basically my computer run only on intel HD graphics card, without any open gl,

  • BitLocker on X 220 with UEFI boot?

    Anyone who manages to get BitLocker works on a 220 X with boot UEFI? I'm invited to the recovery at every startup key. I use a version of Windows 7 Ultimate x 64 running costs using a GPT disk and boot UEFI. I tried to disable everything except the m

  • After you fix "validating identity", then it turns to "limited or no connectivity" problem.

    Pls HELP! I read the posts here.  At the beginning, my problem is 'validation of identity '.  "Then I try the recommendation here and uncheck enable IEEE.  It works and ask me a network key.  But he turns to "limited or no connectivity." I try to res

  • WRT1900AC - external storage - not detected

    I have an external storage drive is not detected. I can plug in a USB key on the router and have found things. When I plug my external hard drive into the router, I get the name of the drive but the router does not detect the size, and I can't access