What is the difference of the temporary lob in plsql

Hi all

What is the difference of a temporary lob for plsql, I mean for ex what is the difference for these codes:

Declare
MyClob Clob.
X PLS_INTEGER;
Start
MyClob: = ' something clob operation ';
x: = DBMS_Lob.InStr (MyClob, 'lob');
end;
/


Declare
MyClob Clob.
X PLS_INTEGER;
Start
DBMS_Lob.CreateTemporary (MyClob, True);
MyClob: = ' something clob operation ';
x: = DBMS_Lob.InStr (MyClob, 'lob');
DBMS_Lob.FreeTemporary (MyClob);
end;
/

I know that temporary clob is stored in temporary tablespace, but in the first block of code above, what is the difference?
Thank you

What is the difference?

In this case, there is no difference, because the temporary lob is created' in silence ': the Temporary LOB performance guidelines:

»
If you use the recently improved SQL semantics functionality in your applications, then there are many more temporary LOBs created silently in the SQL and PL/SQL than before.
...
In particular, these temporary LOBs are created in silent mode when you use the following:

On the LOBs SQL functions
Functions of characters embedded PL/SQL on LOBs
VARCHAR2/RAW for CLOB/BLOB variable assignments, respectively.
Migrate from LONG-to-LOB
«

Things are different when the"silent" creation takes place, for example in.

SQL> declare
  2     myclob   clob;
  3     myclob2 clob;
  4  begin
  5     myclob := 'something clob operation';
  6     dbms_lob.append(myclob2, myclob);
  7  end;
  8  /
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 639
ORA-06512: at line 6

Then you can either use createtemporary procedure

SQL> declare
  2     myclob   clob;
  3     myclob2 clob;
  4  begin
  5     dbms_lob.createtemporary(myclob2,true);
  6     myclob := 'something clob operation';
  7     dbms_lob.append(myclob2, myclob);
  8  end;
  9  /

PL/SQL procedure successfully completed.

Or to force another initialization:

SQL> declare
  2     myclob   clob;
  3     myclob2 clob;
  4  begin
  5     myclob := 'something clob operation';
  6     myclob2 := trim(to_clob(' '));
  7     dbms_lob.append(myclob2, myclob);
  8  end;
  9  /

PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • What is the difference between the Derived work history and temporary table?

    Could someone enlighten? Thanks in advance!

    Derived from work sheet: used as variables, display calculated values on the page, etc. are not database records.
    Temporary table: used in AEP for parallel execution, based on treatment etc.

    Check out peopletools application (for the recording of derivative works) Designer and App engine books (for the temporary table).

  • What to fill in 'field of the temporary table' for global temporary tables?

    Hello

    I use the Data Modeler 4.0.1.836 and everything that I put in the box 'the scope of the table temp' for a global temporary table doesn't seem to affect the DDL script about the ON COMMIT PRESERVE/DELETE the LINES option. The script poster ON COMMIT PRESERVE ROWS always anything.

    Yet, some of my temporary tables must be created as ON COMMIT DELETE ROWS.

    Using the Data Modeler wrote about it:

    Scope of the temporary Table:

    For a class as a temporary table, you can specify a scope, such as the Dimension or the Session.

    Not sure what 'Dimension' has to do with the scope here, but it makes no difference.

    I tried to put 'Session', 'Dimension', 'Operation', but no luck. So what is the text for the script generate ON COMMIT DELETE ROWS?

    Thank you

    Hello

    The temporary Scope of Table property (on page Types of Classification of the table properties dialog box) is purely documentary.

    To set ON COMMIT DELETE ROWS you must expand the browser for the relational model and find the node for the relevant Oracle physical model.  If you develop it you will find an entry there for your Table. Double-click on that to get the physical model properties dialog box for your table, and you will find a "Temporary" facility that has options (Preserve Rows), YES (Delete Rows) YES or no.

    David

  • What is the difference?

    What is the difference between iOS iOS 10.0.1 and 10?

    My phone is updated to iOS 10.0.1

    jextie wrote:

    What is the difference between iOS iOS 10.0.1 and 10?

    My phone is updated to iOS 10.0.1

    None. 10.0.1 is the final version of iOS 10 right now.

  • What is the difference between a Apple Watch Series II and the Nike Apple Watch?

    I am interested in buying an Apple Watch, but I don't really understand what are the difference between the two.

    Hello

    Information about the models of series 2 Apple Watch (including Apple Watch Nike +) are available here:

    https://www.Apple.com/watch/

  • What is the difference between the channel strip and an insert?

    I'm confused a little, what's the difference?

    All (from top to bottom) is a channel strip, in the red zone are two insert (effect plugin) s.

  • What is the difference in processors for Macbook Air?

    I currently have a 2012 13-inch Macbook Pro. Its processor is 2.5 GHz Intel Core i5.

    I'm looking to get a new laptop, something more light, so I was watching the macbook air.

    What is the difference between getting 1.6 GHz dual-core Intel Core i5 and 2.2 GHz dual-core Intel Core i7? Other than the extra to upgrade $170. It is worth to pay that? I'm a student, so not really rolling in money.

    I'll just use it for the usual, surf the web for research and social media, spotify, itunes library, large library, some photo editing, imessage. I feel that that's what most people are doing, then what is the best for the average man?

    In addition, what is the significance in storage? I'm not sure what my mac pro has, but is it worth it to upgrade to the flash 512 GB PCle - based, storage or I couldn't stick with the 256 GB?

    Account of your not doing much with your mac in addition to what is its main purpose, I recommend save money for a processor and possibly buy more RAM (Random Access Memory) it helps with multitasking like surfing on the web.

    It also depends on the amount of memory you want. If your photos are of high quality and there are many, improved storage isn't bad.

  • iPhoto vs pictures what is the difference

    iPhoto vs pictures what is the difference?  My imac does not allowing me to connect with "Photos".  Photos can not find that the library system named "Library.photoslibrary Photos"

    Photos, this is the photo relatively new iPhoto App management has been the soft comes with iLife which was discontinued, although it still works very well. Where you see this error?

  • What is the difference between an icon of hard drive on my desktop and a home icon in the Finder?

    Hello

    I'm confused about the icon I have on my desk (hard drive) and a picture of a house in the Finder.  My iMac is divided between two discs?   What is the difference between these two, if any?

    the House is your account, which is located ON your hard disk, but it is NOT your hard drive.

  • Does conflict ghostery add-on, and what is the difference?

    I installed ghostery, but now Firefox tells me "add-on" is available. What is the difference and they will come into conflict?

    As far as I KNOW, Ghostery and Lightbeam match a little at work. What a difference I know that ghostery have some features integrated to block or whitelist of Web sites you visit.
    While lightbeam just likes to Watch supervisors and tell you graphically about third-party connections.
    so, if you use ghostery then it can useful for a faster loading Web sites because you block unusual food extracted from Web site, while lightbeam cannot do something with the site.

    Firefox is add-on cause reviews of >'s done it with our great
    developers, completely understand the part of the user experience.
    > because it is nothing to do with the Web sites, so a Web site owner perspective, you can display ads on your browser, without the authorization of changes external.
    Monitoring and privacy framework.
    Take a look at https://www.ghostery.com/en/ find out about Ghostery and Lightbeam is accessible via https://www.mozilla.org/en-US/lightbeam/ .

  • What is the difference between the Firefox for android and Firefox beta

    I noticed in the store of Google play there are two applications of Firefox. What is the center of the difference between the two Firefox browser for android and Firefox beta.

    Firefox for android is just the regular and stable browser that is recommended. Beta of Firefox for android is the next version of firefox that is in beta (test yet, but almost ready) step and is not ready for an official release because he has a few folds and fixes to do. But firefox for android beta has some of the features the most recent Firefox should be released soon as an official version.

    The current version of firefox for android is 34.01.
    The current version of firefox for android beta is 35.0.

  • What is the difference between the cookies keep until I close firefox and the history of cookie empty closing firefox?

    In the settings of Firefox 33.0 (I use Ubuntu 14.04, but the functionality is the same for Windows 7) there are two ways to delete cookies when firefox closes. Or at least, there seems to be.

    Is first the cookies keep until firefox is closed

    Second is to check the box for clear history of firefox closing and in the settings check cookies.

    What is the difference between these two options?

    I usually have two configuration but I noticed that a connection was not save for td canada trust EasyWeb, even though I have an exception set for it. Now I unchecked to remove cookies by disabling the history on close and connection records correctly.

    This connection allows to save 7 cookes under easyweb.td.com and 10 cookies under td.com and I have exceptions defined for both. If I clear the history when closing and include cookies, half of the td.com cookies disappeared when I close firefox and re - open. The same is true if I'm not the exception.

    So currently I can't find a way to keep all cookies if I clear the cookie history when firefox closes. What is the difference with this option?

    When you change the default cookie 'to life' of "keep until: they expire" to "keep until the: I close Firefox", Firefox changes all persistent cookies that sites set session cookies. To allow a site to place a persistent cookie, you need to make an exception (site permission).

    When you turn on the story to stop compensation and include cookies, running a completely separate process that doesn't doesn't pay attention to the duration of cookie or exceptions (permissions site). There just nukes all.

    Note that some cookies could survive if they are encoded in the history file of your session of compensation at the stop, a Firefox uses to restore your tabs and windows from last session. I have not tested.

  • What is the difference between id and apple itunes password

    What is the difference between an apple and a iTunes

    ID and how do I get a password manager to deal with them?

    They are usually the same thing

  • What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. Do I have to download these two files in the pictures folder is one duplicate of the other?

    What is the difference (if any) between iPhoto and iPhoto library? I managed to delete my pictures in freeing up space, but have a backup available. I need to restore these two files in the folder images or one is one duplicate of the other?

    I use a MacBook Air 2013 model with a backup on a WD MyBook Duo disc for storage wireless as the Apple Time Machine.

    The Photos and the iPhoto library are totally separated - neither one is connected to the other somehow--you want to restore the library you need

    LN

  • What is the difference between extensions and Plugins and Add-ons?

    I'm sorry if here is not the right place for this post.

    What is the difference between extensions and Plugins and Add-ons? Apparantely, they differ in some sense or aspect, but I do not know how. Please, if it is not too complicated, explain in detail and simple language. Thanks in advance to 1 million.

    Kind regards
    Danesh

    Hi Danesh,

    You should take a look at this article for an explanation. Plugins and extensions are essentially types of Add-ons as well as of the characters and themes.

    Hope this helps!

Maybe you are looking for