How to lock a row containing a LOB value?

I use a process called "lob_replace":

CREATE OR REPLACE
PROCEDURE lob_replace
(
p_lob IN OUT CLOB,
p_what IN VARCHAR2,
p_with IN VARCHAR2)
AS
n NUMBER.
BEGIN
n: = dbms_lob.instr (p_lob, p_what);
IF (NVL (n, 0) & gt; 0) THEN
DBMS_LOB. Copy (p_lob, p_lob, dbms_lob.getlength (p_lob), n-LENGTH (p_with), n-LENGTH (p_what));
DBMS_LOB. Write (p_lob, (p_with) LENGTH, n, p_with);
IF (LENGTH (p_what) & gt; Length (p_with)) THEN
DBMS_LOB. Trim (p_lob, dbms_lob.getlength (p_lob)-((p_what)-(p_with) LENGTH LENGTH));
END IF;
END IF;
END;
/

I'm testing this procedure:

DECLARE
a_lob CLOB.
CURSOR my_cur
IS
SELECT b.data
OF h_content_mgt m.
h_articlemgr am,
h_clob b
WHERE m.menu_id = 1915
AND m.type = 1
AND $m.name = 'WWWSITE_CORPCITIZEN_OVERVIEW_HTML. '
AND am.id = m.content_id
AND b.id = am.clob_id;
BEGIN
OPEN my_cur.
SEEK my_cur INTO a_lob;

lob_replace (a_lob, 'Hello', 'Goodbye');
CLOSE My_cur;
END;
/

Each time, I get the following results:

Error report:
ORA-22920: the row containing the LOB value is not locked
ORA-06512: at "SYS." DBMS_LOB", line 429
ORA-06512: at "T_DB. LOB_REPLACE', line 11
ORA-06512: at line 18 level
22920 00000 - "the row containing the LOB value is not locked.
* Cause: The row containing the LOB value must be locked before updating the LOB value.
* Action: Lock the row containing the LOB value before updating the LOB value.

I'm new to PL\SQL and I use the book by Feuerstein Oracle PL/SQL Programming . How to lock a row containing a LOB value?

Try this

Specify the clause
in select it.
UPDATE

CURSOR toys_cur IS
   SELECT name, manufacturer, preference_level, sell_at_yardsale_flag
     FROM my_sons_collection
    WHERE hours_used = 0
      FOR UPDATE;

Published by: alvinder on March 5, 2009 10:12

Tags: Database

Similar Questions

  • How to check the slider back row contains data or not

    Hi all


    How to check whether or not the cursor returned row contains data in one of its field.


    Thank you and best regards,
    Prakash P

    Use ROWCOUNT %
    Use % NOTFOUND

    example of

    DECLARE
    
       id    number;
       desc varchar2(10);
       CURSOR cursor_one IS
          SELECT
              id, desc
          FROM
              table;
    BEGIN
       OPEN cursor_one;
       LOOP
          FETCH cursor_one INTO id, desc;
          EXIT WHEN cursor_one%ROWCOUNT > 20 OR cursor_one%NOTFOUND;
       ...
       END LOOP;
       CLOSE cursor_one;
    END;
    
  • In XP, how to lock icons in folders so that they don't get mixed with each opening. I have subfolders in alphabetical order and you want to keep it this way.

    In XP, how to lock icons in folders so that they don't get mixed with each opening. I have subfolders in alphabetical order and you want to keep it this way.

    Hello

    I suggest you to see link below and check if it helps.

    How to arrange files using folder views in Windows XP: http://support.Microsoft.com/kb/306554

    For your reference: Changes in the size, the view, the icon or the position of a file are lost. http://support.Microsoft.com/kb/813711#top

    Registry warning:
    Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
    How to back up and restore the registry in Windows: http://support.microsoft.com/kb/322756

    Hope this information is useful.

  • How to lock my SIM card on an iPhone 5s, to prevent the use if lost or stolen?

    How to lock my SIM card on an iPhone 5s, to prevent its use if lost or stolen?

    Contact your carrier and see if they offer this service.

    It would be their service, not Apple

  • How to lock apps in iphone5s

    How to lock applications like whatsapp, facebook, gmail in iphone 5 s

    You cannot lock an application unless the application developer provides a way of. None of the apps you mention have this ability.

  • How to LOCK the search bar?

    Does anyone know how to lock the search bar so that it does not disappear whenever I press CTRL-F?

    Also any ideas on how I can get it to stop auto skin to the top of the page, or at the very least, a "ding", after reaching the bottom of the page?

    Thank you

    Hello Chaosdruid, This is the correct behavior, ctrl + f to open the search bar, try Firefox Safe Mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that disables some settings and disables most Add-ons (extensions and themes).

    (If you are using an additional theme, place you in default theme.)

    If Firefox is open, you can restart in Mode without failure of Firefox in the Help menu by clicking on the restart with the disabled... modules menu item:

    If Firefox is not running, you can start Firefox in Mode safe mode as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. Please follow the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    Thank you

  • How to lock v11.0 Mac preferences

    How to lock the proxy settings in v11.0 running Mac OS 10.7.3

    You must create a mozilla.cfg file in the installation of Firefox, folder as is Windows.

    Place a local file - settings.js in the folder by default/pref where you will also find the channel - prefs.js to specify using mozilla.cfg file.

    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    

    You can use these functions in mozilla.cfg:

    defaultPref();  // set new default value
    pref();         // set pref, but allow changes in current session
    lockPref();     // lock pref, disallow changes
    

    See also:

  • How to lock Notes with the new iOS 9.3?

    I could go into the settings and set a password, but I can't understand how to lock notes. Any thoughts?

    See here: keep your notes safe with password-protection - Apple Support

    -AJ

  • How to lock and unclock key FN?

    Hi, I have a laptop HP Pavilian DV7, and I wanted to know how to lock the function key. I saw in other websites that say just keep it pressed, press fn + NumLock, fn + F11 and fn + scroll, but none of those who work for me. Can someone help me please?

    lock the key Fn in the sense you use the function keys (F1, F2, F3...) + FN key combinations without using the FN key then the simple way of locking of the fn's boot in the bios by using the F10 key at startup which is used on most computers laptops hp, then in the bios screen select the option configuration. under the system configuration, you will find something like mode of action keys and make it active and then save the changes and exit the bios screen. hope that the problem will be solved on restart for unlock get in the bios screen and disable the action mode keys.

  • How to lock my iPhone 6's screen so it does not move between portrait and landscape?

    How to lock my iPhone 6's screen so it does not move between portrait and landscape?

    Select portrait orientation lock.

    Swipe the top of your home screen to access the control center and select the icon with a lock and an arc around him.

  • Satellite C660-15R: how to lock the size of text to stop it to increase.

    Satellite C660-15R

    How to lock text size to prevent increase/decrease at will.
    I can use him reduce / increase the installation when it happens, but it cannot remain stable.

    Beginner as a whole!

    Hello

    What text and what application do you mean exactly?
    For example, the content of the Web browser (internet explore) can be changed by pressing the CTRL key and moving the wheel of the mouse up and down.
    You can also go to display and set the Zoom to 100%

    To be honest, this can be locked

  • How to lock the front panel?

    Hello

    I know how to remove a text box scroll bar, but how to lock a VI scroll bar in order to have loaded the same way whenever it is called?

    Thank you

    Rafi

    Hi Pnt and thank you...

    Yes it works.  But how I put in place again once I have it removed?

    Thank you

  • How can I individual files contained in a llb file md5 sum?

    How can I individual files contained in a llb file md5 sum?

    I'll assume you know how to get the value of MD5. If it isn't... http://forums.NI.com/T5/LabVIEW/MD5/m-p/1067558

    The LLB acts as a container. So, you will need to extract the files of the LLB and save them as individual files, so that you can calculate the MD5 checkusm for each file. LabVIEW is a built-in LLB Manager which can be used to convert a LAW degree to a directory of files.

    Note: If you use the LLB to store your screws during development, it is a BAD idea (control of source code, a file corruption problems corrupts all LLB, nightmare of development distributed, etc...). LLBs must be used for the distribution of the code, and if you need a MD5 for that, you could just provide the MD5 for the Bachelor of LAW, rather than the MD5 for each file.

  • How to lock programs pinned to desktop

    How to lock programs pinned to the start menu?  I arranged programs pinned in a specific order, so I could find them easily.  Lately, whenever I start the computer, all the icons are aligned along the left side of the screen in a different order.

    Check the type of settings under display settings.

  • How to lock and unlock the computer in windows XP

    How to lock and unlock a computer with XP?

    Need to know today.

    Thank you

    Hold down the Windows key while pressing 'L '.

    "How to quickly lock your computer and use other Windows Logo shortcut keys"
      <>http://support.Microsoft.com/kb/294317 >

    HTH,
    JW

Maybe you are looking for

  • Pop - up alert to the Virus will not disappear in Safari

    I get these pop-up windows (I have pop-ups disabled) for some kind of scam to virus removal.  I run Cocktail and repair permissions and remove all history... nothing helps.  Are these windows disrupting my use of Safari, they also changed my browser

  • Help return - turn on 3G

    I'm on wifi and connected to my home router Tournai. Problem is that now, when I turn off the 3G does not work. I had the app Switcher network and thought that it is perhaps the issue, so I deleted and restarted my phone to be sure. But it still does

  • Bloggie Sony MHS - PM5 camera

    Salvo ogni volta che connect the bloggie al pc the riconosce come e virus don't blocca lo unloading dati

  • Ho mini 1116nr, CNU9102ZVS: lost password

    Password verification failed fatel error... System CNU9102ZVSI buy for sale yard have no password can help you thank you

  • Different versions and updates of Microsoft Visual C++, can I all?

    Hello. I use Windows Vista Home Premium, 32-bit with Service Pack 2. I have two different versions of the C++ installed and updates. I was wondering if it is okay to remove one of these items? They appear in the list programs and features on the cont