CLOB replace problems

Hi!,
I using 11g and am trying to replace a string within a clob field. My only problem is the link I am replacing is different in every occurance. I am replacing textbook links that are all different with a general link. For example Engr 1120 current has this data in the clob field.
https://ttuss1.tntech.edu/textbook_listing.php?t=201210&p=ENGR&c=1120&s=002" target="_blank">Textbook Information</a></a>
This section involves an online component. This section must be taken with ENGR1120-102. This section will utilize the Fortran language. Fortran is the required language for students intending to major in CEE and is accepted for students intending to major in ChE or ME.
I want to replace only the text "https://ttuss1.tntech.edu/textbook_listing.php?t=201310&p=ENGR&c=1120&s=002" target="_blank">Textbook Information
with this
http://tenn-tech.bncollege.com/webapp/wcs/stores/servlet/TBWizardView?catalogId=10001&storeId=28563&langId=-1
The p=ENGR&c=1120&s=002 part of the link is different for every textbook. How can I do this since I can't seem to find a way to use replace using a like statement? I can load the data into a temp table and make it a varchar field but that still doesn't solve my problem with the like issue.
Edited by: Withnoe on Jan 29, 2013 11:54 AM

If the LIKE operator is not powerful enough for you, you may consider using regular expressions (REGEX).
This link is a good start - http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_regexp.htm
Iordan Iotzov
http://iiotzov.wordpress.com/

Similar Messages

  • Prolem in CLOB replace function

    Hi,
    I am working on Oracle 10g (release 2).
    Currently facing problem in replace function
    My given patterns are
    Replace(+string+, varchar2, clob)
    Replace(+String+, clob, clob)
    In both casese, I'm getting ORA-22828 error.
    Can anyone please suggest the solution.
    Thanks.

    Please see
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3388795154384573::::P11_QUESTION_ID:1533006062995

  • Hot Code Replace Problem...

    Hi Everyone,
    I am using WebLogic 10 with Eclipse. Whenever i start the server in debug mode and make two three changes in the code... WHAM.... I get the Hot Code Replace error. Is there any way so that the server can keep up with the code changes. Publishing the app again takes approx 40 mins!

    Almost always this is a limitation of the JRE/JDK you are using and really
    nothing to do with Eclipse.
    Try a different VM and see if you have better luck
    HTH
    Darins
    "bobz" <[email protected]> wrote in message
    news:75257188f239cb376da31e19b214d2d9$[email protected]..
    > hi buddies,
    >
    > i am getting "hot code replace" problem whenever i change my
    > java code and build the project and access the website without re-starting
    > the server. so, finally i endup with re-starting the server whenever i
    > change the code. this consumes a lot of time. is there any possibility to
    > work without re-starting the server even after the code change.
    >
    > regards,
    > satish.

  • CLOB.getAsciiStream problem in 11gR2 with temp CLOB internal JVM

    Hello,
    i have a problem with using a termporary CLOB in PL/SQL that is going to be written with Java Code that runs inside Oracle Database (Internal JVM). The code works without problem in Oracle 11g R1 (11.1.0.7.0) but does not with Oracle 11g R2 (12.2.0.1.0). The example follows:
    <b>Table Description:</b>
    NAME Null? Type
    ID NOT NULL NUMBER(*,0)
    FILE_TYPE NOT NULL NUMBER(*,0)
    INSERT_DATE NOT NULL DATE
    PROCESSED NOT NULL NUMBER(*,0)
    LFIELD001 CLOB(4000)
    BFIELD001 BLOB(4000)
    FILE_NAME VARCHAR2(4000)
    <b>PL/SQL Example Run:</b>
    DECLARE
    clb CLOB;
    p_result NUMBER; p_err VARCHAR2(4000);
    t BLOB;
    BEGIN
    SELECT bfield001
    INTO t
    FROM file_data
    WHERE id = 200;
    clb := java_utils.clob_zipdecompress(t, 'BANKFILE_', p_result);
    -- Output the results
    dbms_output.put_line(SubStr('p_result = '||TO_CHAR(p_result), 1, 255));
    dbms_output.put_line(SubStr('p_err = '||p_err, 1, 255));
    dbms_output.put_line(SubStr('p_return_clob = '||SUBSTR(clb, 1,255), 1, 255));
    END;
    <b>Package example </b>
    PACKAGE JAVA_UTILS
    IS
    -- Decompress a BLOB in ZIP format to a CLOB and return it with specified contained filename
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_fname IN VARCHAR2, p_result OUT NUMBER)
    RETURN CLOB;
    END JAVA_UTILS;
    PACKAGE BODY JAVA_UTILS
    IS
    -- Decompress a BLOB in ZIP format to a CLOB and return it with specified contained filename
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_clob IN CLOB, p_fname IN VARCHAR2)
    RETURN NUMBER
    AS LANGUAGE JAVA NAME 'java_utils.Compress.ZipDecompress(oracle.sql.BLOB, oracle.sql.CLOB, java.lang.String) return int';
    FUNCTION clob_zipdecompress(p_blob IN BLOB, p_fname IN VARCHAR2, p_result OUT NUMBER)
    RETURN CLOB
    IS
    l_clob CLOB; l_result NUMBER;
    BEGIN
    IF p_blob IS NULL THEN
    RETURN NULL;
    END IF;
    DBMS_LOB.createtemporary(l_clob, TRUE);
    p_result := clob_zipdecompress(p_blob, l_clob, p_fname);
    RETURN l_clob;
    END clob_zipdecompress;
    END JAVA_UTILS;
    <b>Java Function Example simplified </b>
    package java_utils;
    import java.lang.*;
    import oracle.sql.*;
    import java.io.*;
    import java.util.zip.*;
    public class Compress
    * Decompresses the BLOB into CLOB
    * @param blob the source BLOB (compressed binary data)
    * @param clob the target CLOB (will hold plain text) it should be an empty CLOB retrieved for
    example with dbms_lob.createtemporary(l_clob,true);
    * @throws Exception mostly I/O exception if ever
    public static int ZipDecompress(BLOB blob, CLOB clob, String fname, String[] err)
    OutputStream out; ZipInputStream z; ZipEntry ze; String zeName; byte[] buffer; int cnt;
    boolean found = false;
    try {
    out = clob.setAsciiStream(0L); // Here it fails
    catch (Exception ex) { err[0] = ex.getMessage(); return -1; }
    return 0;
    The execution of the example works well in 11gR1 but in 11gR2 returns error : <b>Invalid argument(s) in call. </b>
    Any idea why this is happening?
    Any help will be appreciated.
    Dionyssis

    Hi Dionyssis:
    Replace:
    clob.setAsciiStream(0L); // Here it fails
    by:
    clob.setAsciiStream(1L);
    the CLOB Api was changed from early implementation of Oracle to the standard implementation.
    HTH, Marcelo.

  • Insert CLOB values problem with 9.2 drivers and not with 10

    Hi
    We are using Oracle 9.2.0.5. We need to insert values bigger than 4000bytes using thin connection, so we've decided to use CLOB fields. With the 9.2.0.5 driver we can't do it, obtaining the classical exception explaining the data is bigger than the supported size but with the 10g driver (and, of course, same java code) it worked. The problem is that we want to mantain the equivalence between the database and driver not using the 10g driver with the 9.2.0.5 version of the db.
    Here it's the test code we've used:
    Data generation:     
              String data = "";
              Random rnd = new Random();
              long cont = 10000;
              while (cont > 0){               
                   int result = rnd.nextInt(255);
                   data = data + result;
                   cont--;
              Integer id = new Integer(2);
    Data insertion:
                   String queryString="INSERT INTO TMP_BUG_ORACLE (ID, VALOR) VALUES (?,?)";
                   preparedStatement = connection.prepareStatement(queryString);
                   preparedStatement.setInt(1,1);
                   preparedStatement.setString(2,this.datos);
                   int numero = preparedStatement.executeUpdate();               
                   System.out.println("Items inserted: " + numero);
                   preparedStatement.close();
                   connection.close();
    Table structure
         Name:          Type:
         ID           NUMBER
         VALOR      CLOB
    Response (only with 9.2.0.5 driver):
    java.sql.SQLException: El tamaño de los datos es mayor que el tamaño máximo para este tipo: 25708 (Data size is bigger than the maximum for this type: 25708)
    Thank you very much for all

    Hi,
    I had exactly the same problem. on Oracle 9.2 I wanted to insert a template file bigger than 4K. with the ojdbc14.jar from Oracle 9.2 it was not possible.
    What I did was this:
    I have used a JDBCwrapper to fix this issue. I can send it to you, if you send me your email.
    When I use the ojdbc14.jar from Oracle 10, I cannot insert a bigger file.
    How did you code your programm to insert big size data into a CLOB field with ojdbc14.jar driver from 10?
    thank you for your response

  • Post Power Supply replacement problems

    Hello,
    I'm trying to resuscitate my PowerMac G5 after a power supply failure and I'm having some issues. I've reached the end of my expertise and so I need to reach out to the community in hopes of being pointed in the right direction.
    So here's the series of event that led me to where I'm at right now along with some symptoms:
    - My PowerMac G5 Dual 2.0 (june 2004) died in a puff of smoke one day, smelled like burnt plastic. I was pretty sure it was a power supply issue. My computer does not qualify for the Apple extended PSU replacement program. After the death, the power supply would click whenever it was plugged in but otherwise the computer was unresponsive.
    - I ordered in a new 600W power supply and replaced the toasted one. I took care to place the CPUs back exactly where they were to avoid having to re-calibrate them.
    - I plugged my computer back in with the same configuration minus the second hard drive. The primary hard drive should be bootable.
    - The first time I powered it on it had no monitor or keyboard/mouse connected. The fans went off at normal speed, the chime chimed and then the fans went full speed.
    - I powered it off and plugged in a keyboard/mouse and monitor and now when I power it on I can hear the fans, then the chime then the CD drive reads a bit of the CD and then that's it. No video.
    - It somehow seems to ignore the keyboard and mouse: I can't use the keyboard to reset the PRAM. I can't use the mouse to open the CD tray.
    - Powering the computer down requires the "press and hold for 2 sec" versus the immediate power down like when the computer is in Target Disk mode.
    - The power status led doesn't flash in anyway at boot, indicating no problem with the RAM, ROM or processors.
    - The diagnosis lights inside the mac are not lit until I remove the plastic cover which triggers the default behavior of running the fans at full speed. Then the led lights up.
    - I reset the PMU but it didn't seem to make a difference.
    - I tried accessing the disk in Target Disk mode but since the keyboard appears to be ignored I don't think the G5 even gets in Target Disk mode. In any case it doesn't mount on the remote computer.
    - I notice that the fan on the video card doesn't spin. The video card is an ATI 800XT with a Zallman fan and heatsync installed.
    I'd be tempted to say that the video card got fried with the PSU failure but then shouldn't I be able to use the keyboard to reset the PRAM and such ? The fact that I'm unable to do that leads me to believe that perhaps a part of the logic board or the front panel got fried...
    How would I go about troubleshooting this without buying a new logic board and front panel ?
    Any ideas ?

    Going through the exact same issue started about 1.5 weeks ago thinking about giving up and buying a Mac mini for access and snow leopard.

  • Iphone 5 battery replacement problem.

    The battery for my iPhone 5 needs to be replaced. It's been showing the red needs charging sign for over a week now, and even after I left it charging for over a day it didn't start. I was looking through similar complaints and I was more than sure it was the battery. I went to the Apple store this week to see if I was correct, and they said it definitely needed a battery replacement. Only problem is they wanted to charge me for $260 to replace it. Seemed like too much considering my iPhone battery hasn't been working right since I first go it. So recently I've been looking at some similar complaints on here and others seem to have the same problem. I read that here's a battery replacement program and my phone was entitled( here's the number F17JR7RGF8GH). Now my question is, if I go back to the apple store and show them my serial number will they replace it for free? Any help would be great, thank you.

    The phone does meet the criteria, I attached a picture to verify this below. The phone is out of warranty though.  Also, there are no physical damages  whatsoever.

  • IPhone Screen Replacement Problems

    So I recently got my screen replaced by JetCity in Chicago for $140... two days later I dropped my phone and the screen shattered again.  This time I was determined to change the screen myself.  I ordered a new screen, took apart the phone without any kinks, replaced the screen, made sure everything was connected, and put the phone back together.  I turned it on and all I saw was a blue vertical bar across the center of the screen, which stayed there for awhile, until the phone finished booting up and then the phone screen went into standby or whatever.  I can connect the phone to the computer and it's recognized by iTunes, so everything else in the phone appears to be working except the output to the screen.  Thinking it was a faulty replacement screen, I connected my old cracked screen back up, and the same blue bars appeared.  I'm not sure what to do at this point.  If anyone has any clue as to what the problem is, PLEASE tell me.  I've had an iPhone since the original came out and I've been using a $4.99 att goPhone as a replacement and I'm slowly dying while attempting to use it day to day... I'll attach photos of what the phone now looks like when I press the home button to wake it up. Any ideas are MUCH appreciated.

    I'll try the firmware restore now, I've tried reseting the connector onto the logic board a few times, and have already tried cleaning the connectors with isopropyll. I figured debris was probably the original cause but since cleaning it didn't work, I just figured the logic board somewhere during the replacement got messed up somehow.  I'll probably just do the exchange if the firmware restore doesn't work. Any other soulutions still appreciated.. but I'm pretty sure theres not much else I can do at this point short of getting a replacement.

  • IPad 2 digitizer replacement problem. Maybe?

    Help people. I was replacing an iPad 2 digitizer but during taking it off I tore the power button flex cable so we went ahead and ordered that probably be here tomorrow or Wednesday. Well anyway I decided I'd clean the iPad all up and find how I'd tuck the digitizer cable under the LCD screen. Anyway while doing that there's this little piece with 2 holes that is like a little tab sticking off the digitizer cable. That tore off of the digitizer. I don't know if that part is important or just there or what but can someone please tell me what that little piece is for? This is the 4th iPad I've fixed and never had either of the problems I had with this one. Please tell me what that part does or if its important. I couldn't test the digitizer because no power button flex cable and I don't feel comfortable turning on the iPad with something unplugged from it. I can still plug in the digitizer but this is just a little piece that sticks off from it.

    http://www.ifixit.com

  • OCCI Clob.write problem

    hi
    i am new to occi
    i have tested my application and insert data to my tables ;
    I have a field in my table which its type is clob and a procedure for inserting in that table
    when i test procedure with stmt.setString (for the clob field) I have no problem for inserting
    but when using stmt->setClob , there is exception ora-22275
    my code is like this:
    Clob C(conn);
    C.setEmpty();
    C.write(4,"test",4);
    stmt->setClob(1,C);
    stmt->executeUpdate();
    whats wrong?
    error message is about problem in occi::clob::write

    Hi,
    Because LOBs use what are known as locators, you can't just create the clob in client code like that and insert it into the database.
    The database won't "know about" the locator and will raise the ORA-22275 error (as you have discovered).
    What you need to do is initialize the clob as noted in the Clob Class documentation notes. See here for example:
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/reference009.htm#i1118691
    An uninitialized CLOB object can be initialized by:
    * The setEmpty() method. The CLOB can then be modified by inserting this CLOB into the table and retrieving it using SELECT ... FOR UPDATE....
    < emphasis added >
    So, essentially, you set the clob to empty, insert it into the table, then using "select for update" you get the clob (locator) back. You need to use "select for update" and not just a regular select. You can then modify the empty clob (be sure to commit when done).
    For an example of this, see the Oracle 10g Release 1 Demos from here:
    http://www.oracle.com/technology/sample_code/tech/occi/index.html
    Regards,
    Mark

  • Copying a lot of music from one hard drive to another - replacing problems

    Hi,
    I want to copy a lot of music in many folders from my desktop to an external hard drive. The problem is that many of the folders share a name with a folder in my hard drive, but have different music files. If I tell Finder to 'replace' then all of the old files on the hard drive in that folder will be erased. I remember in Windows that when you told it to 'replace' like this it would just assimilate the old folder with the new one, and ADD the files, instead of removing some of them. Does anyone know of a way to do this?

    Cindy Rosenbaum wrote:
    Hi,
    I want to copy a lot of music in many folders from my desktop to an external hard drive. The problem is that many of the folders share a name with a folder in my hard drive, but have different music files. If I tell Finder to 'replace' then all of the old files on the hard drive in that folder will be erased.
    Just create a new folder on the HD for all the music that you are copying. Then there is no problem.
    I remember in Windows that when you told it to 'replace' like this it would just assimilate the old folder with the new one, and ADD the files, instead of removing some of them. Does anyone know of a way to do this?
    I do not believe Winders does such a thing. Replace in Winders overwrites the original file, just as in BSD.
    You are really looking for a merge contents command such as in importing or synching email.
    This link should be helpful
    http://forums.macrumors.com/showthread.php?t=274241

  • Win7, DW CS6, Find and Replace, Problem: The "Done or Found" message is cut off based on your SEARCH dropdown choice.

    The Find and Replace "Done or Found" message is partially cut off for "Search" dropdown choices "Source Code, Text, Text (Advanced), but not for "Specific Tag". It appears to be a programming bug sizing the "Find" and "Replace" text boxes too big for the "find and Replace" window. Has anyone else encountered this problem.

    Excuse me for resurrecting this, but I have been living with this same issue, and many more issues (I won't list them here), since migrating to CS5 (understood this thread is for CS6. However, my post is relevant none the less). If anyone has the fix I would love to know what they found. But sadly, I doubt there is one.
    My system and display settings are also Win7 at 100% display. When doing a Find and Replace I can barely see what the results are for how many occurrences in the find window because the bottom is cutting off half of the text, just like the OP screen shot above. If the results reads "Done. 2 items found" it can easily be mistaken for "Done. 3 items found" if I don't study it carefully because of the bottom half of the "2" is cut off.
    I don't want to rant here, but I will a little which I'll confess is the real purpose of my post. I am so disappointed in Adobe for so many different bugs in their software suite which they choose not to address, or even acknowledge as existing. I've had their tech support on the phone while they were recording my screen as I recreated issues for them, they never got back to me on any of them. I just got lip service how their engineers are looking into it and they'll get back to me. This of course was when CS5 still had free support under warranty.
    At this point I'm numb to it all and I'm stuck using their software because I'm used to it, which ultimately is their goal anyway I'm sure. You win Adobe.
    BTW...if anyone replies, please do not suggest the basic troubleshooting steps. All of the issues I've had exists after multiple re-installs on formatted hard drives and on both of my PCs made by two different manufacturers with different hardware specs (both exceeded min hardware requirements). Not to mention been through various techniques while on the phone with them..
    Ahh... I feel better now.

  • Find & Replace problem

    I have a number in a cell formula. When I search for the number with Find, it is not found. I opened the Find & Replace window and select Formulas Only and the number is found. When I select Entire Document the number is only found if the formula is open on the sheet. I would think that Entire Document would include formulas, even if they aren't open at the time. Anyone else had this problem or know a solution? I am using v2.0.3(332).

    I think it is Entire Document as opposed to Current Sheet Only, neither of which look in formulas. What you are wanting is a separate setting for Exclude Formulas, Include Formulas, or Formulas Only. That sounds like it would be useful. If you would like to suggest this to Apple, in the Numbers menu is a selection for Provide Numbers Feedback.

  • HD Replacement Problems

    I just replaced my HD with a 1TB HD.  However the HD is not communicating to the motherboard.  Is there an easy solution to this problem?

    Just dropped "my problem" off with some local computer tecky.  Will pass on this information to him.  And, thanks for your resonse.

  • Clob replace

    Hello folks,
    Is there any easy and safe way to use replace on a CLOB bigger then 32k characters?
    Best regards,
    Igor

    This works
    declare
      test clob;
    begin
      test := replace( rpad( to_clob( 'abc' ), 40000, 'b' )
                     , 'a'
                     , 'b'
      dbms_output.put_line( length( test ) );
      dbms_output.put_line( substr( test, 1, 10 ) );
      dbms_output.put_line( substr( test, -10 ) );
    end;But if you try
    declare
      test clob;
    begin
      test := replace( to_clob( 'abc' )
                     , 'a'
                     , rpad( to_clob( 'b' ), 40000, 'b' )
      dbms_output.put_line( length( test ) );
      dbms_output.put_line( substr( test, 1, 10 ) );
      dbms_output.put_line( substr( test, -10 ) );
    end;you will get
    ORA-22828: input pattern or replacement parameters exceed 32K size limit
    Edited by: ascheffer on Apr 19, 2013 9:25 AM

Maybe you are looking for

  • My iPod won't sync to iTunes and has a screen with the iTunes logo and a charger

    This is so frustrating. I downloaded the latest iTunes and  iOS 8.1 for my iPod Touch 5th Gen., and now it only displays a message on it with a charger with an arrow pointing to a red iTunes logo. I've tried doing just that, but for one reason or ano

  • Execution time is too high.

    Hi, I got several xsql-files that uses aprox. 1 minute to execute by them selves. I want to run one xsql that includes them all, but it times out, and I get an server-error. Is there any way I can get the execution time down, or change the timeout-se

  • How to change button names linked with the 'connect command?'

    Hi, I have linked a button in the sequence view to the Exeution entry point 2 (Single Pass) using the 'Connect command'. The button now displays 'Single Pass' as its caption name while running. I want to give a custom name to this button, but it shou

  • Load Rules into Dictonary using JAVA

    Hi all, I want to load the rules (Written using RL) in to Dictionary. I wrote java client which will read Rules from XML but i dont understand how to load it in to dictionary ? following is my Java Client. public class JSRDemo { public static void ma

  • Put a Gun to My Head

    My itunes for some reasons keep coming up with "required files missing" reinstall but I cannot delete my program from my "add and remove" file. Help