Conditional Not Null

I am trying to create an item level validation on an entry form for a Conditional Not Null. For example ...
Field 1 = Animal Type
Field 2 = Dog Type
If Field 1 = Dog .... Field 2 must be Not Null.
Can someone help me set this up. Thanks in advance for your assistance.

Are REQUEST_TYPE and ACCT_EXTERNAL_ONLY page items? Because in that case you have to use the bind variable syntax to access them.
IF :REQUEST_TYPE = 'External' AND :ACCT_EXTERNAL_ONLY IS NULL THEN
    RAISE_APPLICATION_ERROR (-20001,'Error Message');
END IF;Patrick
My APEX Blog: http://www.inside-oracle-apex.com
The APEX Builder Plugin: http://builderplugin.oracleapex.info/
The ApexLib Framework: http://apexlib.sourceforge.net/

Similar Messages

  • Regarding IF(IS NOT NULL) condition in Assignment

    Hello,  I am trying to write assignment with functions IF(IS NOT NULL(Product.record),xyz). In this condition, it seems IF condition is not working at all. Can some one confirm that in Assignment, IF condition do not work the way it works in Validation? I am using MDM 7.1 SP04.

    Hi Priya,
    1st thing as i can see COUNTRY Should be a field in your Main Table which is look-up to some Flat Table say  Countries which has some fields (e.g First Name etc). You want if COUNTRY Field of your main table has some value mean that COUNTRY field is populated in your Main table then First Name field value (Which is available in Countries)  should be populated using assignment. Suppose your Countries table has two records and two fields as shown below:
    COUNTRYCODE     FIRSTNAME
    IND ABC
    US XYZ     
    2nd thing if your Field COUNTRY of Main table is empty then First Name Value will not be populated as your field COUNTRY of main table is not linked with Countries table. Your Assignment Expression should be like this as given below:
    IF(IS NOT NULL(COUNTRY.RECORD), COUNTRY.First Name)
    Off-course, if country.record is null mean does not have any value assigned IND or US for main table record with Field COUNTRY, it removes the existing first name value since now this field COUNTRY of your main-table is empty and has not any value (US or IND) and therefore has not any linking of your Main table COUNTRY Field with Look-up Flat Table Countries and hence will remove the existing value.
    But if your main table field COUNTRY has a value IND for a main table record, then using assignment expression it will populate ABC. If  a main table record has value US then will populate FIRSTNAME XYZ using assignment Expression.
    Can you please update the status of thread?
    Regards,
    Mandeep Saini

  • How to combine two conditions :  Exists and Item not null ?

    Hello !
    I have a flash chart region that I would like to display only if two conditions are both true.
    The first condition is this one :
    Exists (SQL query returns at least one row) :
    select 1
    from    observatoire.fiche aa, observatoire.activite_faite bb
    where   aa.fiche_id = bb.fiche_id
    and     bb.fiche_id = aa.fiche_id
    AND     bb.activites_id = TO_NUMBER(:P23_ACTIVITES_ID)
    AND     TRUNC(aa.date_activite, 'YYYY') = TRUNC(TO_DATE(:P23_ANNEE, 'YYYY'), 'YYYY')And the second condition would be :
    Item not null :
    P23_ACTIVITES_IDHow to combine these two conditions into one display condition ?
    Thank you .
    Christian

    Hello,
    The issue is that you're doing -
    TO_NUMBER(:P23_ACTIVITES_ID)When you leave the Null return value blank like that, you'll typically see '%null%' used in session state (i.e. it's not actually null). Obviously '%null%' can't be converted to a number, hence the error you're seeing.
    A simple solution would be to make your null return value -1 or some other value that is guaranteed not to be a valid id (and alternative is to convert the %null% to a real null via an App/Page process etc (if you search this forum you'll find a few examples on how to do that). Another alternative is to use a DECODE to detect the '%null%' etc.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • How to add a "item not null" condition to an existing request condition ?

    Hi,
    I have a condition for displaying a region ;
    Request Is NOT Contained within Expression 1
    Expression 1 value is : "GET_DETAIL_MONTH || GET_DETAIL_DAY"
    It works fine.
    But the problem is that I would like to add a condtion to this. This condition would be that the item P10_DEPT is not NULL.
    How to do ?
    Thank you for your kind answers.

    Hello,
    Swith the condition type to a PL/SQL Expression and enter
    (:P10_DEPT IS NOT NULL) and (:REQUEST NOT IN ('GET_DETAIL_MONTH','GET_DETAIL_DAY'))
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • MySQL using Is Null and Is Not Null

    Hi
    I am using mySQL and PHP to design a web site. On one of the
    pages I want to able to display a list of records based on a date
    field either having a date inputted or not having a date inputted.
    I want the user to be able to select these options on the page via
    a list box as below
    Label Value
    Open Is Null
    Closed Is Not Null
    However I can not seem to get this to work (sql below), is
    the syntax correct and should it be a GET or POST variable eg
    $_POST['ListBox']. Hope this makes sense.
    SELECT *
    FROM tbltable
    WHERE datefield variable
    Thanks

    Change the order of your conditions
    SELECT name,
           lname,
           CASE WHEN creditcard IS NULL AND credit_used IS NULL THEN
             'Sell both'
           WHEN creditcard IS NULL THEN
             'Sell Card'
           WHEN credit_used IS NULL THEN
             'Sell Credit'
           ELSE
             'No Action'
           END "Action"
      FROM customers;

  • Difference between Not Null and Null..

    Hi All,
    In Conditional Region portion i would like to know the difference between
    Value of item in Expression 1 is not null and we will assign the text filed name in expression.
    Value of item in Expression 1 is null
    When we have use the above two scenerio's ..
    Not null means what it has some value in text filed or not.
    pls help me out.
    Anoo..

    Hello Anoo,
    Validations check the input and will return an error message if the validation is not met (like 'Field is required').
    Conditions can be used to run a Process (or render an item) when some condition is met - or not- (like do this only when field is not null).
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • Testing for IS NOT NULL with left join tables

    Dear Experts,
    The query is showing the NULL rows in the query below....
    Any ideas, advice please? tx, sandra
    This is the sql inspector:
    SELECT O100321.FULL_NAME_LFMI, O100321.ID, O100404.ID, O100321.ID_SOURCE
    , O100404.NAME, O100321.PERSON_UID, O100404.PERSON_UID, O100404.VISA_TYPE
    FROM ODSMGR.PERSON O100321
    , ODSMGR.VISA O100404
    WHERE ( ( O100321.PERSON_UID = O100404.PERSON_UID(+) ) ) AND ( O100404.VISA_TYPE(+) IS NOT NULL )

    Hi Everyone,
    I am understanding alot of what Michael and Rod wrote.... I am just puzzled over the following:
    the query below is left joining the STUDENT table to
    HOLD table.
    The HOLD table - contains rows for students who have holds on their record.
    a student can have more than one hold (health, HIPAA, basic life saving course)
    BUT, for this query: I'm only interested that a hold exists, so I'm choosing MAX on hold desc.
    Selecting a MAX, helps me, bec. it reduces my join to a 1 to 1 relationship, instead of
    1 to many relationship.
    Before I posted this thread at all, the LEFT JOIN below testing for IS NOT NULL worked w/o
    me having to code IS NOT NULL twice....
    Is that because, what's happening "behind the scenes" is that a temporary table containing all max rows is being
    created, for which Discoverer has no predefined join instructions, so it's letting me do a LEFT JOIN and have
    the IS NOT NULL condition.
    I would so appreciate clarification. I have a meeting on Tues, for which I have to explain LEFT JOINS to the user
    and how they should create a query. I need to come up with rules.
    If I feel "clear", I asked my boss to buy Camtasia videocast software to create a training clip for user to follow.
    Also, if any Banner user would like me to email the DIS query to run on their machine, I would be glad to do so.
    thx sooo much, Sandra
    SELECT O100384.ACADEMIC_PERIOD, O100255.ID, O100384.ID, O100255.NAME, O100384.NAME, O100255.PERSON_UID, O100384.PERSON_UID, MAX(O100255.HOLD_DESC)
    FROM ODSMGR.HOLD O100255, ODSMGR.STUDENT O100384
    WHERE ( ( O100384.PERSON_UID = O100255.PERSON_UID(+) ) ) AND ( O100384.ACADEMIC_PERIOD = '200820' )
    GROUP BY O100384.ACADEMIC_PERIOD, O100255.ID, O100384.ID, O100255.NAME, O100384.NAME, O100255.PERSON_UID, O100384.PERSON_UID
    HAVING ( ( MAX(O100255.HOLD_DESC(+)) ) IS NOT NULL )
    ORDER BY O100384.NAME ASC

  • Only render an Item if the Item is not null

    I have a number of Items that have a Source Type of Database Column
    and are populated using an Automatic Row Fetch. My problem is that
    I want to only render them if they are not null. I have tried to use
    the condition - Value of Item in Expression 1 is NOT NULL and setting
    Expression 1 to &MY_ITEM. i.e. the name of the item currently being
    processed. However, this is always null which leads me to believe that the value
    is not set till it is rendering is complete.
    I know that I can use an sql query to determine if the column is null. but this is
    an additional round trip to the database for each of the columns I want to test.
    Any Ideas?

    Are you using "&MY_ITEM." in the expression 1 box? It should be just "MY_ITEM"

  • How to give not null value in a rule for a field

    hi,
    i want to create a rule through rule designer where i want a field say "country" should not be left blank. when i go to the rule designer and select country through attribute value i get 2 conditions "=" and "!=" what shoud i give the value as so that the country field is not null.
    TIA

    I don't think you can have null value in the rule designer , rather you can created one more UDF and populate this UDF with something based on the nulllness/not-null of the country field and use this new UDF in the rule .
    Hope this helps .
    Thanks
    Suren

  • OR condition not working correctly in SQL

    I am adding the folling condition to a sql statement and
    AND (status_code IS NULL or status_code <> 'T'
    or (status_code IN ('A','B','C','D') and TRIM(order_type) NOT LIKE '%9999')
    or (status_code IN ('A','B','C','D') and order_type IS NOT NULL)
    or (status_code NOT IN ('A','B','C','D')))
    but the or condition work...
    if i change it too
    AND ( (status_code IN ('A','B','C','D') and order_type IS NOT NULL) )
    then this portion of the OR condition work but when I use the OR condition something weird is happening that the condition not working... and i dont see a record that meets that condition...

    Hi,
    It's not the "trim" that implies "not null", but rather the fact that:
    - "not like" operator works only on non-null values and
    - "not like" operator disregards null values.
    Consider this:
    test@ORA92>
    test@ORA92>
    test@ORA92> l
      1  with x as (
      2    select null as y from dual union all
      3    select 'a9999' from dual union all
      4    select 'bxx' from dual
      5  )
      6  select * from x
      7* where y not like '%9999'
    test@ORA92>
    test@ORA92> /
    Y
    bxx
    1 row selected.
    test@ORA92>
    test@ORA92>Here, trim function was not used, but still the first row (that had null for y) was not returned. That's because Oracle disregarded the first row for comparison and out of the next two rows, it returned the third row because it satisfied the condition.
    As for your query, do the following conditions hold true:
    1. if status_code is null      - show the row regardless of order_type
    2. if status_code <> 'T'       - show the row regardless of order_type
    3. if status_code in (a,b,c,d) and order_type is not null and order_type ends with something other than 9999 - show the row
    4. if status_code in (a,b,c,d) and order_type is null                           - do not show the row
    5. if status_code in (a,b,c,d) and order_type is not null and it ends with 9999 - do not show the row
    6. if status_code is anything other than (a,b,c,d)                              - do not show the rowpratz

  • How to use Not Null in

    Hi All,
    I did one personalization which is related to DFF of an Item.
    It is working partially but i need the perfect solution will u please resolve my doubts.
    My requirement is as follows:
    I have one DFF in Items page say attribute1 which has a maximum of 3 values i.e., 'A' or 'B' or 'C'
    In my Purchase order Auto create form, when an select an requisition, the related lines are displayed for me.
    When i select an line and if the line has an item which has an attribute values of either 'A' or 'B' or 'C'.
    Then i need to display an error message.
    For this I do the following steps.
    In conditions tab i wrote the following condiitons:
    Not Null IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    But my condition evaluates to false, even though i have values in attribute1---------------------- My question is will the above query is right or not. if not will u please provide me the correct syntax of how to use not null.
    'A' IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    The above query is working fine. Please help me on this issue.
    Thanks and Regards
    Zaheer

    Dear Zaheer,
    you compare the organization with Operating unit, Please use
    fnd_profile.value('MFG_ORGANIZATION_ID') inspite of org_id.
    Tariq.

  • SQL 7 - Oracle 8i - NOT NULL dropped for IDENTITY column

    It appears that OMWB is dropping the NOT NULL condition for columns defined as IDENTITY in SQL server 7.
    SQL code to create table:
    CREATE TABLE [dbo].[PCPrsnCorp] (
    [PrsnCorpId] [int] IDENTITY (1, 1) NOT NULL ,
    [PrsnCorpTpEnum] [tinyint] NOT NULL ,
    [Name] [varchar] (128) NOT NULL ,
    [NameFirstIdx] [smallint] NULL ,
    [NameMidIdx] [smallint] NULL ,
    [NameLastIdx] [smallint] NULL ,
    [NameSuffixIdx] [smallint] NULL ,
    [NameLine2Idx] [smallint] NULL ,
    [CmpyId] [smallint] NULL ,
    [ClsnId] [int] NOT NULL
    ) ON [PRIMARY]
    GO
    OMWB migration script:
    REM
    REM Message : Created Table :sa.PCPRSNCORP
    REM User : system
    CREATE TABLE sa.PCPRSNCORP(PRSNCORPID NUMBER (10,0) ,PRSNCORPTPENUM NUMBER
    (3,0) NOT NULL,NAME VARCHAR2 (128) NOT NULL,NAMEFIRSTIDX NUMBER (5,0)
    ,NAMEMIDIDX NUMBER (5,0) ,NAMELASTIDX NUMBER (5,0) ,NAMESUFFIXIDX NUMBER
    (5,0) ,NAMELINE2IDX NUMBER (5,0) ,CMPYID NUMBER (5,0) ,CLSNID NUMBER
    (10,0) NOT NULL) TABLESPACE ORACLEFULL
    NOT NULL appears to be handled correctly if colummn is not defined as IDENTITY. Is there a patch, workaround, or OMWB option to get past this?

    Currently, the Migration Workbench converts IDENTITY columns into a BEFORE INSERT trigger and an Oracle sequence.
    This trigger will fire prior to any INSERT statement executing against the table. The trigger inserts the next value of the defined sequence into the converted IDENTITY column.
    The NOT NULL column attribute is therefore no longer needed.
    Strictly speaking, it would do no harm to keep the NOT NULL column attribute and so I will log a bug on your behalf.
    Thanks for the info.
    Brian.

  • Date Condition Not Working ,Value not cming in to item.

    Hi Friends,
    i have create a form for palce order and i have create a MASTER table for fixed item Rate between two date with price code like A,B,C,D .
    In Form i have for Item
    :P1_ORDER_DATE
    :P1_ITEM_CODE
    :P1_PRICE_CATEGORY Select List With Submit
    :P1_ITEM_RATE
    In Item rate i have put in Source ,
    Source Type --SQL Quary
    Source Vale
    select RATE_1 from SAM_ITEM_MAS where ITEM_CODE =:P1_ITEM_CODE and  PRICE_CATEGORY=:P1_PRICE_CATEGORY and :P1_ORDER_DATE
    between FROM_DATE and TO_DATEMy Table
    CREATE TABLE  "SAM_ITEM_MAS"
       (     "ID" NUMBER NOT NULL ENABLE,
         "ITEM_CODE" NUMBER,
         "PRICE_CATEGORY" VARCHAR2(5),
         "FROM_DATE" DATE,
         "TO_DATE" DATE,
         "RATE_1" NUMBER,
         CONSTRAINT "SAM_ITEM_MAS_PK" PRIMARY KEY ("ID") ENABLE
    /that code's not working but if i run this code in to SQL Command Then it's work fine.but not in to ITEM :P1_ITEM_RATE .
    i want when i select P1_PRICE_CATEGORY Like A,B,C,D then Respective Rate from Table SAM_ITEM_MAS should come in to item :P1_ITEM_RATE .
    Oredr date condition is not working.
    Thanks
    Edited by: 805629 on Dec 28, 2010 11:32 PM

    Hi,
    Have you tried casting the item values as dates using TO_DATE():
    select RATE_1
    from SAM_ITEM_MAS
    where ITEM_CODE =:P1_ITEM_CODE
    and  PRICE_CATEGORY=:P1_PRICE_CATEGORY
    and TO_DATE(:P1_ORDER_DATE,'DD/MM/YYYY') between "FROM_DATE" AND "TO_DATE"(change the date format string to match the format of the P1_ORDER_DATE page item)
    You should probably change the name of the field to something other than TO_DATE as this is an Oracle function name - try DATE_FROM and DATE_TO or START_DATE and END_DATE or something like that. Otherwise you may have to use the double-quotes as I have shown above
    Andy

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

  • Not null and enable or disable  column in tabular form

    Hi,
    Using apex version 4.1 and working on tabular form.
    ACT_COA_SEGMENT_MAS is Master table
    and
    ACT_SEGMENT_VALUES_MAS is detail table
    I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
    How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
    I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
    Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 9, 2013 9:12 PM

    Vedant,
    You need to create you own manual tabular form and not use the wizard.
    Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
    select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
    Hope that help.
    Vivek

Maybe you are looking for