OSB to Object Types: difference between NULL value and not available

Hello all,
I have a question about Object Types. More specifically, how to differentiate between an empty value (null) and a string not available.
This is my case:
I have created an object type with three parameters.
CREATE OR REPLACE TYPE OSB_EMP_OBJ_TYPE AS OBJECT
(EMP_ID NUMBER
,DEPT_ID NUMBER
,ORDER_ID NUMBER
,CONSTRUCTOR FUNCTION OSB_EMP_OBJ_TYPE
RETURN self as result
/I would like to see what happens when I put an empty string into emp_id, NULL into DEPT_ID and nothing into ORDER_ID.
To do so I have this test script:
declare
  p_emp OSB_EMP_OBJ_TYPE := OSB_EMP_OBJ_TYPE();
begin
  p_emp.EMP_ID := '';
  p_emp.DEPT_ID := null;
--  p_emp.ORDER_ID := null;
  if p_emp.EMP_ID is null
  then
    dbms_output.put_line('Empty');
  end if;
  if p_emp.DEPT_ID is null
  then
    dbms_output.put_line('NULL');
  end if;
  if p_emp.ORDER_ID is null
  then
    dbms_output.put_line('Not available');
  end if;
end;The result of this is:
Empty
NULL
Not availableIt seems that Oracle treats all three situations alike. What I would like to achieve is a way to see that p_emp.ORDER_ID was not initialized.
To elaborate a bit: in our production system this procedure would be called from OSB and the object type would by the input for that procedure. Our database version is 10.2.0.5.0.
Our procedures look something like this:
procedure p_procedure ( p_emp in osb_emp_obj_type )
is
begin
  do_something;
end;Can anyone tell me if there is a way to achieve this, so I can see whether or not a value in the object type was filled?
Thanks in advance!

Darn...
Eventually we want to use this for an update procedure. The client gets all current data from the database by calling a webservice that (using OSB) selects the data from our database. What we want to achieve is that the client can update that data, by returning only the changed fields to an update procedure.
We then handle an empty tag to update the field to null, and we ignore missing tags.
OSB itself can handle this, but PL/SQL can't.
I'm now thinking of adding an indicator to each optional field (clear_field_yn). OSB can still check for empty tags or missing tags. When a tag is empty, it's corresponding indicator will be set to 'Y'. If the tag is missing, then it will be set to 'N'.
Is that a solution to consider, or is there a much simpler approach possible?

Similar Messages

  • Difference between null string and empty string??

    what is the major difference between null string and an empty string??
    I wrote the following simple program and I could see some different output.
    Other than that, any other differences that we should pay attention to???
    C:\>java TestCode
    Hello
    nullHello
    public class TestCode
         public static void main(String[] s)
         {     String s1 = "";
              String s2 = null;
              System.out.println(s1 + "Hello");
              System.out.println(s2 + "Hello");
    }

    The difference is that an empty String is just empty but a null String has no value (i.e. it is not instantiated) this has signifigance since all Strings are objects.

  • Difference between copy value and use one as many

    hi
    what  is the difference between copy value and use one as many?
    thanks

    [http://help.sap.com/saphelp_nw2004s/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm]
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm]
    Much better understanding of UseOneAsMany: [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
    Edited by: Praveen Gujjeti on Feb 18, 2010 11:42 AM

  • Difference  between null vector and empty Vector

    What is the diffrence between null vector and empty vector.

    null vector means the JVM doesn't allocate memory.It doesn't exist
    in memory. NO instance!
    empty vector means the JVM allocated memory.It exists in memory.
    it's a instance than is accessabel.But only have on elements.
    GL&HF.

  • Describe Object Type / Difference between desc & USER_TYPE_ATTRS ?

    Hi,
    1)Can someone show me how to use the sql+ 'desc' functionality in plsql? I need
    to descrive Object Types in a plsql procedure.
    2)What is the difference between using the 'describe' function - for describing an object type-and doing a select on USER_TYPE_ATTRS etc..?
    Sometimes desc gives an error while querying user_type_attrs works fine!
    db.version: 8.1.7.4
    best regards
    B.

    describe instruction is a SQL*Plus feature not PL/SQL
    Rgds.

  • What is difference between Null String and Empty String ?

    Hi
    Just i have little confusion that the difference bet'n NULL String and Empty String ..
    Please clear my doubte.
    Thankx

    For the same reason I think it's okay to say "null
    String" and "empty String "as long as you know they
    really mean "null String reference" and "empty String
    object" respectively. Crap. It's only okay to say that as long as *the one you're talking to" knows what it really means. Whether you know it or not is absolutely irrelevant. And there is hardly any ambiguity about the effects that a statement like "assign an object to a reference" brings. "Null String" differs in that way.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Difference between null layout and absolutelayout

    hello
    I would like to know the difference between the null layout and the absolutelayout
    thank you in advance

    http://www.google.com/search?q=absolutelayout
    Next time, please use the search yourself.Do I have to consider this as answer Yes.
    notice that I asked for the difference between both
    of the layout and not about
    absolutelayout only Third link, advertised by
    "I think AbsoluteLayout does more than just setting Layout to null. AbsoluteLayout may even accomodate for changes in font sizes etc. ..."
    already should give you something to think about.
    Furthermore, the search shows that there are several different classes named AbsoluteLayout (ADF, SWT, BUI, samskivert...), and you didn't specify which one you're talking about.
    Still think this wasn't an answer?
    I guess I should stop assuming that you have a brain of your own.

  • Difference between audigy value and sound blas

    Since i am unable to find comparisions between soundblaster 24bit and AudigyValue in site , Anyone can give me the difference between these two ?

    Other than the name, not much. Both cards lack the EMU0K/2 chip, and have to do all processing in software (cpu processing instead of on the card). Oh yeah and the Audigy SE has newer drivers than the Value (and will probably install on the SB 24 bit).
    All things considering if you are looking at a card for gaming (or just about anything else) avoid both of them.

  • Differnce between null string and an empty string??

    what is the major difference between null string and an empty string??
    I wrote the following simple program and I could see some different output.
    Other than that, any other differences that we should pay attention to???
    C:\>java TestCode
    Hello
    nullHello
    public class TestCode
         public static void main(String[] s)
         {     String s1 = "";
              String s2 = null;
              System.out.println(s1 + "Hello");
              System.out.println(s2 + "Hello");
    }

    There's a big difference between the two. A null String isn't pointing to an object, but an empty String is. For example, this is perfectly fine:
    public class TestCode
        public static void main(String[] args)
            String s = "";
            System.out.println(s.length());
    } It prints out 0 for the length of the String, just as it should. But this code will give you a NullPointerException:
    public class TestCode
        public static void main(String[] args)
            String s = null;
            System.out.println(s.length());
    } Since s isn't pointing to anything, you can't call its methods.

  • Difference between report mc49 and MC48

    HI,
    i would like to display stock value (in order to date and purchase group) in report MC48 and MC49. The value is different becouse report MC48 shows average stock value and mc49 just stock value. What arleady means "average stock value"? What is the difference between stock value and average stock value?
    Thanks in advance
    Kasia Gac

    Hi Kazia,
    MC48 shows the stock value at the end of the period you enter on the selection screen. The default here is the last 3 months.
    MC49 shows you the average stock value for that period.
    Best,
    Ralf

  • What is diffrence between "Partner Specific" and "Globally Available" Addon

    I would like to know what difference between Partner specific and globally available solution is? OurAdd-on will be available in all the countries including US.  We are thinking of using B1 licensing mechanism instead of using ours. Which is best solution type u201CPartner Specificu201D or u201CGlobally Availableu201D to suit our needs? Which license type will protect our interests and allow us controlling that a customer may not be able to download licenses more than specified in agreement?
    Thanks
    Abhishek Jain

    Without having a look in your system it is hard to say what can be the reason for that.
    you have to know that the master data changes does not reflect automatically in inventory controlling.
    I suggest you to set up the report RMCBNE32 as periodical (e.g. monthly) background job.
    it also would be good to compare the walues in table S032 and MBEW for those materials. This also can be a reason for a difference. The values mus be the same on plant level.

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

  • The difference between FIELD-SYMBOL and normal DATA TYPE

    Dear experts,
    Please see the example below, both are output the same result.
    DATA: EXTERNAL_RECORD(4000),
          POSITION TYPE I,
          LENGTH TYPE N,
          ENTRY TYPE STRING.
    EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'.
    DO.
      LENGTH = EXTERNAL_RECORD+POSITION(4).
      IF LENGTH = 0.
        EXIT.
      ENDIF.
      ADD 4 TO POSITION.
      MOVE EXTERNAL_RECORD+POSITION(LENGTH) TO ENTRY.
      WRITE ENTRY.
      ADD LENGTH TO POSITION.
      IF POSITION >= 4000.
        EXIT.
      ENDIF.
    ENDDO.
    --OR It can be written as--
    DATA: EXTERNAL_RECORD(4000),
          POSITION TYPE I,
          LENGTH TYPE N.
    FIELD-SYMBOLS <ENTRY>.
    EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'.
    DO.
      LENGTH = EXTERNAL_RECORD+POSITION(4).
      IF LENGTH = 0.
        EXIT.
      ENDIF.
      ADD 4 TO POSITION.
      ASSIGN EXTERNAL_RECORD+POSITION(LENGTH) TO <ENTRY>.
      WRITE <ENTRY>.
      ADD LENGTH TO POSITION.
      IF POSITION >= 4000.
        EXIT.
      ENDIF.
    ENDDO.
    Is there any special circumstances we need to use FIELD-SYMBOL?
    Why is FIELD-SYMBOL is introduce in the first place?
    Kindly advice with example.
    Thanks in advance for those who can help me on this.

    HI,
    You can use field symbols to make the program more dynamic. In this example the name of a table control is substituted by a field symbol. Thus you cal call the form with any internal table, using the name of the table control as a parameter.
    Example
    form insert_row
    using p_tc_name.
    field-symbols <tc> type cxtab_control. "Table control
    assign (p_tc_name) to <tc>.
    insert 100 lines in table control
    <tc>-lines = 100.
    Field symbols allow you to:
    **     Assign an alias to a data object(for example, a shortened
            name for data objects structured through several hierarchies
            - <fs>-f instead of rec1-rec2-rec3-f)
    **     Set the offset and length for a string variably at runtime
    **     Set a pointer to a data object that you determine at runtime (dynamic ASSIGN)
    **     Adopt or change the type of a field dynamically at runtime
    **     Access components of a structure
    **     (from Release 4.5A) Point to lines of an internal table
            (process internal tables without a separate work area)
    Field symbols in ABAP are similar to pointers in other programming
    languages. However, pointers (as used in PASCAL or C) differ from ABAP
    field symbols in their reference syntax.
    The statement ASSIGN f to <fs> assigns the field f to field
    symbol <fs>. The field symbol <fs> then "points" to the
    contents of field f at runtime. This means that all changes to the
    contents of f are visible in <fs> and vice versa. You declare
    the field symbol <fs> using the statement FIELD-SYMBOLS: <fs>.
    Reference syntax
    Programming languages such as PASCAL and C use a dereferencing symbol
    to indicate the difference between a reference and the object to which
    it refers; so PASCAL would use p^ for a pointer instead of p, C would
    use *p instead of p. ABAP does not have any such dereferencing symbol.
    **     In PASCAL or C, if you assign a pointer p1 to a pointer p2,
    you force p1 to point to the object to which p2 refers (reference semantics).
    **     In ABAP, if you assign a field symbol <fs1> to a field
    symbol <fs2>, <fs1> takes the value of the data object to
    which <fs2> refers (value semantics).
    **     Field symbols in ABAP are always dereferenced, that is,
    they always access the referenced data object. If you want to
    change the reference yourself in ABAP, you can use the ASSIGN statement
    to assign field symbol <fs1> to field symbol <fs2>.
    Using field symbols
    You declare field symbols using the FIELD-SYMBOLS statement.
    They may be declared either with or without a specific type.
    At runtime you assign a field to the field symbol using the ASSIGN
    statement. All of the operations on the field symbol act on the field
    assigned to it.
    When you assign a field to an untyped field symbol, the field symbol
    adopts the type of the field. If, on the other hand, you want to assign
    a field to a typed field symbol, the type of the field and that of the
    field symbol must be compatible.
    A field symbol can point to any data object and from Release 4.5A,
    they can also point to lines of internal tables.
    The brackets (<>) are part of the syntax.
    Use the expression <fs> IS ASSIGNED to find out whether the field
    symbol <fs> is assigned to a field.
    The statement UNASSIGN <fs> sets the field symbol <fs> so
    that it points to nothing. The logical expression <fs>
    IS ASSIGNED is then false. The corresponding negative expression
    is IF NOT <fs> IS ASSIGNED.
    An unassigned field symbol <fs> behaves as a constant with
    type C(1) and initial value SPACE.
    MOVE <fs>
    TO dest     Transfers the initial value SPACE to the variable dest
    MOVE 'A' to <fs>     
    Not possible, since <fs> is a constant
    (runtime error).
    To lift a type restriction, use the CASTING addition in the
    ASSIGN statement. The data object is then interpreted as though
    it had the data type of the field symbol. You can also do this
    with untyped field symbols using the CASTING TYPE <type> addition.
    The danger with pointers is that they may point to invalid areas.
    This danger is not so acute in ABAP, because the language does not
    use address arithmetic (for example, in other languages, pointer p
    might point to address 1024. After the statement p = p + 10, it would
    point to the address 1034). However, the danger does still exist, and
    memory protection violations lead to runtime errors.
    A pointer in ABAP may not point beyond a segment boundary. ABAP does
    not have one large address space, but rather a set of segments.
    Each of the following has its own segment:
    *     All global data
    *     All local data
    *     Each table work area (TABLES)
    *     Each COMMON PART
    You should only let field symbols move within an elementary field or
    structure where ABAP allows you to assign both within the global data
    and beyond a field boundary.
    Rgds
    Umakanth

  • Difference between Null in c and Null in Oracle

    Hi,
    Can any one tell me the difference between NULL in C language and NULL in Oracle
    Rds,
    Naga

    > Null is some garvage value in oracle.
    Not sure what you mean.
    AFAIK and not being a C programmer myself, isn't null CHR(0) in C? I'm not sure the two concepts (SQL null and C null) have anything in common.

  • What's difference between JPanel.remove(); and JPanel = null

    nice day,
    how can remove JPanel (including its JComponents), safe way, can you explain the difference between JPanel.remove () and JPanel = null,
    1/ because if JPanel does not contain any static JComponents
    2/ or any reference to static objects,
    then works as well as JPanel.remove or JPanel = null,
    or what and why preferred to avoid some action (to avoid to remove or to avoid to null)

    mKorbel wrote:
    nice day,
    how can remove JPanel (including its JComponents), safe way, can you explain the difference between JPanel.remove () and JPanel = null, Remove the JPanel from the container it was part of and make sure you do not keep any references to it from your own classes. Don't make it any more difficult than it has to be.

Maybe you are looking for

  • My Skype number is not the number presented when m...

    My Skype number is not the number presented when making outbound calls. My subscription had expired but I renewed a day later. My account shows that my Skype number is still active. What do i need to do?

  • Error handling in File content conversion

    In our project , we are converting Flat file to XML by adapter modules ... File is like this : HEADER 123 567 DETAIL UWERU AASD fftk DETAIL UWERU AASD fftk DETAIL UWERU AASD fftk DETAIL UWERU AASD fftk FOOTER File has been succesfully converted to XM

  • Help with loadmovie in Flash 8

    hi flashCoders, this code used to work fine in old versions but now doesn't work theres is the code: <--- _root.createEmptyMovieClip("fundo", 1); fundo.loadMovie("image3.jpg"); fotosArray = ["image1.jpg", "image3.jpg", "image7.jpg"]; function fotosRo

  • Writing data from PLC to XLS file

    I am trying to write data from a PLC to an XLS file, i can write data when its generated, but wheni read from a DataSocket i cant seem to write it to the XLS file... i have attached what i've done please let me know what you think... any corrections

  • Shockwave ready photogallery?

    Is there a nice ready photo gallery in shockwave which I can use for a website i am designing for a photographer? please advise. I am currently using java based photo gallery, however am not satisfied with the effects therein. the site's url is www.s