Is not null?

Hi guys,
I'm trying to make this statement in java but am not sure what the correct syntax would be: text is NOT null
this is what i tried so far:
!text == nullHow can I say this correctly?
Much appreciated

[sorry, forget that]
it's "text != null" you're looking for, I presume.

Similar Messages

  • 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

  • Null and not null columns

    Hi,
    I want to specify that if an ID is 0 or null to do something... I am not sure if I am writing the code properly since it does not display anything when the coulmn has data(not null)
    <%! int ID=1;%>
    <% if ((ID ==0) || (request.getParameter("ID") !=null)){ %>
    do something
    <%} else {%>
    do something else
    <%%>
    if the ID is has a number greater than 0 then I would like to display information. But my code does not get to the else statement?
    Thanks!

    Remember the functionality of logical OR operator. IF the first statement evaluated is TRUE, the next are not evaluated.

  • Is not null and null join

    Hi, I am trying to properly display a list of tasks for a project however without a join to the project number (which I was aware of) and the employee table, I get over 500 results.
    The task can be created without a employee assigned to it so therefore the page does not require the field to be filled in.
    Here is the SQL code, any does anyone have any ideas?
    select
        pd.pk_proj_detail_id    "Task Number",
        pd.task_title           "Task Title",
        pd.DETAIL_STATUS        "Task Status",
        pm.name                 "Associated Project",
        pps.last_name||', '||pps.first_name||', '||pps.middle_initial||'.' "Assigned Employee",
        pd.TRACKIT_NUMBER       "TrackIt! Number",
        pd.CREATEBY_DATE        "Date Entered",
        pd.DATE_BEGIN           "Date Began",
        pd.ESTIMATED_DATE       "Estimated Completion Date",
        pd.DATE_END             "Date Completed"
    from
        PROTRAC_DETAIL pd,
        protrac_master pm,
        cobr.vw_pps_payroll pps,
        resources r
    where
        pd.fk_proj_master_id = pm.PK_PROJ_MASTER_ID
        and r.fk_master_id = pm.PK_PROJ_MASTER_ID
        and (r.emp_id = pps.emple_no
            or r.emp_id is null)

    It's 10g r2 with Application Express 3.1.0.00.32
    This is the tasks (detail) table
    ALTER TABLE PROTRAC_DETAIL
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PROTRAC_DETAIL CASCADE CONSTRAINTS;
    CREATE TABLE PROTRAC_DETAIL
      PK_PROJ_DETAIL_ID      NUMBER                 NOT NULL,
      FK_PROJ_MASTER_ID      NUMBER,
      TRACKIT_NUMBER         NUMBER,
      DETAIL_DESCRIPTION     VARCHAR2(4000 CHAR),
      DETAIL_STATUS          VARCHAR2(19 CHAR),
      DETAIL_STATUS_COMMENT  VARCHAR2(4000 CHAR),
      DATE_BEGIN             DATE,
      DATE_END               DATE,
      ESTIMATED_DATE         DATE,
      CREATEBY_DATE          DATE,
      CREATEBY_USER          VARCHAR2(50 CHAR),
      LASTMOD_DATE           DATE,
      LASTMOD_USER           VARCHAR2(50 CHAR),
      TASK_TITLE             VARCHAR2(100 CHAR)
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX PROTRAC_DETAIL_PK ON PROTRAC_DETAIL
    (PK_PROJ_DETAIL_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_PROTRAC_DETAIL
    before insert or update
    on PROTRAC_DETAIL
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_proj_detail_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_PK
    PRIMARY KEY
    (PK_PROJ_DETAIL_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_NUM
    FOREIGN KEY (FK_PROJ_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    ALTER TABLE DEVPROTRAC.RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES DEVPROTRAC.PROTRAC_DETAIL (PK_PROJ_DETAIL_ID));
    SET DEFINE OFF;
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (34, 24, NULL, 'test', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/30/2008 13:37:01', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:35', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'bananana');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (41, 40, NULL, '2354234', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/31/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 13:52:02', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', 'I can type on the keyboarddf');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (49, 32, 78888, 'one day fishsticks will walk on the moon.', 'Queued',
        'waiting for fishsticks.', NULL, NULL, NULL, TO_DATE('11/03/2008 11:28:11', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', NULL, NULL, 'Fix the keyboard');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (50, 38, NULL, 'dfdfdfdfdfdfdfdfdf', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 12:03:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:44', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'resreeeeeeeeee');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (33, 31, NULL, 'Make sure the bananas are fresh', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/29/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:52', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'e543563465');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (48, 37, NULL, 'guitar heros! yay', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 11:26:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:57', 'MM/DD/YYYY HH24:MI:SS'), NULL, '34444444444444543etfg');
    COMMIT;This is for the resources table:
    ALTER TABLE RESOURCES
    DROP PRIMARY KEY CASCADE;
    DROP TABLE RESOURCES CASCADE CONSTRAINTS;
    CREATE TABLE RESOURCES
      PK_RESOURCES_ID   NUMBER,
      FK_DETAIL_ID      NUMBER,
      EMP_ID            NUMBER,
      RESOURCE_STATUS   VARCHAR2(8 CHAR),
      RESOURCE_COMMENT  VARCHAR2(4000 CHAR),
      CREATEBY_DATE     DATE,
      CREATEBY_USER     VARCHAR2(50 CHAR),
      LASTMOD_DATE      DATE,
      LASTMOD_USER      VARCHAR2(50 CHAR),
      FK_MASTER_ID      NUMBER
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX RESOURCES_PK ON RESOURCES
    (PK_RESOURCES_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_RESOURCES
    before insert or update
    on RESOURCES
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_resources_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE RESOURCES ADD (
      CONSTRAINT RESOURCES_PK
    PRIMARY KEY
    (PK_RESOURCES_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES PROTRAC_DETAIL (PK_PROJ_DETAIL_ID),
      FOREIGN KEY (FK_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    SET DEFINE OFF;
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (53, 50, 356654, 'Active', NULL,
        TO_DATE('11/04/2008 09:32:06', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, NULL);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (51, 41, 447250, 'Active', 'No Sure.',
        TO_DATE('11/03/2008 14:23:11', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('11/04/2008 09:00:04', 'MM/DD/YYYY HH24:MI:SS'), NULL, 40);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (54, 50, 323829, 'Active', NULL,
        TO_DATE('11/04/2008 10:26:08', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, 38);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (52, 33, 8915, 'Active', 'get to work',
        TO_DATE('11/03/2008 15:20:18', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', TO_DATE('11/03/2008 15:35:10', 'MM/DD/YYYY HH24:MI:SS'), NULL, NULL);
    COMMIT;The results I want is everything above regardless of emp_id assigned (if any). Without the r.emp_id = pps.emple_no join, the query will generate 234234239482304234 results.
    Hope this helps.
    Edited by: leland on Nov 4, 2008 12:56 PM

  • IS NOT NULL and performance

    I have a performance issue with a query - it would be something like -
    select col1,col2, sum(col3), get_val(col_4)
    from table1
    where
    get_val(col_4) is not null
    group by col1,col2, get_val(col_4)
    I have simplified this but it is something similar. This works great - performance is great. Now I commented out the where clause as I needed to populate null values - and that's it the query does not retrieve the resultset - it keeps running forever. With the where clause it comes back in 60 seconds. There is only one row out of 560 rows that has null value for col_4 which i need to display.
    Any help is appreciated.

    The only difference I notice between the two sqls is HASH(UNIQUE) -
    with IS NOT NULL in where clause -
    SELECT STATEMENT     ALL_ROWS     1598     1     209
    HASH(UNIQUE)          1598     1     209
    HASH(GROUP BY)          1598     1     209
    When is not null is removed from the where clause -
    SELECT STATEMENT     ALL_ROWS     1598     1     206
    HASH(GROUP BY)          1598     1     206          
    I'm guessing that the index is being used in the first scenario and not in the second. Any idea/suggestion as to how to over come this?          
    Thanks

  • Order Of Null and Not Null Values while table creation

    We have to create a table with 10 fields .5 of them are Null and Not Null. Now my question what should be the order of fileds??.Means Null Fields will come first or Not Null.

    The only reason I can think of having the NULL columns at the end is storage space.
    To conserve space, a null in a column only stores the column length (zero). Oracle
    does not store data for the null column. Also, for trailing null columns, Oracle does
    not even store the column length.

  • BOOLEAN DEFAULT FALSE NOT NULL for key-column

    Hello,
    These statements show an unexpected behavior when a column is added to a table as 'BOOLEAN DEFAULT FALSE NOT NULL' and added afterward to the table's primary key column set:
    create table test_1 (a char(1))
    insert into test_1 values('A')
    alter table test_1 add b boolean default false not null
    alter table test_1 add primary key (a,b)
    create table test_2 (a char(1), b boolean default false not null)
    insert into test_2 (a) values('A')
    alter table test_2 add foreign key f_test_1 (a,b) references test_1 (a,b)
          -> [350]: Referential integrity violated
    update test_1 set b=false
    alter table test_2 add foreign key f_test_1 (a,b) references test_1 (a,b)
          -> success
    delete from test_2
    delete from test_1
    insert into test_1 (a,b) values('A',false)
    insert into test_2 (a) values('A')
          -> success
    I think the error message '[350] Referential integrity violated' should not happen because the column 'b' really contains 'false'. But there obviously seem to be a difference before and after setting the column 'b' explicitly to 'false'. I can imagine that this depends on the way how the index for the primary key is updated. Probably the index is not properly updated in this context(?)
    Gabriel

    Hi Gabriel,
    you're right, this is a bug and indeed seems to caused by the way the DEFAULT boolean is stored in the page.
    (There is no separate index for the primary key in MaxDB as all data is stored in B*trees - basically the table is the primary key).
    This is how the record looks like when column b is 'false' only due to the change of the DEFAULT value:
    ROOT/LEAF 460  perm       entries : 1         [block 0]
         bottom  : 93         filevers: 14888     convvers: 83
                                                  writecnt: 1
      1: (pos 00081)
    00001      recLen      : 12                recKeyLen   : 4
    00005      recVarcolOff: 0                 recVarcolCnt: 0
         record
          1  2  3  4  5  6  7  8  9 10 11 12
         81 82 83 84 85 86 87 88 89 90 91 92
    dec: 12  0  4  0  0  0  0  0 32 65  0  0
    hex: 0C 00 04 00 00 00 00 00 20 41 00 00
    chr:                             A
    And this is how it looks like after the explicit UPDATE:
    ROOT/LEAF 460  perm       entries : 1         [block 0]
         bottom  : 93         filevers: 14888     convvers: 84
                                                  writecnt: 2
      1: (pos 00081)
    00001      recLen      : 11                recKeyLen   : 3
    00005      recVarcolOff: 0                 recVarcolCnt: 0
         record
          1  2  3  4  5  6  7  8  9 10 11
         81 82 83 84 85 86 87 88 89 90 91
    dec: 11  0  3  0  0  0  0  0 32 65  0
    hex: 0B 00 03 00 00 00 00 00 20 41 00
    chr:                             A
    Little difference but this leads to the problems during the foreign key validation.
    I'll inform the developers next week about this.
    As a workaround you'll have to explicitly update the columns for which you change the default setting.
    regards,
    Lars

  • Alter Table Add column not null default value

    I want to add two columns to a table with not null and default as 0 for both columns
    Can i write the whole in one statement or do i have to split statement
    I tried this, but didn't work
    alter table DWSODS01.DWT00301_ORD_DTL_OMS add (
    COMB_ORD_FLG NUMBER(5,0) default 0 not null,
    COMB_ORD_NO NUMBER(12,0)
    default 0 not null);
    How can i modify the code?

    user10390682 wrote:
    I tried this, but didn't workSince you are specifying default values, it should work (regardless if table DWSODS01.DWT00301_ORD_DTL_OMS is empty or not):
    SQL> select count(*) from emp1
      2  /
      COUNT(*)
            14
    SQL> alter table emp1 add (
      2  COMB_ORD_FLG NUMBER(5,0) default 0 not null,
      3  COMB_ORD_NO NUMBER(12,0)
      4  default 0 not null);
    Table altered.
    SQL> desc emp1
    Name                                      Null?    Type
    EMPNO                                              NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    COMB_ORD_FLG                              NOT NULL NUMBER(5)
    COMB_ORD_NO                               NOT NULL NUMBER(12)
    SQL> What error are you getting?
    SY.

  • Oracle BPEL - Does not cater for not null columns and use of "default".

    Oracle BPEL - Does not cater for not null columns and use of "default".
    BPEL fails with message:
    ORA-01400: cannot insert NULL into ("EDDB"."SEISMIC_LINES"."COORD_SYSTEM_ID")
    But SQL*PLUS command works:
    INSERT into EDDB.SEISMIC_LINES
    (etc)
    regards
    Allan Ford
    Analyst / Programmer - IT Application Services, IT Services, Shared Business Services
    Santos Ltd
    Level 4, 91 King William Street, Adelaide SA 5000
    Phone: 08 8224 7944 Fax: 08 8218 5320
    Email: [email protected]

    note: BPEL keeps it's own "offline" copy of table and database items. A column that is marked not null in the database can be marked as nullable in this area. (if you kmow that a trigger is going to cater for this ..)
    One workaround is to use a trigger to provide value rather than use the column default ..

  • ORA-01400 - not null column with default value and item with authorization

    I've searched - I would think someone has run into this. APEX 3.0.0.00.20 - I've created a simple form on a table. One of the column is a not null column with a default value. I have a select list on that item, but it has security on it - authorization scheme. So, it checks the user and if that user isn't of the right role, it will not even display that item. However, APEX appears to still send in the column in its sql! So, the default value is useless, it sends in null each time. Even if I set the default at the Item level, I get null. Argg. That's got to be a bug...
    In debug, I do not see the item listed at all. It's not used. That's fine - but why is it trying to insert the value? I would think it would leave it off??? I think because the item is associated with a database column. But, getting around this is ugly. Having to create a hidden item for each one, and then check to see if I need to take the list value... horrible. Any way to get around this???

    I should add - I guess I can always put my own custom process in to replace the DML. Just seems like a simple thing - if the value doesn't appear on the debug, isn't set with any default value... don't include it in the DML.

  • Default Value , Not Null and EJB2.1

    Hi ,
    Am using Weblogic10.3 + Oracle Db + EJB2.1 Local Entity Beans .
    The issue is that one of the table has createdDt which is not null and is defualt is set to Sysdate. When I try to create this Entity with createdDt null , I get an exception like below , But since I have mentioned default value , I shouldnt be getting this. Have I missed something ?
    Code is quite straighforward
    Organisation org = organisationHome.create();
    ....org.setter methods..
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
    ErrorCode=1400 SQLState=23000
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
         at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
         at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbcspy.SpyPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:159)
         at weblogic.ejb.container.manager.BaseEntityManager.executeInsertStmt(BaseEntityManager.java:763)
         at weblogic.ejb.container.internal.TxManager$TxListener.executeInsert(TxManager.java:900)
         at weblogic.ejb.container.internal.TxManager$TxListener.executeDBOperations(TxManager.java:831)
         at weblogic.ejb.container.internal.TxManager$TxListener.beforeCompletion(TxManager.java:1054)
         at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1217)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1195)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:118)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1302)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2114)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:621)
         at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
         at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl.createOrganisation(DomainServices_7p8lqs_EOImpl.java:7717)
         at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    parmTest( , "param2") is syntactically incorrect, so there can be no "workaround".
    In addition to solutions offered by SwapnilVJ and Saransoft84, you could also use a rest parameter:
    function parmTest(... args)
    // set up default values
    var val1:Boolean=true;
    var val2:String="";
    switch(args.length)
      case 0:break;
      case 1:
       if(args[0] is String){val2=args[0] as String;}
       else{val1=args[0] as Boolean;}
       break;
      case 2:
      default:
       val1=args[0] as Boolean;
       val2=args[1] as String;
       break;
       trace(val1 + " " +val2);
    parmTest();
    parmTest("hello");
    parmTest(null,"hello");
    parmTest("hello",null);

  • Empty string in NOT NULL column

    I'm migrating data to Oracle 9i from a database engine that supports emtpy strings in column with NOT NULL specified in the DDL. I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?
    Thanks

    I would have thought Oracle would support this, but any attempt to put empty string data into a column created with NOT NULL is returning a 'column does not support nulls'-type error.In Oracle Null means null nothing not even an empty String.
    Yes DB's like Ingress supports this. But I think Oracle is right.
    Is there an option to allow this, or does Oracle simply not support this and assumes blank is null?I am not aware of any options as it is against the basic principles.
    you can find work arounds to do the migration. But storing a blank NO.
    Good Luck
    Vij

  • Not Understanding the filter in Explain Plan - filter(NULL IS NOT NULL)

    Hi All,
    Request your help in understanding the below scenario. (I am not aware of teh application and table details. Just trying to help my friend)
    SQL> conn
    Enter user-name: [email protected]
    Enter password:
    Connected.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    --Checking the count in PO_LINES
    SQL> select count(*) from po_lines;
      COUNT(*)
             0
    --PO_LINES is a synonym
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES';
    OBJECT_TYPE         OWNER
    SYNONYM             APPS
    --The synonym is pointing to PO.PO_LINES_ALL
    SQL> select * from user_synonyms where synonym_name = 'PO_LINES';
    SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
    PO_LINES                       PO                             PO_LINES_ALL
    --But when counting PO.PO_LINES_ALL I am getting different result
    SQL> select count(*) c from po.po_lines_all;
             C
          8828
    --Explain plan of teh original query is
    SQL> explain plan for
      2  select
      3  * from po_lines;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name         | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT   |              |     1 |   252 |     0   (0)|
    |*  1 |  FILTER            |              |       |       |            |
    |   2 |   TABLE ACCESS FULL| PO_LINES_ALL |  8796 |  2164K|   106   (4)|
    Predicate Information (identified by operation id):
       1 - filter(NULL IS NOT NULL)
    --Now the object PO.PO_LINES_ALL is TABLE, not an mview.
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES_ALL';
    OBJECT_TYPE         OWNER
    TABLE               POSeek your help in understanding what is happening here.
    Thanks in Advance,
    jeneesh

    Next time, prefix with APPS. when you show us the explain plan:
    SQL> explain plan for
      2  select
      3  * from apps.po_lines;  -- added the prefix of owner.Just like you prefixed with PO. when you showed us the query on PO_LINES_ALL. It ensures that you are using the synonym which you showed us.
    Btw. PO_LINES_ALL, could still be a VIEW given your overview of the situation.
    Anyway a filter "NULL IS NOT NULL" is indicative that the optimizer performed something called semantic query optimization (SQO).
    SQO is the process of deducing new predicates based upon a) existing predicates in your query (which there is none), b) added predicates to your query (eg. by a VPD policy function), and c) declared constraints on the tables invovled in your query.
    A typical example of when a "NOT is NOT NULL" predicate will show up is when for instance in the EMP table there is a declared constraint on EMPNO like this:
    check(EMPNO > 0)And your query would hold a predicate that is inconsistent with the constraint, for instance like this:
    select *
    from EMP
    where EMPNO <= 0Oracle will deduce that EMPNO cannot be both greater than zero (constraint) as well as smaller than or equal to zero (your query predicate), and will transform the query into:
    select *
    from EMP
    where EMPNO <= 0
      and NULL is NOT NULLThus preventing accessing the EMP table all together, and immediately returning this query with no data found.
    Edited by: Toon Koppelaars on Mar 15, 2010 7:17 AM

  • To Check column is NOT NULL

    Hi
    I am trying to find out whether table column is NOT NULL or Not using ALL_CONSTRAINTS VIEW.But the problem is I am getting 'C' for the columns with NOT NULL and the columns with Check constraint. IF I want to find out the column is NOT NULL or not what is the best way.Help is appreciated.
    thanks
    srinivas vundi

    Hi
    Inorder to filter the records I am trying to use SUBSTR(SEARCH_CONDITION,-4) LIKE 'NOT NULL'.But it is throwing error. How do I filter the records where value is '%NOT NULL'. Please respond .
    thanks
    srinivas

  • Primary key and relevant not null check constraints....

    Hi ,
    There are some constraints of primary key type and not null check constraints on columns which constitute each primary key....
    Should I/Do I have to drop them....????
    Do they burden the db at the time of data validation....????
    Thanks...
    Sim

    Hi,
    >>There are some constraints of primary key type and not null check constraints on columns which constitute each primary key..
    In fact, a column that constitutes a primary key, by default cannot accept NULL values. In this case, defines a PK column as NOT NULL would not be necessary.
    LEGATTI@ORACLE10> create table x (id number constraint pk_x primary key);
    Table created.
    LEGATTI@ORACLE10> desc x
    Name                  Null?    Type
    ID                    NOT NULL NUMBER
    LEGATTI@ORACLE10> select constraint_name,constraint_type,table_name,search_condition from user_constraints where table_name='X';
    CONSTRAINT_NAME                C TABLE_NAME      SEARCH_CONDITION                
    PK_X                           P X
    LEGATTI@ORACLE10> create table y (id number not null constraint pk_y primary key);
    Table created.
    LEGATTI@ORACLE10> desc y
    Name                  Null?    Type
    ID                   NOT NULL NUMBER
    LEGATTI@ORACLE10> select constraint_name,constraint_type,table_name,search_condition from user_constraints where table_name='Y';
    CONSTRAINT_NAME                C TABLE_NAME      SEARCH_CONDITION
    SYS_C006327381 C Y "ID" IS NOT NULL 
    PK_Y                           P Y
    LEGATTI@ORACLE10> alter table y drop constraint SYS_C006327381;
    Table altered.
    LEGATTI@ORACLE10> desc y
    Name                                      Null?    Type
    ID                                        NOT NULL NUMBER
    LEGATTI@ORACLE10> insert into y values (NULL);
    insert into y values (NULL)
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("LEGATTI"."Y"."ID")
    LEGATTI@ORACLE10> insert into y values (1);
    1 row created.
    LEGATTI@ORACLE10> insert into y values (1);
    insert into y values (1)
    ERROR at line 1:
    ORA-00001: unique constraint (LEGATTI.PK_Y) violated
    >>Should I/Do I have to drop them....????
    I don't see any problem, otherwise, drop the NOT NULL constraint is the same with alter the column table like below:
    LEGATTI@ORACLE10> create table z (id number not null constraint pk_z primary key);
    Table created.
    LEGATTI@ORACLE10> select constraint_name,constraint_type,table_name,search_condition from user_constraints where table_name='Z';
    CONSTRAINT_NAME                C TABLE_NAME                     SEARCH_CONDITION
    SYS_C006328420 C Z "ID" IS NOT NULL
    PK_Z                           P Z
    LEGATTI@ORACLE10> desc z
    Name                                      Null?    Type
    ID                                        NOT NULL NUMBER
    LEGATTI@ORACLE10> alter table z modify id NULL;
    Table altered.
    LEGATTI@ORACLE10> select constraint_name,constraint_type,table_name,search_condition from user_constraints where table_name='Z';
    CONSTRAINT_NAME                C TABLE_NAME                     SEARCH_CONDITION
    PK_Z                           P Z
    LEGATTI@ORACLE10> desc z
    Name                                      Null?    Type
    ID                                        NOT NULL NUMBERCheers
    Legatti

Maybe you are looking for

  • Is there a limit to the number of mails that Mail can import?

    I'm importing from the last Time Machine backup of my MacBook Pro to a new iMac. The import gets stuck at 72k so I can't set up mail. I know it's nuts to have 100k of messages and I'll be doing something about that, but for now I need to get Mail wor

  • How much RAM can I install?

    Alright.  This seems simple but I don't want to have to go through the rigamarole of buying the wrong one and having to return it.  I have a Mid-2010 MacBook Pro running Lion 10.7.3, currently with the 4gb of RAM that it came with.  I want to upgrade

  • HT4436 My iPhone was stollen this afternoon. I'm wondering if anyone can teach me how to synchronise my iPhone content to my iPad? Thank you.

    My iPhone was stollen this afternoon. I'm wondering if anyone can teach me how to synchronise my iPhone content to my iPad? Thank you.

  • Generate Web Dynpro Model?

    Hi, I'm familiar with DS 7.0, and I'm begining to lear 7.1 recently. I searched for tutorials and in the forum, but I can't find how to create a Web Dynpro model from a CAF DC, in 7.0 it was just a right click and generate WD Model, can you help me p

  • Facebook Like box code for Muse

    I need to know how to add a Facebook Like box to my Muse home page. When obtaining this code, there are two items of code to paste: 1. Include the JavaScript SDK on your page once, ideally right after the opening <body> tag. <div id="fb-root"></div>