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

Similar Messages

  • Difference between Null and null?

    What is the difference between null and NULL?
    When is each used?
    Thanks,

    veryConfused wrote:
    There is a null in java, but no NULL. null means no value. However, when assigning value, the following is different:Although the empty String has no special role. Null means, the referential type is not assigned (doesn't refer) to a specific object. The empty String is just another object though, so seeing it or pointing it out as something special when it actually isn't at all (no more special than new Integer(0) or new Object[0]) just adds to the confusion.

  • Difference between IS NULL and = NULL

    Hello Guys,
    In 10gR2 what is the difference between IS NULL and = NULL
    Thanks,
    Imran

    Just don't use the second, because the comparison operator = cannot deal with NULLs as you (probably) hope it can:
    SQL> create table t1 as select rownum as id, 'test' as word from dual connect by level<=2;
    Table created.
    SQL> update t1 set word=null where id=1;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
            ID WORD
             1
             2 test
    SQL> select * from t1 where word is null;
            ID WORD
             1
    SQL> select * from t1 where word = null;
    no rows selectedKind regards
    Uwe Hesse
    http://uhesse.wordpress.com

  • What is the difference between string != null and null !=string ?

    Hi,
    what is the difference between string != null and null != string ?
    which is the best option ?
    Thanks
    user8729783

    Like you've presented it, nothing.  There is no difference and neither is the "better option".

  • 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/

  • Trying to return query dynamically if parameter value is not null and null

    Hi,
    I wrote a custom code like this....
    Public Shared Function GETSQL(ByVal month as Date, ByVal year as Date, ByVal partyCode as Integer)
    Dim sql1 As String
    Dim sql2 As String
    Dim sql3 As String
    Dim sql4 As String
    If (IsNothing(partyCode)) Then
    sql1 = " select " & vbCrLf
    sql3 = " where " & vbCrLf
    sql3 = sql3 & " Month(SaleHDR.Date)=month " & vbCrLf
    sql3 = sql3 & " and year(SaleHDR.Date)=year " & vbCrLf
    sql4 = " GROUP BY Month(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " YEAR(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " DAY(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " ProductGroup.ProductGroupCode " & vbCrLf
    Else
    sql1 = " select " & vbCrLf
    sql3 = " where " & vbCrLf
    sql3 = sql3 & " Month(SaleHDR.Date)=month " & vbCrLf
    sql3 = sql3 & " and year(SaleHDR.Date)=year " & vbCrLf
    sql3 = sql3 & " and Party.PartyCode=partyCode " & vbCrLf
    sql4 = " GROUP BY Month(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " YEAR(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " DAY(SaleHDR.Date), " & vbCrLf
    sql4 = sql4 & " ProductGroup.ProductGroupCode " & vbCrLf
    End If
    sql2 = " Month(SaleHDR.Date) as Month, " & vbCrLf
    sql2 = sql2 & " YEAR(SaleHDR.Date)as Year, " & vbCrLf
    sql2 = sql2 & " DAY(SaleHDR.Date) as Day, " & vbCrLf
    sql2 = sql2 & " ProductGroup.ProductGroupCode, " & vbCrLf
    sql2 = sql2 & " SUM(ISNULL(SaleDTL.ProductRate,0)*isnull(SaleDTL.ProductQuantity,0)) as SalesAmount " & vbCrLf
    sql2 = sql2 & " from " & vbCrLf
    sql2 = sql2 & "  SaleDTL " & vbCrLf
    sql2 = sql2 & "  inner Join " & vbCrLf
    sql2 = sql2 & " SaleHDR " & vbCrLf
    sql2 = sql2 & "  ON SaleDTL.Id = SaleHDR.id " & vbCrLf
    sql2 = sql2 & "  inner Join " & vbCrLf
    sql2 = sql2 & "  ProductMaster " & vbCrLf
    sql2 = sql2 & "  ON SaleDTL.ProductId = ProductMaster.ProductID " & vbCrLf
    sql2 = sql2 & "  inner Join" & vbCrLf
    sql2 = sql2 & "  ProductGroup " & vbCrLf
    sql2 = sql2 & "  ON ProductMaster.ProductGroupId = ProductGroup.ProductGroupID " & vbCrLf
    sql2 = sql2 & "  inner Join " & vbCrLf
    sql2 = sql2 & "  Party " & vbCrLf
    sql2 = sql2 & "  ON SaleHDR.PartyId = Party.PartyID " & vbCrLf
    GETSQL = sql1 & sql2 & sql3 & sql4
    End Function
    to use in my project report. I'm just trying to combine two reports(first one without partycode condition, second with a party code condition) into one report by using above custom code.
    then i use this as a query expression in a dataset: Code.GETSQL(Parameters!Month.Value,Parameters!Year.Value,Parameters!PartyCode.Value)
    but when i try to preview the report i'm getting a error saying:
    Cannot set the command text for dataset 'DataSet1'
    Error during processing of the command text expression of dataset 'DataSet1'.
    Can anyone help me here Please!!!
    Very much appreciated if anyone can guide me if there is a other way around.
    Thank you!!

    I think you just need to do this as a SQL query in your data source, and use the condition:
    WHERE (Party.PartyCode = @pPartyCode or @pPartyCode is null)
    I rewrote your vb as t-sql here:
    (if you're using this as a data source, remove the first line where the parameters are declared, as SSRS will create the parameters for you)
    declare @pMonth int, @pYear int, @pPartyCode nvarchar(20)
    select
    month(SaleHDR.[Date]) as [Month],
    year(SaleHDR.[Date]) as [Year],
    day(SaleHDR.[Date]) as [Day],
    ProductGroup.ProductGroupCode,
    SUM(ISNULL(SaleDTL.ProductRate,0)*isnull(SaleDTL.ProductQuantity,0)) as SalesAmount
    from SaleDTL
    inner join SaleHDR ON SaleDTL.Id = SaleHDR.id
    inner join ProductMaster ON SaleDTL.ProductId = ProductMaster.ProductID
    inner join ProductGroup ON ProductMaster.ProductGroupId = ProductGroup.ProductGroupID
    inner join Party ON SaleHDR.PartyId = Party.PartyID
    where
    Month(SaleHDR.[Date])= @pMonth
    and year(SaleHDR.[Date])= @pYear
    and (Party.PartyCode= @pPartyCode or @pPartyCode is null)
    group by month(SaleHDR.[Date]),
    year (SaleHDR.[Date]),
    day (SaleHDR.[Date]),
    ProductGroup.ProductGroupCode

  • Varchar2, empty strings and NULL

    Hi all,
    When inserting an empty string into a column of type varchar2 - is a NULL value stored in the column by the database? I've seen conflicting reports, and I know that the SQL 1992 spec specifies that empty strings not be treated as a NULL value, but that Oracle has traditionally treated zero length strings stored in a varchar2 column as NULL.
    So, is there a way to store an empty string in a varchar2 column as an empty string and not a NULL value?
    TIA,
    Seth

    It can be even more complicated or annoying than NULL not equal to ASCII NULL.
    example:
    create table test_null
    (fld1 varchar2(10),
    fld2 varchar2(10),
    fld3 varchar2(20));
    insert into test_null values (chr(0),null, 'chr(0) and null');
    insert into test_null values (null, null, 'null and null');
    insert into test_null values ('', chr(0), ''''' and chr(0)');
    insert into test_null values ('', null, ''''' and null');
    select * from test_null;
    FLD1       FLD2       FLD3
                          chr(0) and null
                          null and null
                          '' and chr(0)
                          '' and null
      1  DECLARE
      2  BEGIN
      3   for c1 in (select fld1, fld2, fld3 from test_null) loop
      4      if c1.fld1 = c1.fld2 then
      5         dbms_output.put_line(c1.fld3||' Are equal'||
      6                '  Length fld1 = '||to_char(length(c1.fld1))||
      7                ' Length fld2 = '||to_char(length(c1.fld2)));
      8      else
      9         dbms_output.put_line(c1.fld3||' Are NOT equal'||
    10                '  Length fld1 = '||to_char(length(c1.fld1))||
    11                ' Length fld2 = '||to_char(length(c1.fld2)));
    12      end if;
    13      dbms_output.put_line(' ');
    14   end loop;
    15*  END;
    SQL> /
    chr(0) and null Are NOT equal  Length fld1 = 1 Length fld2 =
    null and null Are NOT equal  Length fld1 =  Length fld2 =
    '' and chr(0) Are NOT equal  Length fld1 =  Length fld2 = 1
    '' and null Are NOT equal  Length fld1 =  Length fld2 =
    PL/SQL procedure successfully completed.

  • Will substr + not function ignore null values ?

    hi guys
    i have a table test with 1 column named (value) of varchar2 type.
    inside this table, i have 3 rows.
    1) 2255
    2) null
    3) 5522
    when i do select * from test where substr(value,1,1) not in ('3'), it only returns me
    row 1) 2255
    row 3) 5522
    but why doesnt it return me row 2 with null value as well ?
    since substr(null) will generate null. and null is also NOT IN ('3'), why doesnt it shows?
    any ideas guys ?

    Because NULL is unknown.
    By definition you cannot say if unknown is IN or NOT IN anything.
    So you have to account for the unknown however you think appropriate, in your case that would mean saying:
    select * from test where substr(value,1,1) not in ('3') OR value IS NULL;
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Join is not working  for NULL values on join condition

    HI ,
    I have the following problem .
    SQL> select *from a;
    X Y
    1
    2
    3
    4
    SQL> select *from b;
    B Y
    1
    2
    SQL> select f.x,f.y,s.b from a f,b s
    2 where f.x=s.b(+);
    X Y B
    1 1
    2 2
    4
    3
    SQL> select f.x,f.y,s.b from a f,b s
    2 where f.x=s.b(+)
    3 and f.y=s.y;
    no rows selected
    So now if i include one more join condition where in null = null situation arises , it is now working.
    Simply saying its not treating ( 1 and null ) and ( 1 and null ) are same.
    What is the solution.Is this a expected behaviour.
    Thanks
    Pramod Garre

    HI
    I want something like this
    SQL> select f.x,f.y,s.b from a f,b s
    2 where f.x=s.b(+);
    X Y B
    1 1
    2 2
    4
    3
    SQL> select f.x,f.y,s.b from a f,b s
    2 where f.x=s.b(+)
    3 and f.y=s.y;
    Instead of "now Rows " i have to get
    X Y B
    1 1
    2 2
    4
    3
    Is there is any way to do this.
    Thanks
    Pramod

  • 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

  • Checking null and not null values

    Hi!
    We have a job schedule table that has a column for each day.
    JOB_ID, TIME_ID, MO, TU, WE, TH, FR, SA, SU
    1                 1        X
    1                 2                        XSince the same job can be on different days and times, we need to check all the instances of
    that job.
    Sorry for the formatting - the X is an indicator; i.e. Wednesday and Saturday.
    How can we solve this?
    Thanks!

    Your requirements are not really clear.
    Perhaps this query could help:
    -- Your Data:
    with yourtable as
      select 1 job_id, 1 time_id, null mo, null tu, 'X' we, null th, null fr, null sa, null su from dual union all
      select 1 job_id, 2 time_id, null mo, null tu, null  we, null th, null fr, null sa, 'X' su from dual
    -- Query:
    select job_id, time_id, 'mo' day from yourtable where to_char(mo)='X' union all
    select job_id, time_id, 'tu' day from yourtable where to_char(tu)='X' union all
    select job_id, time_id, 'we' day from yourtable where to_char(we)='X' union all
    select job_id, time_id, 'th' day from yourtable where to_char(th)='X' union all
    select job_id, time_id, 'fr' day from yourtable where to_char(fr)='X' union all
    select job_id, time_id, 'sa' day from yourtable where to_char(sa)='X' union all
    select job_id, time_id, 'su' day from yourtable where to_char(su)='X'Edited by: hm on 29.07.2011 01:40
    Edited by: hm on 29.07.2011 01:41

  • Null and empty string not being the same in object?

    Hello,
    I know that null and empty string are interpreted the same in oracle.
    However I discovered the strange behaviour concerning user defined objects:
    create or replace
    TYPE object AS OBJECT (
    value VARCHAR2(2000)
    declare
    xml xmltype;
    obj object;
    begin
    obj := object('abcd');
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := '';
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := null;
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    end;
    When creating xml from object, all not-null fields are transformed into xml tag.
    I supposed that obj.value being either '' or null will lead to the same result.
    However this is output from Oracle 9i:
    <OBJECT_ID><VALUE>abcd</VALUE></OBJECT_ID>
    <OBJECT_ID><VALUE></VALUE></OBJECT_ID>
    <OBJECT_ID/>
    Oracle 10g behaves as expected:
    <OBJECT><VALUE>abcd</VALUE></OBJECT>
    <OBJECT/>
    <OBJECT/>
    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?

    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?A lot of "fixes" were done, relating to XML in 10g and the XML functionality of 9i was known to be buggy.
    I think you can safely assume that null and empty strings are treated the same by Oracle regardless. If you're using anything less than 10g, it's not supported any more anyway, so upgrade. Don't rely on any assumptions that may appear due to bugs.

  • 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.

  • "cacheHostInfo is null" and Add-SPDistributedCacheServiceInstance : Object reference not set to an instance of an object.

    I am working on a standalone install Sharepoint 2013 (no Active Directory). I found newsfeed feature is not available and checked Distributed Cache service is stopped. When start it “cacheHostInfo is null” is returned.
    I checked the Windows service “AppFabric caching service” is stopped because the default identity “Network Service” not work. Then I change the AppFabric service identity to use “.\administrator” (which is also the sp farm administrator) and the service can
    be started.
    However the “cacheHostInfo is null” when try to start Distributed Cache service in central admin.
    I searched on web and found this blog: http://rakatechblog.wordpress.com/2013/02/04/sharepoint-2013-spdistributedcacheserviceinstance-cachehostinfo-is-null/
    I tried to run the script but it return error:
    Add-SPDistributedCacheServiceInstance : Object reference not set to an
    instance of an object.
    At C:\root\ps\test.ps1:8 char:13
    + $whatever = Add-SPDistributedCacheServiceInstance
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Share…ServiceInstance:
    SPCmdletAddDist…ServiceInstance) [Add-SPDistributedCacheServiceInstance]
    , NullReferenceException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddDistr
    ibutedCacheServiceInstance
    I am not sure what went wrong. Please give me some idea? Thank you for any comment!

    Can you deploy Active Directory as installing without is not a supported installation scenario - http://support.microsoft.com/kb/2764086.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for

  • {@link Object#clone()} , -link does not work!!

    I have a problem with this!! Somehow the -link option does not work very well. I have ensured that I did correctly set my command option -link to -link http://java.sun.com/j2se/1.4.1/docs/api I have already imported java.lang.Object at the top of my

  • On screen Icon

    I have got a small icon(alert) at the top left hand side of  my screen. It looks like a battery with a number by the side of it.This morning the number was 9 then it went to 12 and now its on 19 can anyone tell me what it is how to view if its an ale

  • Apple TV 2 doesn't show fotos in widescreenmode via airplay

    The Apple commercial website shows an example for fotoviewing on a widescreen TV (Woman in front of a green door with white doorframe in a yellow house) To show a pic in fullscreenmode is not possible!!!!! When you show pics from your iPhone 4S via A

  • Heade files in sun studio 12

    Hello, I have Sun Studio Express - February 2007 Early Access Release. I intend to use it only in "C" projects. I had tried to create a "C" project successfully. When I generate a "C" header , named for example list.h, it is created thus: #ifndef lis

  • Append a txt or doc file to a Teststand Report

    How can I append an external doc or txt file ( that already exsists somewhere on my hard drive) to the report generated by Teststand 3.1 at the end of a "Test UUTs" seq run ?