Coalesce of a null field

I have the following:
PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID CH_DOC_ID_6,
PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID CH_UID_6,
SELECT NVL(TO_CHAR(PCMS_CHDOC_THIS_ACTION_DESC_2.FILE_VERSION), TO_CHAR('No Value Found'))
FROM PCMS_CHDOC_THIS_ACTION_DESC PCMS_CHDOC_THIS_ACTION_DESC_2
WHERE PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
AND PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_UID
) FILE_VERSION_6,
SELECT COALESCE(PCMS_CHDOC_THIS_ACTION_DESC_2.DATA,TO_CLOB( 'No Value Found'))
FROM PCMS_CHDOC_THIS_ACTION_DESC PCMS_CHDOC_THIS_ACTION_DESC_2
WHERE PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
AND PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_UID
) DATA_6
FROM
PCMS_CHDOC_DATA
JOIN PCMS_CHDOC_DATA PCMS_CHDOC_DATA_2 ON .....
before there also several fields that are part of a CASE like:
CH_DOC_ID,
CH_UID,
FILE_VERSION,
DATA....etc.
But instead to print "No Value Found" when both FILE_VERSION and DATA are empty or null it prints anything.
What's wrong with it?
Edited by: alenia_am on 26-nov-2009 15.17

The code is this:
SELECT
CASE WHEN ROW_NUMBER=1 THEN
DATA
ELSE TO_CLOB('See Description above') END DATA,
CH_DOC_ID,
COUNT_ID,
ROW_NUMBER,
CH_UID,
CH_DOC_TYPE,
STATUS,
TOOL,
TITLE,
CH_DOC_ID_1,
CH_UID_1,
CH_DOC_TYPE_1,
STATUS_1,
TOOL_1 ,
DROP_TRIGGER_1,
CH_DOC_ID_2,
CH_UID_2,
FILE_VERSION_2,
CH_DOC_ID_3,
CH_UID_3,
FILE_VERSION_3,
DATA_3,
CH_DOC_ID_4,
CH_UID_4,
FILE_VERSION_4,
DATA_4,
CH_DOC_ID_5,
CH_UID_5,
FILE_VERSION_5,
DATA_5,
CH_DOC_ID_6,
CH_UID_6,
FILE_VERSION_6,
DATA_6
FROM
SELECT PCMS_CHDOC_DATA.CH_DOC_ID,
              COUNT(PCMS_CHDOC_DATA_2.CH_DOC_ID) OVER (PARTITION BY PCMS_CHDOC_DATA.CH_DOC_ID) COUNT_ID,
               ROW_NUMBER() OVER (PARTITION BY PCMS_CHDOC_DATA.CH_DOC_ID ORDER BY                PCMS_CHDOC_DATA_2.CH_DOC_ID) ROW_NUMBER,
               PCMS_CHDOC_DATA.CH_UID,
               PCMS_CHDOC_DATA.CH_DOC_TYPE,
               PCMS_CHDOC_DATA.STATUS,
               PCMS_CHDOC_DATA.TOOL,
               PCMS_CHDOC_DATA.TITLE,
               PCMS_CHDOC_DATA_2.CH_DOC_ID               CH_DOC_ID_1,
               PCMS_CHDOC_DATA_2.CH_UID                      CH_UID_1,
               PCMS_CHDOC_DATA_2.CH_DOC_TYPE           CH_DOC_TYPE_1,
               PCMS_CHDOC_DATA_2.STATUS                      STATUS_1,
               PCMS_CHDOC_DATA_2.TOOL                          TOOL_1 ,
               PCMS_CHDOC_DATA_2.DROP_TRIGGER         DROP_TRIGGER_1,
               PCMS_CHDOC_DETAIL_DESC.CH_DOC_ID      CH_DOC_ID_2,
               PCMS_CHDOC_DETAIL_DESC.CH_UID             CH_UID_2,
               PCMS_CHDOC_DETAIL_DESC.FILE_VERSION  FILE_VERSION_2,
                   SELECT COALESCE(PCMS_CHDOC_DETAIL_DESC.DATA, TO_CLOB('See description above'))
                     FROM  PCMS_CHDOC_DETAIL_DESC
                   WHERE PCMS_CHDOC_DATA.CH_DOC_ID =  PCMS_CHDOC_DETAIL_DESC.CH_DOC_ID
                ) DATA,
               PCMS_CHDOC_ACTION_DESC.CH_DOC_ID      CH_DOC_ID_3,
               PCMS_CHDOC_ACTION_DESC.CH_UID             CH_UID_3,
               PCMS_CHDOC_ACTION_DESC.FILE_VERSION  FILE_VERSION_3,
                   SELECT COALESCE(PCMS_CHDOC_ACTION_DESC.DATA, TO_CLOB('No value found'))
                     FROM  PCMS_CHDOC_ACTION_DESC
                   WHERE  PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_ACTION_DESC.CH_DOC_ID
                        AND  PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_ACTION_DESC.CH_UID
                        AND PCMS_CHDOC_ACTION_DESC.FILE_VERSION IN
                                (SELECT MAX(FILE_VERSION)
                                   FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_3
                                WHERE PCMS_CHDOC_ACTION_DESC_3.CH_UID = PCMS_CHDOC_DATA.CH_UID                                                                                  AND PCMS_CHDOC_ACTION_DESC_3.CH_DOC_ID = PCMS_CHDOC_DATA.CH_DOC_ID)
                                  ) DATA_3,
               PCMS_CHDOC_THIS_ACTION_DESC.CH_DOC_ID      CH_DOC_ID_4,
               PCMS_CHDOC_THIS_ACTION_DESC.CH_UID             CH_UID_4,
                  SELECT COALESCE(TO_CHAR(PCMS_CHDOC_THIS_ACTION_DESC.FILE_VERSION), 'No Value Found')
                    FROM PCMS_CHDOC_THIS_ACTION_DESC
                  WHERE PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC.CH_DOC_ID
                       AND PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC.CH_UID             
                ) FILE_VERSION_4,
                 SELECT COALESCE(PCMS_CHDOC_THIS_ACTION_DESC.DATA, TO_CLOB('No Value Found'))
                    FROM PCMS_CHDOC_THIS_ACTION_DESC
                  WHERE PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC.CH_DOC_ID
                       AND PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC.CH_UID
               ) DATA_4,
               PCMS_CHDOC_ACTION_DESC_2.CH_DOC_ID      CH_DOC_ID_5,
               PCMS_CHDOC_ACTION_DESC_2.CH_UID             CH_UID_5,
               PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION  FILE_VERSION_5,
                 SELECT COALESCE(PCMS_CHDOC_ACTION_DESC_2.DATA, TO_CLOB('No Value found'))
                      FROM  PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_2
                    WHERE  PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_ACTION_DESC_2.CH_DOC_ID
                         AND  PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_ACTION_DESC_2.CH_UID
                         AND PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION IN
                  (SELECT MAX(FILE_VERSION)
                     FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_4
                   WHERE PCMS_CHDOC_ACTION_DESC_4.CH_UID = PCMS_CHDOC_DATA_2.CH_UID                                                                              AND PCMS_CHDOC_ACTION_DESC_4.CH_DOC_ID = PCMS_CHDOC_DATA_2.CH_DOC_ID)               
                ) DATA_5,
                PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID CH_DOC_ID_6,
                PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID CH_UID_6,
                 SELECT COALESCE(TO_CHAR(PCMS_CHDOC_THIS_ACTION_DESC_2.FILE_VERSION), TO_CHAR('No Value Found'))
                   FROM  PCMS_CHDOC_THIS_ACTION_DESC PCMS_CHDOC_THIS_ACTION_DESC_2
                 WHERE  PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
                      AND  PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_UID
               ) FILE_VERSION_6,
                  SELECT COALESCE(PCMS_CHDOC_THIS_ACTION_DESC_2.DATA,TO_CLOB( 'No Value Found'))
                    FROM PCMS_CHDOC_THIS_ACTION_DESC PCMS_CHDOC_THIS_ACTION_DESC_2
                  WHERE PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
                       AND PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_UID
               ) DATA_6*
   FROM
              PCMS_CHDOC_DATA
   JOIN   PCMS_CHDOC_DATA  PCMS_CHDOC_DATA_2 ON
              PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_DATA_2.DROP_TRIGGER
   JOIN  PCMS_CHDOC_DETAIL_DESC ON
             PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_DETAIL_DESC.CH_DOC_ID
     AND PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_DETAIL_DESC.CH_UID
   JOIN  PCMS_CHDOC_ACTION_DESC ON
             PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_ACTION_DESC.CH_DOC_ID
     AND PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_ACTION_DESC.CH_UID
     AND PCMS_CHDOC_ACTION_DESC.FILE_VERSION IN
             (SELECT MAX(FILE_VERSION)
                FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_3
              WHERE PCMS_CHDOC_ACTION_DESC_3.CH_UID = PCMS_CHDOC_DATA.CH_UID                                                                                  AND PCMS_CHDOC_ACTION_DESC_3.CH_DOC_ID = PCMS_CHDOC_DATA.CH_DOC_ID)
     LEFT JOIN PCMS_CHDOC_THIS_ACTION_DESC ON
                  PCMS_CHDOC_DATA.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC.CH_DOC_ID
          AND PCMS_CHDOC_DATA.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC.CH_UID
    JOIN        PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_2 ON
                    PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_ACTION_DESC_2.CH_DOC_ID
           AND  PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_ACTION_DESC_2.CH_UID
           AND PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION IN
                  (SELECT MAX(FILE_VERSION)
                     FROM PCMS_CHDOC_ACTION_DESC PCMS_CHDOC_ACTION_DESC_4
                   WHERE PCMS_CHDOC_ACTION_DESC_4.CH_UID = PCMS_CHDOC_DATA_2.CH_UID                                                                              AND PCMS_CHDOC_ACTION_DESC_4.CH_DOC_ID = PCMS_CHDOC_DATA_2.CH_DOC_ID)
    LEFT JOIN PCMS_CHDOC_THIS_ACTION_DESC PCMS_CHDOC_THIS_ACTION_DESC_2 ON
                  PCMS_CHDOC_DATA_2.CH_DOC_ID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
          AND PCMS_CHDOC_DATA_2.CH_UID = PCMS_CHDOC_THIS_ACTION_DESC_2.CH_UID
WHERE PCMS_CHDOC_DATA.TOOL='ICD'
      AND PCMS_CHDOC_DATA.STATUS <> 'CLOSED'
      AND PCMS_CHDOC_DATA.CH_DOC_ID = 'EFA_EQN_J460_M_135'
GROUP BY  PCMS_CHDOC_DATA.CH_DOC_ID,
               PCMS_CHDOC_DATA.CH_UID,
               PCMS_CHDOC_DATA.CH_DOC_TYPE,
               PCMS_CHDOC_DATA.STATUS,
               PCMS_CHDOC_DATA.TOOL,
               PCMS_CHDOC_DATA.TITLE,
               PCMS_CHDOC_DATA_2.CH_DOC_ID,
               PCMS_CHDOC_DATA_2.CH_UID,
               PCMS_CHDOC_DATA_2.CH_DOC_TYPE,
               PCMS_CHDOC_DATA_2.STATUS,
               PCMS_CHDOC_DATA_2.TOOL,
               PCMS_CHDOC_DATA_2.DROP_TRIGGER,
               PCMS_CHDOC_DETAIL_DESC.CH_DOC_ID,
               PCMS_CHDOC_DETAIL_DESC.CH_UID,
               PCMS_CHDOC_DETAIL_DESC.FILE_VERSION,
               PCMS_CHDOC_ACTION_DESC.CH_DOC_ID,
               PCMS_CHDOC_ACTION_DESC.CH_UID,
               PCMS_CHDOC_ACTION_DESC.FILE_VERSION,
               PCMS_CHDOC_THIS_ACTION_DESC.CH_DOC_ID,
               PCMS_CHDOC_THIS_ACTION_DESC.CH_UID,
               PCMS_CHDOC_ACTION_DESC_2.CH_DOC_ID,
               PCMS_CHDOC_ACTION_DESC_2.CH_UID,
               PCMS_CHDOC_ACTION_DESC_2.FILE_VERSION,
               PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID,
               PCMS_CHDOC_THIS_ACTION_DESC_2.CH_DOC_ID
ORDER BY PCMS_CHDOC_DATA.CH_DOC_ID, PCMS_CHDOC_DATA_2.CH_DOC_ID)
The part that is not working is the COALESCE for DATA_6 and FILE_VERSION_6,
all the COALESCE actually,
sorry for the code but I wrote the * as written in the Plain Text Help.
Thanks
Edited by: alenia_am on 26-nov-2009 17.14
Is better now?
Edited by: alenia_am on 26-nov-2009 17.21

Similar Messages

  • How can L identify what are the not null fields of a table in a stored procedure ?

    How can L identify what are the not null fields of a table in a stored procedure ?

    You could query the data dictionary:
    SELECT column_name
    FROM all_tab_columns
    WHERE owner = '...'
    AND table_name = '...'
    AND nullable = 'N'

  • Mapping failure in Null fields passing

    Hi
    We are facing some problem in null fields passing to RFC side.. some times the JDBC colums not having the data ,
    so that time our map is failing to call RFC.
    Please let me know any prevent methodologies for this?
    Target side field occurances are 0...1
    Regards
    rambarki

    Hi Rambarki,
    since your target field is optional, you can map your target only if the value is present in the source, do not map if it is null.
    Also are you getting any specific error ?
    Have a look at this thread aswell..
    JDBC Adapter: Mapping: result contains only null values
    Regards
    Anand

  • Mapping Null fields.

    Hi all,
    I’ve configured an IDOC-to-File scenario with the IDOC MATMAS. The file generated uses the ‘nl’ as the record delimiter and #! as the field separator. Everything works fine except when the IDOC has null fields. In these cases the communication channel does not write these fields because they are not in the XML message and then the structure within the file is bad. I need to write the entire fields even if they are not in the XML-IDOC. I found the mapping function mapWithDefault but there are a lot of fields to map. Is there any other solution to force Comunication Channel or the mapping process to write all the fields even if they have null values?
    Thank you in advance!

    You shud map all the necessary fields manually using the graphical mapping for instantiating the fields on the target.
    Regards,
    Kittu.

  • In WebI report, is that possible to show ZERO in NULL fields?

    in WebI report, is that possible to show ZERO in NULL fields? crystal report has no issue, but i could not find a way to set ZERO to NULL field
    can you tell?

    Bram,
    This formula you used above is corrcet but is returning you a character '0' and when a descending sort is applied character values will be at the top.
    So , apply the formula 'ToNumber' on the value returned form the above formula :-
    ToNumber(above formula)
    And then it will change 0 to number and give you the exact sort order.
    Thanks,
    Rohini Haksar

  • Union reporting involving null fields.

    Hello ALL;
    I'm new to OBIEE and the following is a query on 10g.
    I use the union reporting using dummy/null fields as the Subject areas are built in a way that they don't include all fields one report would need at my work place.
    (Let me know if I could work otherwise)
    Suppose I have a, b fields from S1 and c from S2, I implement the following approach:
    S1 a b 0
    S2 a 0 c
    What I expect to see is:
    Result a b c
    What I see is:
    Result a b 0
    a 0 c
    I see two records with one ID(feild a).
    Could anyone help me on this, please?
    Thanks,
    -RB

    Goto Table View in the answers, change result column formula to avg(saw_1 by saw_0).

  • Getting Rid of Null Fields

    I wasn't very sure how to title this thread.
    I need to restrict Opening Amount to a single period while showing all periods for Activity Amount.
    I have:
    Demensions:
    Fiscal Year
    Business Unit
    Fund Code
    Fiscal Period No
    Fiscal Period No
    GL Acc No
    Gl Acc Description
    Facts:
    Opening Amount
    Activity Amount
    Prompts (Created under the Prompts Tab):
    Fiscal Year
    Business Unit
    Fund Code
    Modified Column Formula:
        Opening Amount:
    CASE FILTER("Facts - GL Balance"."Opening Amount" USING ("Time"."Fiscal Period Number" = 1)) WHEN 0 THEN null ELSE FILTER("Facts - GL Balance"."Opening Amount" USING ("Time"."Fiscal Period Number" = 1)) END
    When Running the analysis I choose the following values for my prompts:
    Fiscal Year: 2011
    Business Unit: 33701
    Fund Code: 49000
    Results are returned as i'd wish except for:
    I only want period 1 for Opening Amount
    I only want Period 999 for Closing Amount
    Both are the same problem.
    I need to restrict Opening Amount to be shown by a single period.... while still showing Activity Amt by all periods.
    The following URL takes you to a photobucket screenshot with descriptions. It is the fields "Undesired NULL Fields" I would like to get rid of.
    http://s813.photobucket.com/user/lancesimmons/media/OpAmt_zpsc08be671.jpg.html#/user/lancesimmons/media/OpAmt_zpsc08be671.jpg.html?&_suid=1377704247312024937668844449184
    Just a heads up, creating filter: 'Opening Amount is not equal to/is not in' restricts the Activity Amount to the first period.
    Any suggestions?

    Hi,
    Modify your XSL as below:
    <xsl:for-each select="/ns0:Employee">
    <tns:FirstName>
    <xsl:value-of select="ns0:FirstName"/>
    </tns:FirstName>
    <xsl:if test='string-length(normalize-space(ns0:MiddleName))>0'>
    <tns:MiddleName>
    <xsl:value-of select="ns0:MiddleName"/>
    </tns:MiddleName>
    </xsl:if>
    <tns:LastName>
    <xsl:value-of select="ns0:LastName"/>
    </tns:LastName>
    </xsl:for-each>

  • NULL fields wrap

    Is it possible to avoid the wrapping for the NULL fields in a table (in Plus33)?
    The fields above or below which have values look OK but the NULL fields are wrapped, thus making it hard to read.
    Thanks!
    Stefan Bargaoanu

    Dear James,
    Thank you for your help. This works indeed but it means that I have to use 'column' for each column that may pose problems.
    In the end, I think that this would be cumbersome.
    I'll just leave the columns as they are and stick to the 'select * from table_name', without formatting each column.
    Thanks!
    Stefan

  • Check for null field

    I have a FormCalc script that checks to see if TextField1 == TextField 2 and if it does then set a value of 1, if they're not equal, then 0.
    However, the form is setting the value to 1 even though there is no entry in either field. I'm thinking I need to include an expression in the formula that says if the fields are null don't set a value. I'm not sure how to do this. Can someone help?
    Thanks,
    MDawn

    You can check to see if the field is Not null and it equals the other field. Something like this:
    if ((form1.page16c.Table1.Row1.posPrice10 == form1.page16c.Table1.Row1.shelfPrice10) & (form1.page16c.Table1.Row1.posPrice10 != null)) then
         1
    else
         0
    endif
    This will mean that the field form1.page16c.Table1.Row1.posPrice10 must not be null and equal to the other field before a 1 will be placed in the field. Otherwise a 0 will be placed in the field.
    Paul

  • How to allocate a text value to a null field in a cross tab

    Hi there,
    I'm using Crystal 2008 and have created a report that retrieves support tickets assigned by team within a specific date field. I've added a cross tab that is retrieving the data correctly. However, if the team field is blank, the cross tab comes up with a blank field - something similar to :
    Team name       # Tickets Assigned
    Team 1  -
    >  10
    Team 2  -
    >  20
    >  15
    Team 3  -
    >  12
    Team 4   -
    > 18
    I would like to be able to have it returned <Unassigned> instead of just white space. Any suggestions on where to begin? I am a beginner at this and would appreciate any help at all.

    instead of using just the value create a formula that will deal with nulls.
    something along the lines of:
    if isnull()
    then "<Unassigned>"
    else ()
    hope that helps
    Dom Horton

  • Null Field in Composite Primary Key

    Can you have a column be part of a primary key and be nullable?
    I have a table of three fields and I want them all to be part of a primary key, because I need all three columns to reference a unique row. However, one of the fields references a field in another table which can be null. Is there anyway I can achieve this?

    Any columns included in the primary key will be converted to not NULLable as necessary, so, no, you cannot have a NULLable column as part of a primary key.
    You can, however, create a unique constraint that includes a NULLable column as part of the composite key.

  • Count of NULL field from SQL Server

    Hi All,
    OBIEE 11g
    I have a requirement to count the number of rows from a table in SQL Server that has NULL values in that particular field. In the BMM I have placed a metric called Total Count and the aggregation for this is Count. The case statement I have in the BMM is as follows.
    CASE <FIELD TO COUNT>
    WHEN NULL THEN 1
    WHEN ' ' THEN 1
    ELSE 0
    I am not getting the correct results for this count.

    Try this
    sum(
    CASE WHEN COL is null or COL =' ' or COL ='' THEN 1 ELSE 0 END)
    If you count 0 also counting.
    Pls mark as correct/helpful if helps

  • Group by with null field

    Hi,
    I am trying to write a group by query that is basically:
    Select a,
    b (sometimes null),
    c,
    sum(d),
    sum(e)
    from (union select a,b,c....),
    G,
    H
    where G.field = a and
    H.field = b (+)
    group by a,
    b,
    c
    Since b is sometimes null, depending if I use an inner or outer join, I will either only get the records where b is not null, or only get the records where b is null.
    I obviously would like all the records whether or not b is null.
    I tried using the nvl function but then how can I use the join to H?
    Can anyone help me here?
    Thanks.
    Leah

    Hi,
    I just learned something new. I did not know that there was such a thing as a full outer join. Thank you for that alone.
    I just solved the problem. I once again used the nvl function and joined to the other folder in the administrator using outer join on master along with one to one between master and detail, and detail item might not exist in master folder. It actually worked.
    Thank you for your help and to anyone else who looked at my question.
    Leah

  • Incomplete query, filtering with a null field

    Hi Experts,
    Very new in the forum and SAPB1 in general and very week in SQL queries. I have the below query
    SELECT T0.[ItemCode], T1.[ItemName],T0.[U_PKGS],T0.[U_InvNo],  T0.[U_File_Number],T0.[LotNumber] AS Garden,T0.[U_Sale_Number],T0.[CreateDate],T0.[U_GROSSWT], T0.[U_Net_Weight], T0.[U_TareWT]  FROM OBTN T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode where LEFT(T0.Itemcode,2)='T1' and T0.[LotNumber]=[%0]
    and I need all records where the field U_Sale_Number is null to be part of the query, I have tried the empty space("") but its not working.
    I also want an int variable declared to cater for number of days between the T0.[CreateDate] field and the current date or system date, I know you can use a DATEDIFF function to get the number of days between the 2 dates but I don't know how to go about it. Kindly assist.
    Patrick.

    Hi Patrick........
    Welcome to SAP Forum......
    SELECT T0.ItemCode, T1.ItemName,T0.U_PKGS,T0.U_InvNo, T0.U_File_Number,T0.LotNumber AS Garden,T0.U_Sale_Number,T0.CreateDate,T0.U_GROSSWT, T0.U_Net_Weight, T0.U_TareWT FROM OBTN T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode where LEFT(T0.Itemcode,2)='T1' and T0.LotNumber='[%0]' And T0.U_Sale_Number Is Null
    Regards,
    Rahul

  • OneToMany resulting in null field.

    I'm attempting to implement the code example from the NetBeans magazine (Nov 2006) using NetBeans 6.0 beta 2 with glassfish-v2 -b58g. It's using a simple db structure with 3 tables:
    [Platform] ---- [JSR] 1----* [Package]
    I'm running into a problem with the 1 to many between JSR and Package.
    The end result is that the jsr field in the inserted Package row is null.
    Here's the JSR class (relevant pieces only, hopefully)
    @Entity
    public class JSR implements Serializable
    private List<Package> packages;
    @OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.ALL,
    mappedBy="jsr")
    public List<Package> getPackages()
    return packages;
    public void setPackages(List<Package> packages)
    this.packages = packages;
    Here's the Package class
    @Entity
    public class Package implements Serializable
    private JSR jsr;
    @ManyToOne
    public JSR getJsr()
    return jsr;
    public void setJsr(JSR jsr)
    this.jsr = jsr;
    Here's the code from a session bean that enters the data:
    @Stateless
    public class JavaPlatformManagerBean
    implements JavaPlatformManagerRemote,
    JavaPlatformManagerLocal
    @PersistenceContext
    private EntityManager em;
    public void createPlatform(Platform platform)
    em.merge(platform);
    The code that calls the session bean (from a jsp backing bean)
    public class JPMClient
    @EJB
    private JavaPlatformManagerRemote jpm;
    public void createJavaSE()
    JSR jsr1 = new JSR(176,
    "Java SE 5 Release Contents",
    new Package ("java.lang"),
    new Package ("java.util"),
    new Package ("java.sql"));
    JSR jsr2 = new JSR(166,
    "Concurrency Utilities",
    new Package ("java.util.concurrent"));
    Platform platform = new Platform ("Java SE 5", jsr1, jsr2);
    jpm.createPlatform(platform);
    And the results of quering the table (in Derby)
    PACKAGE JSR_NUM
    java.util.concurrent NULL
    java.sql NULL
    java.lang NULL
    java.util NULL
    I know this is long winded, but what am I missing in the JSR/Package classes such that the relationship back to the JSR is null?
    Thanks for any insight.
    GregM

    Unfortunately, AMF serialization is something of a black art. I'd run into multiple issues in the past (working with Granite DS, rather than Blaze--but it's essentially the same thing). I'm not sure about Blaze, but Granite has very verbose logging available if you configure log4j to DEBUG level for org.granite. The other alternative is to attach to your Java process with a debugger (Eclipse makes this fairly automagical), download the Blaze source and configure Blaze as a project in Eclipse, add it to source lookup for your project, and step through the actual serialization to see what's going on. This is moderately complicated to set up, but priceless when it comes to debugging.

Maybe you are looking for

  • Hyperlinks in Excel output

    I've seen many conversations on this topic but never a satisfactory solution.  So, I have excel hyperlinks that are built from an equation something like = Hyperlink(A3,"View"), where "A3" is the URL address (e.g., www.example.com) in a hidden column

  • Need to setup Oracle 10g Sandbox for Class

    Hello all, This is the first time I am teaching a class on Oracle 10g. I would like some advice on how to do the initial setup of the database. I have 14 students in my class. I want to create each of them an account and I want each of them to be abl

  • Work flows in FICO

    Can any body explain in brief about work flows in FICO and its useful . Moderator: Please, avoid asking basic questions

  • Button template's styleClass not working

    We have created our own button template in UIX, which specifies a default style and JavaScript mouse events so that the button visually changes when the user hovers the mouse over it. This works, except that on startup, the default class that we assi

  • Missing Screen Savers and other crazy happenings...

    I recently noticed that the screen saver list in my Screen Saver pref window is blank.  As a result, one I open this window, I generally lose control over my keyboard/mouse.  I am unable to quit, close the pref window, tab to other apps, etc.  I've t