Question about oracle objects

Hi people

I came across the below example on the oracle documentation.

I'm not quite sure why "emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and" ""emp is NULL #3"isn't even after printing has been assigned to the object with a NULL value."

Can one of you you please explain about it. or give the overview of the conditions of the NULLable object. Thank you!!

DECLARE

EMP employee_typ; -emp is atomically null

BEGIN

If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #1"); END IF;

IF emp.employee_id IS NULL THEN

DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #1");

END IF;

EMP.employee_id: = 330;

If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #2"); END IF;

IF emp.employee_id IS NULL THEN

DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #2");

END IF;

EMP: = employee_typ (NULL, NULL, NULL, NULL,

NULL, NULL, NULL, NULL, NULL, NULL, NULL,

address_typ (NULL, NULL, NULL, NULL));

-emp: = NULL; -It would have made the following statement of the TRUE IF

If emp IS NOTHING THEN DBMS_OUTPUT. Put_line ("emp is NULL #3"); END IF;

IF emp.employee_id IS NULL THEN

DBMS_OUTPUT. Put_line ("emp.employee_id is NULL #3");

END IF;

EXCEPTION

WHEN ACCESS_INTO_NULL THEN

DBMS_OUTPUT. Put_line ('impossible to assign object NULL value');

END;

/

The result is:


EMP is NULL #1
EMP.employee_id is NULL #1
EMP is NULL #2
EMP.employee_id is NULL #3

I came across the below example on the oracle documentation.

I'm not very sure why 'emp is NULL #2' always get printed even if the Member attribute is assigned a value that should be non-NULL and ' emp is NULL #3 "is not get printed even though the object is assigned to null."

Can one of you you please explain about it. or give the overview of the conditions of the NULLable object.

Have you actually tried this example? Why not?

The best and often faster, learn is to DO - not just read.

If you tried this example, you would see that you have been "bitten" by a documentation bug.

EMP.employee_id: = 330;

That the line of code won't work - it will trigger an exception is the output you get really

PEM is NULL #1

EMP.employee_id is NULL #1

Can't assign value to the NULL object

PL/SQL procedure successfully completed.

SQL >

The 'emp' instance has the value NULL as shows it the first message. If you cannot assign the 330 value him.

For others, the example seems to be the Oracle documentation

http://docs.Oracle.com/CD/B19306_01/AppDev.102/b14261/objects.htm#CIHEJIBA

Tags: Database

Similar Questions

  • Question about Oracle sequences

    Please let me know if this question is not the subject of this forum and advise which forum I should post it. Thank you.

    We have a database 10g running on the AIX servers. A process of data loading was recently, and the development team is of the opinion that the question can be corrupted in the database sequence. This sequence is used to generate a unique primary key for writing in a table.

    Are there problems with 10g about the objects sequence database becomes corrupted? If so, is there a Metalink note published on a fix?

    Thank you all for a light on this topic.

    Hello

    Interview the max value of your column of tabale, in order to know the populeted of the maximum value of the sequence, compare it your currval in the sequence, and the maximum value for the column. If the values are not the same and the currval is lower than the max value, you will probably have the constraint violation, then increment the value of your sequence curr.

    Concerning

  • Question about Oracle schema E/R database dictionary

    Hello

    As we know, the dictionary in an Oracle database is a fairly large beast. I was wondering if there was an ERD of the tables/views most commonly used or available useful. That would make familiar you with the dictionary quite a little easier.

    I've been Googling for such a scheme, but without success.

    The question is: does anyone know where such a diagram might be available? If Yes, where?

    Thank you for your help,

    John.

    Are you talking about view DBA_xxx (DBA_TABLES, DBA_USERS, etc.) or V$? If you're talkink about DBA_xxx views, please google with "poster oracle dictionary '..."

    Edited by: P. Forstmann on Sept. 5. 2010 18:57

  • Question about l ' object net.rim.device.api.ui.Screen

    Hello world

    I have a class that accepts an object of type "Screen" (net.rim.device.api.ui.Screen) in its constructor. When I instantiate this class, I include a class that extends the screen as a parameter. For example:

    public ClassA extends MainScreen {
         public void tester(){
              ClassB classB = new ClassB(this);
         }
              public void sampleMethod(){        ...     }}
    
    public ClassB {
    
         Screen screen;
    
         public ClassB(Screen screen) {
              this.screen = screen;
         }
         public doStuff(){          screen.sampleMethod();     }}
    

    My problem is that ClassB calls methods that are placed, but unless I change type "Screen" in the "class A", I receive the error: "the sampleMethod() method is not defined for the type of screen.

    How can I me ClassB to accept different classes that extend screen?

    Thank you!

    "each screen implements a SampleMethod() interface.

    Then could ClassB looks like this?

    public ClassB {}

    SampleMethodInterface screen;

    public ClassB (form SampleMethodInterface) {}
    This.screen = screen;
    }

    public doStuff() {}
    screen.sampleMethod ();
    }
    }

  • Technical questions about Oracle Linux

    What is the ideal RAM should I assign to my virtual machine to run Oracle 12 c for personal use.

    Personal use - convenient, cloning, backup of the database. Recovery of database of .dbf file. Sqldeveloper execution. Thanks in advance.

    I did it with 2 GB of RAM dedicated to the virtual machine. If you host only has 4 GB of RAM, so you may not be able to run many other in the VM host upward.

    That being said, I have usually at least 8 GB of RAM on my laptop work/computers positions of our days, if not more. With 8GB, I can create a 4 GB VM and have a better experience.

    See you soon,.
    Brian

  • Questions about oracle advanced concepts

    All,

    Database version: 11.2.0.3

    How can we identify if my database using GG (Golden Gate), ADG (Active Data Guard), TDE (Transparent Data Encryption), advanced security option?

    Are there tables to display these details?

    Thank you

    A lot of information characteristic use is available in the http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_3181.htm#I1023396 views DBA_FEATURE_USAGE_STATISTICS
    Some features are available, but require to pay for a license if you use them, so check with your DBA before being the first to use one, or it could cost a lot of money.
    Same V$ OPTION lists the options that are installed, but they could not be approved.

    Oracle Enterprise Manager displays DBA_FEATURE_USAGE_STATISTICS information on the server 'Use of database feature see' page.

    For example
    Select Name, version, Detected_usages of DBA_FEATURE_USAGE_STATISTICS

    where upper(name) like '%GOLDEN%' or upper(name) like '%ACTIVE%'
    or upper(name) like '%TRANSPARENT DATA%' or upper(name) like '%SECURITY%'
    
    NAME                                                             VERSION           DETECTED_USAGES
    ---------------------------------------------------------------- ----------------- ---------------
    Active Data Guard - Real-Time Query on Physical Standby          11.2.0.3.0                      0
    GoldenGate                                                       11.2.0.3.0                      0
    Transparent Gateway                                              11.2.0.3.0                      0
    Transparent Data Encryption                                      11.2.0.3.0                      0
    Label Security                                                   11.2.0.3.0                      0
    
    select parameter, value from v$option
    where upper(parameter) like '%GOLDEN%' or upper(parameter) like '%ACTIVE%'
    or upper(parameter) like '%TRANSPARENT DATA%' or upper(parameter) like '%SECURITY%';
    
    PARAMETER                                                        VALUE
    ---------------------------------------------------------------- ----------------------------------------------------------------
    Enterprise User Security                                         TRUE
    Oracle Label Security                                            FALSE
    Transparent Data Encryption                                      TRUE
    Active Data Guard                                                TRUE
    

    Do not trust with value = TRUE in the parameter $ v as meaning that you can use a feature - you might not be allowed - but if it's WRONG you certainly cannot.

  • Question about oracle.jbo.Row

    Hi all!
    I have a ResultSet (for example ResultSet rs) with the result of a query. Now, I need fill out a line of ResultSet data line object (for example line rw).
    I've invoked rs.next () method, but how can I assign these values to the rw?
    Thank you for your time and your answers.
    JDeveloper version 11.1.2.2.0

    Best regards, Stanislav

    Stanislav,

    Why do you want to get the data into a line object, if you do not have a VO? That is to say, what you're going to do with the line object that you build from the updated result? Can you explain your usecase?

    Arun-

  • Question about Oracle identity analytics

    Hello

    Is it possible in Oracle identity analytics (version 11.1.1.3.0) to compare the datas in OIA and data in LDAP for example?

    The goal is to see the differences between this 2 databases for roles and strategies.

    If possible, can you tell me how to make that comparison?

    Thanks for your help...

    I think not - OIA with no agents / connectors. What you can be able to model the data in the LDAP protocol as a resource in OIA and run a report against that?

  • Question about clicking object behind a mask effect

    First of all, sorry for the title of indescriptive, couldn't really think of anything.

    Okay, so I want an effect to my Flash project. Basically, I have a black background and a simple mask effect that follows the mouse, if you move the mouse and it shows you the layer behind the black background... The script looks like this:

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void

    {

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    And it works very well, but it's not all that I intend to do. In short, the user must move the mask using the mouse and find several colorful objects hidden behind it (it works very well), so I want to do all the clickable object and I want the object to change forms when they are clicked on. I'm pretty new to Flash, but I fiddled around with it and could not get to a solution that worked.

    I tried labeling different frames on the timeline. "color1", "Color2" and then by a

    color_mc.Color1.buttonMode = true

    color_mc.Color1.addEventListener (MouseEvent.CLICK, COLOR1);

    function {(e:MouseEvent) COLOR1}

    gotoAndPlay ("color1");

    }

    So go to this image, but this probably isn't the right way to do it, because the mask effect no longer works (I even tried to copy the action on the framework "color1" script), and I think that if you had clicked on the "color1" first object, and then the "Color2" object after

    I think that he would turn the "color1" action (but I'm not sure)

    * Note * color_mc is the background with objects on I want clickable and objects are called "color1", "Color2" etc.

    Oh and one thing I would also like to recognize when all objects are clicked and then move on to a new frame/scene.

    Sorry, if I could not explain it correctly; as I said I'm not experienced in Flash and I would be really grateful if someone could help me. If there is anything you want to know or if you want to see my flash file, let me know.

    use:

    Import fl.transitions.Tween;

    Import fl.transitions.easing.None;

    color_mc. Mask = mask_mc;

    mask_mc.cacheAsBitmap = true;

    color_mc.cacheAsBitmap = true;

    mask_mc.addEventListener (Event.ENTER_FRAME, moveMask);

    function moveMask(e:Event):void {}

    mask_mc.x = mouseX;

    mask_mc.y = mouseY;

    }

    var t1:Tween;

    var t2:Tween;

    var colorNum:int = 5;

    var numClicked:int = 0;

    for (var i: int = 1; i<>

    color_mc ['color' + i] .buttonMode = true;

    color_mc ["Color" + i] .addEventListener (MouseEvent.Click, tweenF);

    }

    function tweenF(e:MouseEvent):void {}

    T1 = new Tween(e.currentTarget,"scaleX",None.easeNone,1,1.5,.5,true);

    T2 = new Tween(e.currentTarget,"scaleY",None.easeNone,1,1.5,.5,true);

    e.currentTarget.mouseEnabled = false;

    addChild (MovieClip (e.currentTarget));

    e.currentTarget.x += color_mc.x;

    e.currentTarget.y += color_mc.y;

    numClicked ++;

    {if(numClicked==colorNum)}

    Stop ("framework");

    }

    }

  • Question about the object

    public class Testing{
    public void status(Object d){
    System.out.println("object is called " + d);
    }
    
    public  void status(String s){
    System.out.println("String is called " + s);
    }
    
    public static void main(String[] args){
    Testing a = new Testing();
    a.status(null);
    }
    }
    Output : String is called null

    No doubt: I can't understand how including compiler to call status method with the String argument and not the one with the Object.Even argument if he did then why NullPointerException was not thrown during execution, since printing System.out.println ("the string is called" + s), it will call the method toString() on s and since it is null it should throw a NullPointerException.

    Any clarification on this is much appreciated.

    isocdev_mb wrote:
    I'm not clear on the method resolution (perhaps something on the more specific signature)

    NULL is considered as to be more precise in the hierarchy, so if you have overloaded methods where first one takes object, the second takes Foo (a subclass of object) and third takes the Bar (subclass of Foo), then one with the setting Bar would be called.

    But if you have a parameter Object and two methods with the subclasses of object as parameters, you will get a compilation error because specific to one can not be chosen.

    does not imply an invocation of toString(). s is a string already

    Nothing implies a call toString(). The method that is called is String.valueOf (param Object), which returns "null" when given null. No NPE, no problem.

  • A question about script objects

    I placed a script object in my form to control the color of the field and it works very well in Adobe Reader X but not in earlier versions of the reader and not in Acrobat pro 9.

    Can someone tell me what is the problem?

    The script object looks like this:

    form1. #variables [0]. RGA_format - (JavaScript, client)

    function RGA_colorOld()

    xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = '220,220,220';

    function RGA_color()

    xfa.resolveNode("this.ui.#textEdit.border.fill.color").value = "255,255,255";

    And name fields on the docReady event and the event of modification of this script:

    Form1.blanketB.moder.EftNvnMor::docReady - (JavaScript, client)

    RGA_format. RGA_colorOld (the);

    Form1.blanketB.moder.EftNvnMor::change - (JavaScript, client)

    RGA_format. RGA_color (the);

    Kind regards

    Kirstine

    Hi Kirstine,

    When you call the function, you pass through the object as a parameter. However the function in the script object doesn't have a setting to receive this.

    You can probably get through the object as a reference:

    RGA_format.RGA_color(this);
    

    However I prefer to declare a variable first and pass through:

    var fieldObj = this.somExpression; // declare a variable to be passed into the function
    colourControls.fieldGetsFocus(fieldObj); // calls the function "fieldGetsFocus" in the script object "colourControls"
    

    Notice in the example, I have, when you declare the function, I have a 'fieldObj' parameter, to receive the information that is passed through.

    function fieldGetsFocus(fieldObj) // first function
    {
         ...
    }
    

    A small point on the function in the script object. I know that the function is a single line, but I'd rather see this wrapped in braces.

    Finally changing the fill requires access to the properties of the user interface. They are different for each type of object. For example, the script that you have is for a textfield. This does not work on a numericfield.

    I have an example here of a function that does what you are looking for: https://acrobat.com/#d=XGj9UEk4lSbDSoArnQU8dQ. Note how to check what is the object and then resolve the correct ui property. What makes the more reusable must function.

    Hope that helps,

    Niall

    Ensure the dynamics

  • question about an object in java

    If I have
    1.class Fizz { 
    2.    int x = 5;
    3.    public static void main(String[] args) {       
    4.        Fizz f2 = new Fizz(); 
    5.        System.out.println("f2 is " + f2);    
    6.    }
    After printing, the result is
    f2 is Fizz@3e25a5
    Should it be
    f2 is Null
    My logic is when line 4 is executed, the manufacturer (super) will be invoked and it initialize f2 with a NULL value. If my logic is not sacred, correct me please. Thank you.

    The Java API for the toString method:

     The toString method for class Object returns a string consisting of the name
    of the class of which the object is an instance, the at-sign character `@',
    and the unsigned hexadecimal representation of the hash code of the object.
    In other words, this method returns a string equal to the value of:
    
         getClass().getName() + '@' + Integer.toHexString(hashCode())
         
    

    Published by: Darryl Burke - divide a long line within the tags of code in 4 lines

  • Question about converting objects in number

    This may sound a little silly, but I have a function that converts an object into a number and then checks if it is NaN to make sure that it is indeed a number, it returns true if it is a valid number, or false if it is not a number

    Now I have a TextInput and when I type for example 'HELLO' and call the function will return false (since it is not a number), if I type 23 it returns true (it is a number), if I hit 20 'a', it returns false. Everything works well except for a combination, if I type any number and the letter 'e', for example, 2nd, 9th, 5th, etc., it returns true, which means that it is a valid why number, is it?

    You can validate the number against a regular expression:

    /\d+(\.\d*)?/

    I think I have this right,
    Tim

  • question about Oracle answers / Business Model

    Hello

    In a table of 'Projects', one of the attributes is work_time.
    I need to create a report in similar responses with a bellows:

    Working time | County
    1 - 10 days | 10
    11-20 days | 100
    ...................

    Can it be fixed when creating the repository? Or in the answers?
    I can solve it side DB, but maybe there is a way to do in BI...

    Thank you!

    Hello

    You can use

    cast(truncate(("Projects.work_time"-1)/10,0) * 10 as char) || ' - ' || cast(truncate(("Projects.work_time"+9)/10,0) * 10 as char) || ' days'
    

    Concerning
    Nicolae

  • Question about Oracle Query Builder

    Hi all

    I'm under Query Builder Version 6.0.7.1.0 to execute a SQL statement. He returned 19200 lines. When I try to export data in the CSV file, it exports only 19000 lines and gives the following error:

    OBE-15502: can have only 19000 lines per document

    Anyone know the cause of the error above? This is a limitation of the export of the query designer or I have some problems of configuration?

    Thank you
    Zahid

    I know the 16000 (not 19000) limit and this limit is coded hard and cannot be changed.

    Werner

Maybe you are looking for

  • control labview through labview application.

    Hello guys, I was wondering if I can do what the title says, let me explain, I have only (executable) Labview application on my PC, I don't have the source code for this application, I take this opportunity to test the signals from some analog cards.

  • Example: Pavilion dv 6500: Coprozessor for dv6513eg Win10

    I'm looking for a driver coprozessor? To win 8 or 10-64 bit HP Pavilion dv 6500 (dv 6513eg) Is it possible to fix this? Who can help me? cordially chris

  • Why the system error memory dump files create everytime in vista

    Why the system error memory dump files create everytime in vista Please help me find

  • My laptop do not restart or reboot

    Salvation; When I restart my Latitude E4300 (after the release of Windows asking the reboot or Windows Update requires a reboot) the power button flashes power intermittently as if she tries to restart. However, have the charger disconnected and reco

  • New application on top of the CRS

    Hi all!I installed ATG and CRS 10.0.2 using cim tool. He set up the ATGProduction and ATGPublishing under Jboss servers.Now, I create a new web application on top of the CRS.I copied CommerceReferenceStore to ATG_HOME % store module and changed all t