Does anyone have some wizzy code or bright ideas?

I have a string variable - varchar2(240) maximum - which is arbitarily filled with 3 letter codes. Any one or more of these codes may be duplicated within the string. What I need to do is to strip out all the duplications and end up with a single contiguous string containing all the unique code options. e.g.
Initial string 'AAABBBCCCBBBDDDAAAEEEBBB'
should end up as :-
'AAABBBCCCDDDEEE'
Hope this makes sense - also there is no need to place the unique codes in any kind of order.
Thanks for your help...

And in 10g, regular expressions and MODEL clause can do the job:
WITH t AS (SELECT 'AAABBBCCCBBBDDDAAAEEEBBB' col1
             FROM dual
SELECT c1
     , c2
  FROM t
  MODEL
   DIMENSION BY (0 dim)
   MEASURES(col1 c1, CAST ('' AS VARCHAR2(255)) c2, CAST ('x' AS VARCHAR2(255)) c3)
   RULES ITERATE(99) UNTIL (c3[0] IS NULL)
   (c3[0] = REGEXP_SUBSTR(c1[0], '([A-Z])\1{2}', 1, ITERATION_NUMBER+1)
   ,c2[0] = c2[0] || CASE WHEN NVL(INSTR(c2[0], c3[0]), 0) = 0 THEN c3[0] END
C1                             C2
AAABBBCCCBBBDDDAAAEEEBBB       AAABBBCCCDDDEEE      C.

Similar Messages

  • Keep receiving "USB Over Current Notices" since updating to OSX 10.6.8. I have no devices plugged into my Imac and running everything wireless. SMB/PRAM resetting did not work. Does anyone have some advice or can help?

    Keep receiving "USB Over Current Notices" since updating to OSX 10.6.8. I have no devices plugged into my Imac and running everything wireless. SMC/PRAM resetting did not work. Does anyone have some advice or can help?

    Hi Melissa,
    Pretty strange, but...
    Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, does it happen in Safe Mode? Reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)

  • Jaxa xml tutorials, does anyone have some tutorial for using xml in java??

    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....

    dapim wrote:
    jaxa xml tutorials, does anyone have some tutorial for using xml in java??
    can be dom,sax,jaxp whatever....
    i try to find in google but din't find any complete one....I would imagine anyone here would just produce the same set of hits that you did, so why waste our time doing it only to direct you to the same one(s) you already found and rejected.

  • Does anyone have an example code to use mx:ViewStack with my application.

    Does anyone have an example code to use <mx:ViewStack>
    with my application.
    I don't know about how to put value to it and use value in
    it.

    http://livedocs.adobe.com/flex/2/langref/mx/containers/ViewStack.html#includeExamplesSumma ry
    That should be what you're looking for.

  • Does anyone have the HTML code for the Buffy Font

    Does anyone have the HTML code for the Buffy Font?

    1) download one of the Buffy fonts @ font space, just as Hans-Günter wrote.
    2) go to FontSquirrel, and use the web font generator: http://www.fontsquirrel.com/tools/webfont-generator
    3) load up your buffy font, and generate the web font.
    4) download the zip package, and check out the included demo file
    Copy all the font files (all four of them) to your web folder. Then copy the code that looks like this to the top of your css:
    @font-face { font-family: 'FontName'; src: url('FileName.eot'); src: url('FileName.eot?#iefix') format('embedded-opentype'), url('FileName.woff') format('woff'), url('FileName.ttf') format('truetype'), url('FileName.svg#FontName') format('svg'); font-style: normal; font-weight: normal; }
    Check that all file references are set up correct, and use the font name  in your css rules.
    h1 {
    font-family: 'FontName';
    Done!

  • Does anyone have a simple code.....

    Does anyone have a simple code to make a xml video like you tube?

    Hi zenith
    By default the source of counter 0 while using the 9401 is located on PFI0 or pin 14.  In order to determine the rest of the pins have a look at the image below.  I was able to get this information from by right clicking my device in Measurement and Automation Explorer (MAX) and selecting device pinouts.
    You can also specify which PFI line the counter outputs on.  In order to use this you use a DAQmx Channel Property node and modify the Counter Output Pulse Terminal.  Have a look at the screen shot below 
    Hope this helps. 
    Chris_K_
    Message Edited by Chris_K_ on 08-27-2008 12:26 PM
    National Instruments
    Applications Engineer
    Attachments:
    2008-08-27_111350.jpg ‏20 KB
    2008-08-27_110349.jpg ‏72 KB

  • I have a rock stuck in my headphone jack, on my iPhone, does anyone have some tips on how to get it out?

    I have a rock stuck in my iPhone headphone jack, does anyone know how to get it back, please, help me.

    Maybe a fine nail or needle since the opening is so small. I, too, do not see how anything could get in the port.

  • Does anyone have the AUTHORIZATION CODE (5 spaces) for PhotoShop CS2?

    I cannot get my PhotoShop CS2 to activate - at one time the Adobe support gave me the
    5 (JUST FIVE) box numbers for authorization - now they won't give them out....and I bought
    my program - I just need to be able to use it again, after having to switch from XP Pro to Win7.
    Anyone - help???

    All you need to do is download the new non-activation version of CS2 from Adobe
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Install then enter the new serial number provided by Adobe at that link

  • Does anyone have the source code for doing a login page?

    I need to do a login page with capture the input from the username and password's textbox on webpage then validate the username and password in the database. If correct then direct the user to the main page, if not, will display a error page.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#ccff99">
    <form name="form1" method="post" action="customercheck.jsp" target="_self">
    <p align="center"><strong><font size="5"><U>Customer Login</U></font></strong></p>
    <table width="75%" align="center" cellpadding="0" cellspacing="0">
    <tr >
    <td width="38%" rowspan="2" border="2" bordercolor="#000000" ><div align="center"><strong>New
    User? Click here.</strong></div></td>
    <td width="21%"><strong>User Name : </strong></td>
    <td width="41%"><input type="text" name="username"></td>
    </tr>
    <tr>
    <td><strong>Password :</strong> </td>
    <td><input type="password" name="password"></td>
    </tr>
    <tr>
    <td width="38%" bordercolor="#000000"> </td>
    <td colspan="2"><div align="center">
    <p> </p>
    <p>
    <input type="submit" name="Submit2" value="Login">
    </p>
    </div></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ include file="Connections/conn1.jsp" %>
    <%
    String Recordset1__username = "%";
    if (request.getParameter("username") !=null) {Recordset1__username = (String)request.getParameter("username");}
    %>
    <%
    String Recordset1__password = "%";
    if (request.getParameter("password") !=null) {Recordset1__password = (String)request.getParameter("password");}
    %>
    <%
    Driver DriverRecordset1 = (Driver)Class.forName(MM_conn1_DRIVER).newInstance();
    Connection ConnRecordset1 = DriverManager.getConnection(MM_conn1_STRING,MM_conn1_USERNAME,MM_conn1_PASSWORD);
    PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT cust_id,username, password FROM customer WHERE username='" + Recordset1__username + "' AND password='" + Recordset1__password + "'");
    ResultSet Recordset1 = StatementRecordset1.executeQuery();
    boolean Recordset1_isEmpty = !Recordset1.next();
    boolean Recordset1_hasData = !Recordset1_isEmpty;
    Object Recordset1_data;
    int Recordset1_numRows = 0;
    if(Recordset1_isEmpty) response.sendRedirect("loginagain.html");
    String hi = Recordset1.getString(1);
    session.setAttribute("id",hi);
    session.setAttribute("right","hello");
    session.setAttribute("emp_right","tt");
    response.sendRedirect("availability.jsp");
    //response.sendRedirect("vacancytemp.jsp");
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    </body>
    </html>
    <%
    Recordset1.close();
    StatementRecordset1.close();
    ConnRecordset1.close();
    %>

  • IPhoto downloaded photos into an event and now they don't show up. They were deleted off the camera under the assumption they were in my library now I don't have anything.  Does anyone have any useful advice?

    I downloaded photos from my camera to iPhoto 11.  They were accepted as a new event.  I deleted off the camera disk.  Now, after going back into the events folder, the photos are not there. Does anyone have some useful advice? I've lost about 200+ photos...

    You can recover the shots from the Card with an app like MediaRecover
    As for the Library:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • I can't access any mote to a WD MY Book (WD5000H1Q). Does anyone have any suggestion about this issue?

    I cannot acces any moto to a WD MY Book (WD5000H1Q). After upgrading to Lions It worked for a couple of days. Does anyone have some suggestion on this issue?

    Do you see it on your desktop as an icon?

  • Some of my apps refuse to open. For example, google crome gives me the message that it quit unexpectedly and gives me the option to submit a report to no resolve. Does anyone have suggestions?

    Some of my apps refuse to open. For example, google crome gives me the message that it quit unexpectedly and gives me the option to submit a report to no resolve. Does anyone have suggestions?

    Welcome to the Apple community.
    Does anyone have suggestions?
    Trash the spyware (Chrome) and use Safari.

  • I want to change the settings (brightness, contrast, gamma) for my internal cam on Macbook pro. I find having to but a third party software (iglasses, webcam settings) to control basic settings as unnecessary and exploitative. Does anyone have a solution?

    I want to change the settings (brightness, contrast, gamma) for my internal cam on Macbook pro. I find having to but a third party software (iglasses, webcam settings) to control basic settings as unnecessary and exploitative. Does anyone have a solution?

    It is not about payment of $19.95 (Igalsses) or $7.99(webcam settings). This is a very basic setting that should be available in the system settings. The automatic setting of the internal cam does not work great on low lighting as everyone is aware.
    i am just amazed how users take in lying down and suggest solutions such as paying for a 3rd party paid app or improving the lighting in your room.

  • Does anyone have the code to use an image button as the reset button?

    Does anyone have the code to use an image button as the reset button? I'm finally at the end of the form and got the submit button to work as an image button, but cannot do the same with the reset button.  Any help is greatly appreciated!

    I agree. 
    http://www.456bereastreet.com/archive/200909/almost_never_add_a_reset_button_to_a_form/
    Nancy O.

  • I was loading some CDs into my iTunes library when the disk drive refused to "suck in" the next CD.  Does anyone have a suggest on how I might proceed?

    I was loading some CDs into my iTunes library when the disk drive refused to "suck in" the next CD.  Does anyone have a suggest on how I might proceed?

    Yes, that is a Catch 22.  If you have another Mac you can connect your Mac to it in the Target Disk Mode,  Transferring files between two computers using FireWire, and use Disk Utility on the second Mac to try to run the Hardware Test from there.  Not sure if it's possible to a connected Mac though.
    You can try this several times in the Terminal app and then see if a disk can be fully inserted:
    Enter the following command followed by the Enter or Return key:
    drutil eject
    Do it several times and then try another disk.  (A long shot).

Maybe you are looking for