By the way Self as a parameter or by passing an object Variable to a member function, both in the approach IN OUT NOCOPY Mode which is better?

Hi all
Asking for help which approach is better of the two in terms of performance and why (if there is no difference) or are they an and they same and only different in terms of syntax only.

(A) to call a function with itself in passing as IN OUT nocopy
(B) passing the calling object, same as IN OUT NOCOPY.

@
(In my approach, I need to pass an object with almost 30 attributes and I must assign values to few attributes of the object in a few member functions that will impact object)

I have an object created in the
CREATE or REPLACE TYPE my_obj AS OBJECT
(
NAME VARCHAR2 (100),
FUNCTION CONSTRUCTOR My_obj RETURNS SELF AS RESULTS,
FUNCTION MEMBER put_name (SELF IN OUT NOCOPY my_obj) RETURN PLS_INTEGER,
RETURN of the MEMBER FUNCTION insert_name (v_my_obj IN OUT NOCOPY my_obj)
PLS_INTEGER,
MEMBER get_name PROCEDURE
);
/
CREATE OR REPLACE TYPE BODY MY_OBJ

FUNCTION CONSTRUCTOR RETURN self AS RESULT My_obj IS
BEGIN
NULL;
RETURN;
END;

FUNCTION MEMBER (SELF IN OUT NOCOPY my_obj) put_name IS BACK PLS_INTEGER
BEGIN
Self.Name: = "my_name_in_self";
RETURN 1;
END put_name;

MEMBER FUNCTION insert_name (v_my_obj IN OUT NOCOPY my_obj)
IS BACK PLS_INTEGER
BEGIN
v_my_obj. Name: = "my_name_in_Alias";
RETURN 1;
END insert_name;

MEMBER get_name PROCEDURE IS
BEGIN
dbms_output.put_line (self. (Name)
END;
END;
/

(a) put_name heel 1 call:

declare
v my_obj: = my_obj();
number of ret_val;
Start
ret_val: = v.put_name;
v.get_Name;
end;

o/p: my_name_in_self

(a) insert_name citing heel 2:

declare
v my_obj: = my_obj();
number of ret_val;
Start
ret_val: = v.insert_name (v);
v.get_Name;
end;

o/p: my_name_in_Alias

What is better to use the put_name or use the function insert_name.
I manipulate the object when it is passed to a function.

Thanks in advance,
Kind regards
Gaurav R

As Billy said above, each member method has implicitly (which can be made explicit, as with "put_name", when required, for example, to specify the "nocopy" option) parameter named 'home '. For member functions, the passage of default mode is "inside". For the procedures of members, the passage of default mode is "outside". Therefore, the actual signature of the function of your 'insert_name":

...
member function insert_name(self in my_obj, v_my_obj in out nocopy my_obj) return pls_integer
...

Since you don't self directly access this function, it is logically equivalent to a static type function (which has no implicit setting of "self"):

...
static function insert_name(v_my_obj in out nocopy my_obj) return pls_integer
...

which is basically no different than using a non-object function that takes a parameter of type of object:

create function insert_name(v_my_obj in out nocopy my_obj) return pls_integer

Gerard

Tags: Database

Similar Questions

  • Create the object type with a member function that returns an array of the object type

    Hello

    Is possible to compile code like this in Oracle SQL?

    CREATE OR REPLACE TYPE type_obj IS OBJECT (
      MEMBER FUNCTION f RETURN table_obj
    );
    
    CREATE OR REPLACE TYPE table_obj AS TABLE OF type_obj;
    
    

    In Java, it would be possible.

    Thanks in advance

    Circular dependencies must be resolved by means of REF pointers and incomplete type definition.

    See: Oracle objects management

    CREATE or REPLACE TYPE type_obj;

    /

    CREATE or REPLACE TYPE table_obj AS TABLE OF ref type_obj;

    /

    CREATE or REPLACE TYPE type_obj () IS OBJECT

    fake number

    Table_obj RETURN of the FUNCTION MEMBER f

    );

    /

    Now, it must implement the body of type.

    Note that a table of the REFs is not very useful in the plain of PL/SQL, the underlying data must be stored in a nested table if you want to use.

  • My pc is unable to load the program except in safe mode, which is a recent problem. Time must also be reset whenever I start. any suggestions

    At startup the program do not load beyond the xp logo and then a black screen. The only way to load is in safe mode. The clock needs daily update, is it connected?  I can't restore, but might do at the beginning, but not more. My antivirus is also disabled, it's because its in safe mode. Could all this be reduced to a battery of spleen?

    people suggestions.

    Hi Mike,.

    ·         You did changes to the computer before the show?

    Try the following.

    Method 1: Read the following article.

    After the Windows Logo appears or after you log in to Windows, a Windows XP computer cannot display the wallpaper, a black screen or a blue screen

    Method 2: Follow the steps in the article mentioned below.

    After the Windows Logo appears or after you log in to Windows, a Windows XP computer cannot display the wallpaper, a black screen or a blue screen

  • I'm having a holiday in Nha Trang, Viet Nam and my stolen obtained iphone6 10:00-22:30 last night, I activated lost mode which is still pending and said the local police. What should I do?

    I'm having a holiday in Nha Trang, Viet Nam and my iphone6 who was in my bag got stolen 10:00-22:30 last night while returning to the hotel, I activated lost mode which is still pending and said the local police. find my iPhone is in offline mode. What should I do? I read online that if I erase all my data can find that my iphone will be more capable. I also read online that the stolen iphone can be replaced? What should I do? I can't fnd an e-mail to contact apple Australia I did purchase in Sydney Australia.

    Please help me.

    There is nothing for you to do.

    What to do if your iDevice is lost or stolen

    iPhone, iPod Touch and iPad

    If enable you find my phone before it was lost or stolen, you can follow only if it is connected to the Internet by Wi - Fi or cellular. What you can't do, is follow your device using a serial number or other identification number. You can't wait for Apple or anyone else to find your device for you. You can't recover your loss unless you make your device for the loss. It is not covered by your warranty.

    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen, what do you do? There are things you should have done in advance - until you have lost it or it has been stolen - and things to do after the fact. Here are a few suggestions:

    This link, Re: help! I misplaced / lost my iPhone 5 today morning at delta Chelsea hotel downtown one I am not able to follow. Please help!, has some good advice about your options when your iDevice is lost or stolen.

    1. declaration of a lost or stolen Apple product

    2 find my lost iPod Touch

    3. AT & t. Sprint and Verizon can block phones stolen/tablets

    4. What-To-Do-When-Iphone-Is-Stolen

    5. use ICloud Mode lost

    6. what to do if your iOS device is lost or stolen

    7 6 ways to track and recover your lost/stolen iPhone

    8. find my iPhone

    9 report Stolen iPad | Stolen lost found online

    It pays to be proactive in following the advice on the use of find my phone before you lose your device:

    1. find my iPhone

    2 set up your iDevice oniCloud

    3. OS X Lion/Mountain Lion - in regard to my Mac

    4 the free configuration find your iPhone (even on unsupporteddevices)

  • Writable failing Volumes and Appstacks with "the device object parameter is not a valid object" at the launch of a .exe

    Previously, this error had been random between Appstacks and accessible volumes in writing, but became extremely coherent.   The full message is something like:

    C:\Program Files (x 86) \Mozilla Firefox\firefox.exe

    The device object parameter is not a valid object or is not attached to the volume specified by the file name.

    This accessible volume in writing will occur in a profile only (and UIA + profile) try to download and install the application, or what UIA only is only enabled when you try to run the installed applications.   It's almost as if the volume is not read/write permissions, but other information, such as the request for detailed information about the profiles are stored and used correctly.

    Running version 2.9

    Update - it seems that the question was of App - V Client being installed.

  • What is the real difference between the card and the ORDER of the member functions?

    Hi all

    According to the documentation http://docs.oracle.com/cd/B28359_01/appdev.111/b28371/adobjbas.htm#CHDFGJFB

    Control methods make comparisons of direct one-to-one object. Unlike the methods of the card, they cannot determine the agenda of a number of objects. They simply tell you that the current object is equal or less than the object that it is being compared, based on the criterion used.

    A method of control is a function of an object ( SELF ), with a declared parameter that is an object of the same type. The method should return a negative number, zero, or a positive number. This value means that the object (the implied no said SELF parameter) is less than, equal, or greater than the declared parameter object.

    I still can't find all the differences between them. Because the documentation said that makle methods to ORDER one to an object comparisons. However, you can also do it with the map member function the (as illustrated below). Can someone clarify this please?

    create rectangular type is object
    (
    number of width,
    number of height,
    Order member function camparison (r rectangular) return number
    );

    create or replace type rectangular body is
    order member function camparison (r rectangular)
    Return number
    is
    Start
    If (self.width + self.height) > (r.width and r.height) then
    Return 1;
    elsif (self.width + self.height) < (r.width and r.height) then
    Returns - 1;
    on the other
    return 0;
    end if;
    end;
    end;

    OR

    create or replace the rectangular type is object
    (
    number of width,
    number of height,
    card camparison return number of member function
    );

    create or replace type rectangular body is
    map member function camparison
    Return number


    is
    Start
    Return self.width + self.height;
    end;
    end;

    For the two I use the following block of code right? So, what is the difference?

    Set serveroutput on;
    declare
    rectangular rect1;
    rectangular rect2;
    Start

    rect1: rectangular = (3, 5);
    rect2: rectangular = (4, 8);

    If rect1 > rect2 then
    dbms_output.put_line ('rect1 Büyük');
    on the other
    dbms_output.put_line ('Büyük rect2');
    end if;

    end;

    My 2nd question is: in the function member order what is the parameter reference? When we compared how it corresponds to?

    camparison of Member (rectangular r) function order

    When comparing the two objects is the function parameter is the object of the comparison sign right?

    If rect1 > rect2 then

    Thanks in advance

    Order compare 2 objects.

    Card returns a value that can be used to control any number of objects.

  • The USB support in offline mode option does not work

    I just bought a new netbook NB100, version of ubuntu. The option to recharge an iPod via the USB port (even if the computer is on but is shutdown or standby extended) does not work. I saw that this problem was already recognized by a few critics of the product, i.e.:

    of apcmag.com:
    Yet all Toshibaa? s card promised USB 2.0 ports could load connected devices even while the netbook is off (as long as it remains connected to Acre, of course), it could not charge an iPod.

    I'm interested to know if there is a way to solve this problem. It is a unique option of Toshiba being mentioned nowhere in their product pages and in the guide.

    Best regards
    Tom

    You must set it in the BIOS (F2 at startup). I think it's under advanced in the BIOS menu. Choose Mode 1; If that doesn't work try Mode 2.

  • recover data after the update results in recovery mode

    Hello! I feel absolutely terrible and any help would be greatly appreciated. I have an old IPhone 4S that has been put into market and on himself. One of my friends told me to go to IoS9. Terrible mistake because it made my phone goes into recovery mode.

    I never did all backups on Icloud and on ITunes. Worse still, I never had ITunes in my life. (I am kind new to smartphones, this IPhone was given just for me)

    A friend of a friend has offered to help and I gave her my IPhone for a little more than 10 minutes. He has a Mac and said he could do something (legal or not, I have no idea). But then I realized that there are things really private in my IPhone that I would not want anyone other than me to see. So I asked him to stop whatever he was doing. The phone is still on the recovery mode when I got back, he had the phone for about 10-15 minutes, and I never gave him the passwords. My question is simple: would he able to access my data in any ways if he wanted to?

    I went to an Apple store and a saleswoman told me that there was no way he could have access to what in my phone as the phone was completely blocked / blocking. And then I'm going home and read things like Wondershare, on ways to get data without passwords and I completely panick on everything.  You have to be a complete genius this information?

    I guess I just need to be reassured. Thanks to you all.

    PS: I'm not English, I hope I have made myself understandable!

    If the phone goes into recovery mode, restore only on a new version of the iOS will be bring back to life.

    The password for the lock screen can't be changed if restore you to a computer that was used to put in place or to sync the phone in the past. Other computers cannot access the data on the phone, he's going to be wiped out during the installation procedure. If you never connected to a computer, the first time that you try to synchronize, the phone will be erased, over, synchronization, it will take the password of the lock screen to display on the phone.

  • Maybe it's to rewrite the BIOS with crisis recovery mode?

    Hey everybody,

    my laptop 'freezes' during BIOS 'PHOENIX' updated 2 years ago.
    SERVICE told to change the motherboard, the price as new pc, so I bought new laptop.

    I keep looking at the toshiba forum always, so I read a lot of information on the MODE of RECOVERY from CRISIS.
    so I tried to check my laptop died after 2 years.

    My satellite M100 starts in crisis recovery mode Fn + B.
    my laptop starts up to CRISIS MODE, but do not read the USB STICK
    I did the flash with the CRISDISK 1.0.0.4 USB key program, but I'm not sure I did it way right!

    My question is:
    is it really possible to REWRITE the bios with crisis recovery mode, where I can read more information on how to do it.

    I want back my M100 :)))

    Hey,.

    As Akuma writes that you should try a USB FDD instead a USB key. Key USB is supported only on new models of laptops, but as far as I know USB FDD will be always supported.

    In any case, just for your information: you should know what you're doing. It is a delicate and risky procedure and in the worst cases you might destroy the whole ROM module but if you already have a new laptop I think that it s a problem for you. ;)

  • Access to the elements of an array passed as object reference

    Hi all!

    I am quite new to TestStand and therefore, my question might be simple enough but I was not able to find the solution by looking at previous posts.

    I have a sequence that passes a custom array (of data type) to another to make basic on the table stuff (reverse the order of the elements, for example).

    I want to move to the sequence called an object table reference

    The problem is that I am not able to read the array element inside the sequence called using the object reference.

    I found the way get the number of items, but I'm not able to access the item

    In addition, the TestStand GUI is able to let me see the array pointed to by the object reference that is passed within the known sequence, so it is possible to access... but how?

    I want to do operations on the object reference passed within a 'No return' TestStand if possible.

    Thank you very much.

    Andrea

    In other words:

    How do I access the field 'temperatureTag' item number '0' from the object variable reference referenceToClone?

    Locals.referenceToClone [0] .temperatureTag does not work...

    I don't know what is the recommended method to solve your problem. When you try to few alternatives, I was able to get the value required by the following expression (tested with TestStand 2014):

    Locals.referenceToClone.GetPropertyObject("[0]",_0).temperatureTag

    Try and tell me if it works for you.

    Use this workaround with caution.

    -Shashidhar

  • Why the Sony A7 in M mode only-2 or + 2 in the light meter, not give up to the - 5 or + 5

    IM starting to expand my skills for photo shooting more and as much as I can using the Mr. I realized that the light meter will typically from-5 to + 5. During shooting in mode M, the indicator does move to the number of +-2 position, so between-2 and -5, + 2 or + 5 indicator disappears. Is it a setting or feature that I missed, seems to be a waste if I can't really control the complete appearance in M mode.

    Hi wesleyhall08,

    Welcome to the community of Sony!

    When shooting in M mode, the meter that you are related to the is the manual counter, which is located in the lower center of the screen between opening and ISO. This watch-2 or + 2 only and normally will blink to let you know if the picture you take is already underexpose or overexpose. He's not going to-5 or + 5 and it's normal.

    When shooting in other modes as a mode or S on the other hand, this light meter becomes exposure value. This means that you can change the exposure of the image by changing the value and it will-5 to + 5. Note that when you press the Fn key and change the value of exposure it allows you to move from-5 to + 5. But when the camera is set to M mode and you press the Fn key, notice that the EV is changed in MM and is grayed out choices. This means that you will meter the camera manually by adjusting the shutter speed and aperture. The MM or meter manual serves as a guide to whether the exhibition is balance, underexpose or overexpose when you use mode 0 M. you gives a balanced exposure, -1-2 gives you underexposed and + 2 + 1 gives you over-exposed image. + 2 flashes, this means that the image is overexposing way and if it flashes-2, it means that the images is much too dark.

    If my post answered your question, please mark it as "accept as a Solution.

    Thanks again and have a wonderful day.
    Zander

  • I can't install Service Pak 2 for Windows Vista. I received the error code 0 x 80070490, which has a link on the home page, but it is not working properly and it took me nowhere. Help!?

    Install Windows Vista Service Pak 2 upgrade

    I received the error code 0 x 80070490, which has a link on the home page, but it is not working properly and it took me nowhere.

    http://support.Microsoft.com/kb/958044

    You receive an error code "0 x 80070490" when you use Microsoft Update or Windows Update Web sites to install updates

    https://support.Microsoft.com/OAS/default.aspx?PRID=13014&Gprid=582034&St=1

    Free unlimited installation and compatibility support is available for Windows Vista, but only for Service Pack 2 (SP2). This support for SP2 is valid until February 26, 2010.

    It comes with Vista, upgrade install and activate Forum.

    You will get the best help for any problem of Update/Service Pack update Vista Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • NEED HELP WITH SERVICE PACK 3. After downloading and the computer goes into rebooting mode I get the screen to restart with three options, network security safe mode and the other thing. ,

    NEED HELP WITH SERVICE PACK 3.  After downloading and the computer goes into rebooting mode I get the screen to restart with three options, network security safe mode and the other thing. , but it of although he gets, he keeps countdown to restart and reboots and restarts, over and over again, never reboots, same screen. my computer won't let me out this screen even after I turned off the computer and turn it back on, I get the same screen. the only way I can get out of this is to erase my computer everything and bring it back to factory, right out of the box, this big headaches. Thanks for anyone who can help me. PS. Keep the answers in simple terms please.

    Hi BSRC$, in stock

    1. You have security software installed on the computer?
    2. You receive an error message when you restart the computer?

    Reinstalling Windows XP to the factory setting would not be the first option.

    It is possible that some third-party programs or the services installed on the computer interfere with the installation of service pack 3.

    I suggest that you try to uninstall service pack 3 from the computer by using the recovery console and subsequently ask the article below for what to do before installing the service pack 3on the computer.

    How to remove Windows XP Service Pack 3 from your computer

    http://support.Microsoft.com/kb/950249

    Steps to take before you install Windows XP Service Pack 3

    http://support.Microsoft.com/kb/950717

  • Which is better: using the NI 9203 or USB Volt to differential entrance map

    Dear all,

    I have 4 pressure transmitters, temperature transmitters 4 with output 0-10 v or 4-20 my. I have also 2 with output 4-20 flow meters my.

    I have two options:

    Is to get all the signals in my and link them to the C two modules NI 9203 or I can get 8 sensors with 0-10 V and then I can use for example NI 6218 where I can connect these signals using differential configuration. While the last two signals (of the two flowmeters) should be converted using components SSC to sell volts so that I can connect them to the same card.

    Which solution is better in regards to signal noise?

    Someone told me that NI 9203 does not support differential configuration, such as the signal of my does not noise like the Volt signal so it does no differential configuration.

    Also, NI 9203 has 0-20 my input range and the output of the sensors is 4-20 my... Is there a problem?

    Please advise...

    Yours,

    Ehab

    Hi Elijah,

    Do you mean that you have the choice between voltage and current transducers and want to know what is the best?

    Current loop 4-20 mA is intrinsically less sensitive to voltage noise.  4-20 my sources have an output impedance much higher that a shunt resistance, so that the vast majority of the noise is deleted in all of the source.  The following application note of the BAPI and our own Developer Zone article both give a good overview of the subject:

    Understand the current loops 4-20 my

    Current measurements: practical Guide

    Regarding the 0-20 mA or 4-20 mA, you will have no problem here.  4-20 mA is commonly used for sensors one reasons are that a 0 can be used to indicate a bad connection (open).

    When you take a measure of the tension, the best way to reduce noise is to measure differently, with your connections made with threads of the shielded twisted pair (Wikipedia link).  The idea here is that any atmospheric noise would affect both the + and - ends of your signal.  Since you measure differently, the noise cancel out.

    You will be probably very well in both cases.  If you use the 6218, you can provide your own external shunt resistors to measure the current, while using other channels to measure the voltage. See the article How to build a system of loop current with isolated M series.  It seems to not be updated for the 6218, but this Council provides isolation recommended for current measurement.

    The 9203 s have this integrated to the Board of Directors and are designed specifically to the measurement current.

    Other recommended reading would be field of wiring and considerations of noise for analog signals.  When setting up this system, you will need to make sure that everything is grounded correctly (without ground-loops, floating connections, etc.).

    -John

  • Won´t work of the detonators (connect) in MTP mode / winamp disorder

    Edit: re-installed winamp and tadaaa: recognized mtp device. BUT: as soon as winamp has loaded, it crashes. Winamp simply closed, no error message, nothing. PLEASE, I BEG YOU! Any program to manage the * beep * playlists! (any prog that doesn´t just crash)

    I tried to connect in MSC and that works perfectly, but almost all of my stuff is saved in MTP mode via mediaplayer (which is exactly what will not work) and I want at least to remove. The player is revision 1, firmware version V01.02.26E and I am trying to use it under XPsp2. I have tried several mediaplayers, same result: will not work. Is it possible to control less and access the files saved in MTP mode with ANY program? Reverend last firmware enabled to use normal folders as you now so no need overall of the PSG-crap anyway. OK, I was able to just cables it and be done with it, but then the data I want to keep is also party. Please tell me West a way to solve this problem without putting in the shape of the cursed thing. Once again: if I switch to MTP and just plug it in NOTHING happens. Winamp simply said: no portable device connected.

    FOUND a SOLUTION! WMP10 is the way. (or at least now it works) I installed WMP10, then is gone to the materiel management where he showed the "rocket" with a yellow questionmark, right click, reinstall the driver, search online and go. He found something online, installed and my winamp trotted. Can I change all the stuff normally. Looks like it s only the WMP11 DURATION as f * s autour in the background. Here´s what you need to do: ditch WMP11 and WMP11 runtime via management software (if that damn profane your hard drive), drivers for PSG in the management of the gap material, get and install WMP10, then go to hardware management and would search for drivers online. Install these drivers, start winamp and you need is winamp with the support of the PSG. HA, I m proud of me.

Maybe you are looking for