check by commas

Hi all

I'm using Oracle 11.2.0.3

CREATE TABLE TEST (NUMBER NUM, DSC VARCHAR2 (200));

INSERT INTO TEST VALUES ("1, ' 12, OLD STREET, NEW YORK");

INSERT INTO TEST VALUES (2, 17, RUE LONG, DC, 555-444. ');

I want to find a particular NUM how comma,.

is there inside the desc column.

Please help me to form a query.

Thank you

Hello

Etbin wrote:

Pre-regexp:

with

data in the form of

(select 1 num, dsc'12, OLD STREET, NEW YORK CITY ' of any double union)

Select 2, 17, LONG STREET, DC, 555-444' of the double

)

Select num, dsc, length (dsc) - length (replace(dsc,',')) comma_count

from the data

NUM DSC COMMA_COUNT
1 12, OLD STREET, NYC 2
2 17, LONG STREET, DC, 555-444 3

Concerning

Etbin

Beware of null values.  If the sting consists of nothing else but to commas, which return the NULL value.  If you want to come back to the length of the string, use

Select num

dsc

, length (dsc) - nvl ( length (replace (dsc, ",")))

0

( ) as comma_count

from the data

;

What happens if the dsc itself is NULL?  All relays up to now return NULL in this case, which may be what you want.  If you want to consider a NULL string to contain 0 commas, then you can do this:

Select num

dsc

nvl (length (dsc)

0

) - nvl (length (replace (dsc, ",")))

0

) as comma_count

from the data

;

Tags: Database

Similar Questions

  • BlackBerry PIM is why so slow contact is created?

    The following code, I got the blackberry Forum, takes almost 26 minutes to create 2000 random contacts using the PIM API of BB on one set of 8500 series. Does anyone have an idea why it takes so long or how to improve the performance of creation of contact in the address book?

    HM... 26 minutes for 2000 contacts means ms 780 by a contact.

    (1) you can check contact.commit (); is not the call much more time here? You could do that relatively accurate with sth like this:

    long timeSpentOnCommits; defined somewhere at a higher level
    ...
    Start long = System.currentTimeMillis ();
    contact.Commit ();
    took a long time = System.currentTimeMillis () - start;
    timeSpentOnCommits += taken;
    ...
    then after that all contacts have been added, you can get
    an hour of average validation:
    long timePerOneCommit = timeSpentOnCommits / 2000;
    Discover the obtained value in a 'dialogue' or a logging

    If it takes most of the time, so I don't think you can improve it.

    (2) another idea - in the loop 'for' you create too many String objects, so this forces the operating system to call the garbage collection too frequently (which is a thing of your time).

    Use StringBuffer instead. So instead of the

    addr [contact. ADDR_POSTALCODE] =
    arrSzAlphas [generator.nextInt (arrSzAlphas.length)]
    + arrSzAlphas [generator.nextInt (arrSzAlphas.length)]
    + Integer.toString (generator.nextInt (99))
    + Integer.toString (generator.nextInt (9))
    + " "
    + arrSzAlphas [generator.nextInt (arrSzAlphas.length)]
    [+ arrSzAlphas [generator.nextInt (arrSzAlphas.length)];

    Use this:

    addr [contact. ADDR_POSTALCODE] = new StringBuffer()
    . Append (arrSzAlphas [Generator.nextInt (arrSzAlphas.Length)])
    . Append (arrSzAlphas [Generator.nextInt (arrSzAlphas.Length)])
    . Append (Generator.nextInt (99))
    . Append (Generator.nextInt (9))
    . Append(' ')
    . Append (arrSzAlphas [Generator.nextInt (arrSzAlphas.Length)])
    . Append (arrSzAlphas [Generator.nextInt (arrSzAlphas.Length)])
    . toString();

    StringBuffer.append () is too important for any primitive type, so it can accept integer (ints) and the characters directly without needing to be converted into String objects.

    The same approach should be used for the generation of phone numbers.

    (3) minor speed improvements could be obtained by the extraction of all repetition of the loop calls "for". For example, just count how many times you call to arrSzAlphas.length (iterations 2000 * 4 calls per iteration = 8000 times!), while you could call ONCE before the loop and store it in a visible final local variable of the loop. It is the same for a set of contacts.isSupportedXXXX calls - you must call him not included in all iterations, just call him once before the start of the loop.

  • Questions about the feature is committed

    I had a few sales reps to communicate performance with commitment issues.  Does anyone have experience or comments on the following?

    1. the delay between when the email is sent and received.

    2. check the spelling.  Is there a spell check in commit?

    3. when hyperlinks are incorporated into the model, is there a way for the rep see what are the links before you send the email?

    Any comment is appreciated.

    Hi Marilyn.

    For spell checking, most browsers have an integrated spell check and are very good!  just, you make a right click on a misspelled underlined word and select one of the suggested corrections

    For the preview of hyperlink, you bring up the linker by placing your cursor over the link by clicking on the hyperlink button.  This shows you the exact URL it points to.

    But if the link is redirected, it can sometimes be difficult to see where this will end.

    Egan

  • I want to restrict a user to enter in the same interval of time or with in the same interval

    Hi all

    I am pleased to wish you a happy and prosperous new year.

    Q: in my application I need to provide a validation the user to not enter the same interval of time or in the same interval of time

    To make a unique combination of the user and the time interval that I can use a Unique Index and then I can get the unique combination of the intervals of this user. But I want to restrict the user even not to enter with in the same time interval.

    Scenario: Let's assume we have 10 records of 10 different users with different time intervals, one of them

    syam user with time interval entry 10:00 to 12:30, then the following entry syam user of time intervals should not be 10:00 to 12:30 and should not be in the same interval from 10:00 to 11:30 or 11:00 to 12: 10.

    How can I do this, I need to provide a validation.

    Thanks in advance

    -I borrowed the table of Bruno

    INSERT INTO MaTable VALUES ('tom', TO_DATE ('0701151330', 'DDMMYYHH24MI'), TO_DATE ('0701151740', 'DDMMYYHH24MI'));
    COMMIT;

    CREATE MATERIALIZED VIEW LOG ON mytable WITH SEQUENCE, ROWID, PRIMARY KEY including the NEW VALUES;

    Create materialized view mv_overlap_chk
    cool off quickly on commit WITH ROWID
    as
    Select t1.rowid rid1, t2.rowid rid2
    FROM MaTable t1
    mytable t2
    where t1.usr = t2.usr
    AND t1.rowid<>t2.rowid
    AND (t1.from_dte BETWEEN t2.from_dte AND t2.to_dte
    OR t2.from_dte BETWEEN t1.from_dte AND t1.to_dte
    )
    /

    ALTER TABLE mv_overlap_chk add CONSTRAINT CHK_OVERLAP CHECK(1=0);

    -trial:

    INSERT INTO MaTable VALUES ('tom', TO_DATE ('070120151630', 'DDMMYYYYHH24MI'), TO_DATE ('070120151840', 'DDMMYYYYHH24MI'));

    1 line of creation.

    SQL > commit;
    Commit
    *
    ERROR on line 1:
    ORA-12008: error path refresh materialized view
    ORA-02290: check constraint (JSU. CHK_OVERLAP) violated

    Therefore, constraint will be checked on commit.

  • Delete and to engage in a method

    Hello

    I'm new in Oracle ADF and I have problem with Delete, and operation to engage in a function of my managed Bean. I have a page with table and delete button. Click on which line is selected and hit delete
    apears popup with the question 'have you really wanto to remove' #recordname. And my bean, I try to perform delete operation and validate them. However the validation operation throws NullPointerException. Here is my code:


    {} public void deleteConfirm (DialogEvent dialogEvent)
    {if (dialogEvent.getOutcome (). Equals (DialogEvent.Outcome.OK))}
    try {}
    BindingContainer links = (BindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
    OperationBinding operationBinding = bindings.getOperationBinding ("Delete");
    Object result = operationBinding.execute ();
    correcctly above auxiliary lights
    If (! operationBinding.getErrors () .isEmpty ())
    {
    List < error > l = operationBinding.getErrors ();
    (error r: l)
    {
    System.out.println (r.getMessage ()) ;}
    }
    operationBinding = bindings.getOperationBinding ("Commit");
    operationBindinding is null - this result is also null
    result = operationBinding.execute ();
    } catch (NullPointerException e)
    {
    String s = e.getMessage ();
    System.out.println (e.getMessage ());
    }

    }

    I would be grateful for any help to solve me the problem.

    Thank you

    Checked whether commit liaison is?

  • JDeveloper crashed - previously reported an error [IllegalStateException...

    Hello

    My Jdeveloper on my win7 machine (version: Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013) was working fine before.

    Today, after I created a new folder under web app WEB - INF and tried to delete the generated by default 'readme.txt', the jdeveloper crashed and maintains have reported the following errors:

    Previously reported error [IllegalStateException in o.i.explorer.IconOverlayTracker$ NodeWatcher:802]
    Previously reported error [IllegalStateException in o.i.explorer.IconOverlayTracker$ NodeWatcher:802]
    Previously reported error [IllegalStateException in o.i.explorer.IconOverlayTracker$ NodeWatcher:802]
    Previously reported error [IllegalStateException in o.i.explorer.IconOverlayTracker$ NodeWatcher:802]
    Previously reported error [IllegalStateException in o.i.explorer.IconOverlayTracker$ NodeWatcher:802]

    I tried to restart jdeveloper and restart windows. It does not help.

    Even when you delete the project folder and downloaded a usable copy of SVN, it still has not. Now, I can't open the 'WebContent' of the browser of the Application folder. It displays "loading...". ».

    Help, please. Thanks in advance.

    Hi Koan,

    If you are using TortoiseSVN 1.7.1 or higher for JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013 and below versions its gives this error and not for JDEV 11 g release2 update 1...

    If its if just use tortoise svn to check and commit purpose, remove connections navigator version and make the following settings...
    Tools preferences-->--> Versioning-->--> general Subversion - and uncheck the boxes to tick 'Icon overlays to use Navigator' and 'Use Navigator State superpositions of the labels'

    Otherwise try to install later versions of Tortoise SVN as 1.6
    Too, I had the same error and not the first step to solve...

    Kind regards
    Suganth.G

  • How to check if the commit operation succeeded to view layer

    Hi all

    I use Jdev 12.1.2.0.0

    I have a table in my page and a button to delete the row in the table. I wrote the code below in the earpiece of the action

    {} public void using (ActionEvent actionEvent)

    BindingContainer links = getBindings();

    OperationBinding operationBinding = bindings.getOperationBinding ("Delete");     

    operationBinding.execute ();     

    operationBinding = bindings.getOperationBinding ("Commit");

    operationBinding.execute ();

    }

    }

    I did not delete active cascade in my model and I want to display an appropriate UI error message saying "Cannot delete this line because it has child records" I want also to rollback so that the I can show the deleted but uncommitted in the af line: table.

    I tried different web solution. I don't want to use adf custom error handler by extending DCErrorHandlerImpl because it requires a lot of changes in my model layer. Is there another way I can achieve.

    Thank you

    Mozakkir

    Hello

    Whell, next to the DCErrorHandlerImpl extension, you can make customFacesPageLifecycle:

    Oracle Apps: How customize the life cycle Page ADF to work programmatically with bindings

    and in this class, override the addMessage() method:

    Protected Sub addMessage (javax.faces.context.FacesContext context,

    AttributeBinding binding,

    error of java.lang.Throwable)

  • Error-9314 has produced Elvis comm - check elvis connection.vi

    Could someone help me with this? I have windows 7 64 bit. I have installed 64-bit and 32-bit labview. I have NEITHER myDAQ connected to my laptop via USB. The CD that came with the kit disappeared, so I was download each disc that I could install and updated.

    Here's what I get

    [IMG] http://i.imgur.com/78xem39.jpg?1 [line]

    All I'm trying to do, is get the myDAQ to act as a digital multimeter to measure resistance using the wires supplied with the kit myDAQ.

    I have to install a battery or something in the myDAQ? I saw a picture of the battery has a triple, but don't see any on the myDAQ battery compartment. There is a battery 9V on the myProtoBoard property, but it does not help the issue.

    Thank you

    Jason

    Hi Jason,

    It seems that you have installed the legacy version of the NI ELVIS driver, which only supports the NI ELVIS device. Use an NI ELVIS II / II + or one NOR myDAQ and use the DMM feature, you will need the NI ELVISmx driver. The latest version is NI ELVISmx 4.5, which supports versions of LabVIEW 2010-2013. If you have another version of LabVIEW, let me know and I can direct you to the correct version of NI ELVISmx.

  • How can I copy the list of names of files in the finder and set the Clipboard filenames separated by commas?

    Hi guys, I was wonder if anyone can give me a hand with a script.

    I need to be able to paste a list of file names of the files as follows:

    0001.jpg 0002.jpg 0003.jpg 0004.jpg

    At the moment, if I select the files in the Finder, copy to the Clipboard and paste them in TextEdit, they are like this:

    0001.jpg

    0002.jpg

    0003.jpg

    0004.jpg

    I found a similar but slightly different script and I don't know how to change it. Here it is:

    Define extension_list to {"jpg", "" JPG","jpeg","JPEG"}

    the value cbNames (Clipboard text) paragraphs

    Set csvNames to {}

    the tid value delimiters to point to the text of the AppleScript

    the text value of the AppleScript point delimiters ".»

    -now, make a list of names without extensions

    Repeat with the names in cbNames

    If the point 2 of the text names is extension_list then

    copy of text 1 of names at the end of csvNames

    end if

    end repeat

    Journal csvNames

    -now the filenames as comma CONCATENATE string separated

    the text value of the point delimiters AppleScript «»

    csvNames value cross-as text

    the text value of the point AppleScript delimiters tid

    There is an easier way. Open a TextEdit document and paste the list in. Place the cursor at the end of the first item and drag it to the start of the second.

    Press on + command + c to copy and then command + f to bring up find it. Press command + v (do not click in the first search field). Check the 'Replace' box, click in the field replace, and then type a comma and a space.

    Click 'All' and then 'done '.

  • Quotation marks look like double comma

    Hey everybody!

    I ran into a problem annoying since update to El Capitan on my iMac 2011 21.5 mid

    When I'm trying to put something in quotes, the first quote mark resembles a double comma ("") instead of a double apostrophe (""). I noticed in Mail and Word.

    Any ideas?

    Check the language setting you use in system preferences and similar settings in Word. Low quotes are used in several languages of Central and Eastern Europe rather than English analogues opening quote characters.

  • What does the green check mark when you change the info from an average of song?

    I imported an album in ITunes, I bought on Amazon and for some reason, adjust the volume slider is all the way up to + 100% on all of his songs. Whenever I try to change this back to normal, a little green check mark next to it. When I click on it, it is up to + 100%. When I ignore it and click on OK, he returned to high volume and won't let me change it. The green check mark means something? How should I do? I don't want to have my ears bleed whenever a song from the album appears when I shuffle. And I really like this album.

    The green check mark recognizes that there is a change of treatment. At this point, you must click OK if you want to accept changes or Cancel if you do not.

    In some cases, iTunes will not commit a change if the file is read-only or your account does not have sufficient permissions to make changes. See fix for iTunes for Windows security permissions , if necessary.

    TT2

  • Cannot get Bluetooth to the does job - no icon "Bluetooth RF Comm.

    I can't get my Bluetooth to work. I can't get the software and hardware (USB dongle) to install correctly.
    There is no "Bluetooth RF Comm" icon in the control panel there is also no port BT Toshiba record in under "Ports (COM & LPT)" Device Manager

    I have a USB 2.0 by sitecom Bluetooth adapter. Any ideas would be useful.

    Try to install the battery Toshiba Bluetooth, you can find here:
    http://APS.toshiba-tro.de/Bluetooth/redirect.php?page=pages/download.php

    Check if everything is installed correctly. Learn more about here:
    http://APS.toshiba-tro.de/Bluetooth/redirect.php?page=pages/FAQ/bluetoothnotworking.html

    Reinstall your Sitecom stack if everything works.

  • How to check the CPU usage and paging using LabVIEW

    Hi guys,.

    I build an application that is used to check the CPU usage and paging using LabVIEW. How can I do?

    any help, suggestions or advice will be greatly appreciated...

    Kind regards

    Prashant

    Hello

    If you plan to build your app for Windows, you can use .NET classes. (System.PerformanceCounter), there is a simple example with LabVIEW:

    C:\Program NIUninstaller Instruments\LabVIEW 2010\examples\comm\dotnet\SimpleTaskMonitor.llb

    Also, you have several screws that you can use to verify information about the processor.

    Kind regards

  • My lexmark wireless printer seems to not work whenever I run paper he says not comm.with printer

    I have a lexmark wireless printer that seems not to work whenever I run paper, its says not comm with printer

    Hi chinny111,

    ·         If it works well before?

    ·         Did you change?

    ·         What is the operating system installed on the computer?

    You can see the following Lexmark article and check if it helps.

    "Communication not available" or "Document Failed to Print" Error Message and the print job hangs in the print queue

    Respond with more information so we can help you best.

  • Cannot open COM1. Please check your port settings

    I have some XP SP2 workstations that are used in the factory.  I use Clonezilla to reimage the workstations (Yes, we have valid licenses for all units) where you have to replace a hard drive or have warranty work that requires a new installation.  We have put arrangements in place on the specified comm ports.  The printer is connected to COM1.  When I test the appliance to make sure that all devices work, the test of the printer will not open COM1.  When I use Hyperterminal to test COM1, I get the message "cannot open COM1. Please check your port settings. "I checked the BIOS of a workstation and compare it to the non-working station.  Corresponding to all of the information correctly.  When I check property COM1 resources, the station problem looks identical to the right station and no conflicts.  IRQ 04 corresponds to the current setting.  To get the desktop put open COM1, I open COM1 properties, resource tab, uncheck and then re - check the box "Use automatic settings" without applying the Statute to uncheck.  After having double checked the "use automatic settings", I click OK.  I then go back to see what the parameters are.  He changed his IRQ 07.  This modification works until the computer has been restarted so the following steps must be applied again.  Also, if I perform these same steps on a workstation, I get the same results with the change IRQ.  I don't have the problem with comm except COM1 ports.  We use the software in a box.  Change to use a different comm port is not an option.

    It seems that the cloning process is causing the problem.  Clonezilla is fast and reliable with the exception of what seems to be a problem of comm port.  I'm looking for someone who can tell me what settings can I change to make COM1 to work without having to go through additional steps after the workstation is restarted.

    Thank you
    Rick

    Hello

    The question you have posted is adapted in the TechNet forums. Post your questions here for a better response.

    Here is the link: http://social.technet.microsoft.com/Forums/en-us/category/windowsxpitpro

Maybe you are looking for

  • Satego P100-10F: Windows XP Lan, usb slots and the sound does not work

    Hello I have problems with windows vista, so I checked the forum to get information on the windows xp installation. I downloaded the drivers windows xp since the P100 Satellite (pspa6e), my only problem is that the LAN, usb slots and my sound does no

  • HP ENVY notebook: battery not charging!

    Hello I recently bought a HP ENVY laptop, and I've updated my windows edition to Windows 10. 2 weeks ago, I noticed that my battery no longer works. It does not load: its says "plugged in, load" but its not charging. now my battery is empty, (say 3%)

  • Updates at least 5 windows almost every day!

    I keep getting the windows updates every day for three weeks! I checked the updates installed, but how do I know which ones to remove? I'm on Windows Vista Edition Home Premium

  • Spectrum XT Touchsmart Ultraboo: Can I upgrade with a 9.5 mm HDD?

    I have a HP spectrum XT TouchSmart Ultrabook 15 - 4010nr, which came with a 500 GB of 7 mm and a 32 GB SSD hard drive.  I need a bigger hard drive.  Can I replace the hard drive of 7 mm with a 9.5 mm HDD?  I ask because the larger 7 mm HDD I can find

  • NTLDR is Missing - error

    HelloI have a Dell Inspiron 1525 running vista. He walks yesterday and get an error message "NTLDR is missing, press any key to restart." Then when you press a key, the error message keeps coming up Someone knows how to fix this? Thank youLee