find the length of the string

Hi all

I have a srting that contains two or more channels as for instance, it's my channel (think of this total string as one string) "Bronson, Ms. Jamie", "elder, Ms. Francis '.
Now I want to calculate the length of the string of replacement of commas and apostrophes with null.

Can someone pls help me with this?

Thank you
SQL>
  1  with t as (
  2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
  3  from dual)
  4  select * from t;

MYSTRING
------------------------------------------
'Bronson, Ms. Jamie','Elder, Mrs. Francis'  

SQL>
  1  with t as (
  2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
  3  from dual)
  4  select replace(replace(mystring, ',', null), '''', null) from t;

REPLACE(REPLACE(MYSTRING,',',NULL),
-----------------------------------
Bronson Ms. JamieElder Mrs. Francis

SQL> l
  1  with t as (
  2   select '''Bronson, Ms. Jamie'',''Elder, Mrs. Francis''' as mystring
  3  from dual)
  4  select length(replace(replace(mystring, ',', null), '''', null)) as string_len from t;

STRING_LEN
----------
        35  

Tags: Database

Similar Questions

  • I want to find the string "EMP1" procedures have this chain of the package

    Hi team,

    I have a package, the package, it has 70 technical acts, I want to find the string "EMP1" what procedures to have this channel under this package.
    If I use dba_source its name from package edition only. not to say about wise procedures in this package.
    can you please help here to find procedure under the package names because I analysis for all of the schema.

    Thanks in advance.

    Thanks and greetings
    Vincent

    Hello

    You can use the pl/sql program to do this by giving the name of the package as an input. It won't like your exact expectations. But of course, it will help you.



    DECLARE

    CURSOR c1 IS

    SELECT *.

    From all_source b

    WHERE upper (b.text) like '% EMP1% '.

    AND b.name = & nom_package

    ONLINE ORDERING;

    CURSOR c2 (ln_line NUMBER) IS

    SELECT *.

    From all_source one

    WHERE b.SID = & nom_package

    AND (UPPER (a.TEXT) LIKE '% FUNCTION %') OR UPPER (a.TEXT) LIKE '% PROCEDURE % '.

    AND a.line<=>

    ORDER BY desc line;

    lv_source all_source % rowtype;

    BEGIN

    I'm in c1 LOOP

    --

    OPEN c2 (i.line);

    Get INTO lv_source c2;

    dbms_output.put_line (' procedure ' | lv_source.) Line: ' text: ' | lv_source. (Text);

    CLOSE C2;

    --

    END LOOP;

    END;

    /




    Concerning

    Patrick Reddy.K

  • Find the string starts with a string and ending with a year

    Hi all

    I have the following situation.

    I'm in a string TVTdamacus LKK214/342009sstLKK
    I need to select the channel that begin withLKK and end a year. This year can be any year. In this case it is 2009, but it can also be 2012
    In this case the right string would be LKK214/342009
    Does anyone have an idea how I can do this.
    I thank in advance for your help is.

    --------------------------------------------------------------------------------
    Create table test (identification number, name varchar2 (100));

    Insert into test (id, name)
    values (1,'TVTdamacus LKK214/342009sstLKK ');

    Insert into test (id, name)
    values (2,'TVTdamacus LKK24/342012sstLKK ');

    I missed the 'between condition of 20 years' in the above query.

    Fix here...

    SQL> WITH test AS
      2  (
      3      SELECT 1 id,'TVTdamacus LKK214342009sstLKK' name FROM dual UNION all
      4      SELECT 1 id,'TVTdamacus LKK214341999sstLKK' name FROM dual UNION all
      5      SELECT 2 id,'TVTdamacus LKK24/342012sstLKK' name FROM dual UNION all
      6      SELECT 1 id,'TVTdamacus LKK214341989sstLKK' name FROM dual UNION all
      7      SELECT 2 id,'TVTdamacus LKK24344012sstLKK' name FROM dual
      8  )
      9  SELECT
     10      id,
     11      name,
     12      case when to_number(substr(REGEXP_SUBSTR (name, 'LKK[0-9]+[[:digit:]]{4}'),-4))
     13              between extract(year from sysdate)-20 and  extract(year from sysdate)
     14           then REGEXP_SUBSTR (name, 'LKK[0-9]+[[:digit:]]{4}')
     15           else null end newstr
     16  FROM test;
    
            ID NAME                          NEWSTR
    ---------- ----------------------------- -----------------------------
             1 TVTdamacus LKK214342009sstLKK LKK214342009
             1 TVTdamacus LKK214341999sstLKK LKK214341999
             2 TVTdamacus LKK24/342012sstLKK
             1 TVTdamacus LKK214341989sstLKK
             2 TVTdamacus LKK24344012sstLKK
    
  • find the string (QGREP) has stpped working utility

    Sir how I can solve this problm

    I found the solution, he proved it by myself and it works. Just download AVG tune up and introduce el cd key in the page and install it. Difficulty of all found ploblems and fix and restart the computer if you want and you will see which is fixed!

  • How to find the string of TextFrame and replace (CS3)

    I want to search the textFrame chain after that I want to replace it. How to do in CS3. can someone tell me.

    Search / replace is a single operation. Unless for a particular situation, you don't have to search first. (By the way, if you do search for first and store the results, they will no longer valid after the change.)

    Management texts related support 'findText' and 'changeText' methods, so this code snippet

    app.findTextPreferences = null;
    app.findTextPreferences.findWhat = 'something';
    app.changeTextPreferences.changeTo = 'something';
    Alert ("this is a" + app.selection [0].constructor.name ' ");
    App.Selection [0] .changeText ();

    works fine if you select a block of text and run.

  • How can I find the network name (SSID) and the chain of security for my network

    I have a wireless network with a printer on it - even if the printer is connected with a wire.  I want my laptop to be able to use the printer wireless to another room - instructions for putting in place early yb requiring the SSID and the security chain.

    Hi petetyler81,

    You can connect to the router manufacturer's website and make sure that the SSID and find the string, otherwise you can contact the manufacturer of the router and check.

    For more information, see the link:

    Setting up a wireless network

    http://Windows.Microsoft.com/en-us/Windows7/setting-up-a-wireless-network

    Hope this information is useful.

  • LgFilter Agent not exclude the strings

    I have a big problem with a logfilter agent, agent do not exclude a string, the goal is the following:

    I need tha the agent finds the string: GTM-E, but exclude the JTF-E-CLOSEFAIL chain, I have the following configuration:

    * Match list

    Correspondence: gravity JWGE-E error: criticism

    Exclusion list

    Correspondence: gravity error GTM-E-CLOSEFAIL: criticism

    The two strings have the same severity, but it continue fire alams, how second try I change the gravity on the Fatal exclusions list, but continue the problema, could you help me please.

    Thank you.

    David,

    With the help of Rick, we got it works.  Use

    . * GTM-E. *.

    for your match condition, and

    . * GTM-E-CLOSEFAIL. *.

    for your exclusion.  And it should work as you wish.

    I had already tried the '. '. * "s on the status of game, but it wasn't until Rick told me to add these on the match condition too that I succeeded in my tests."

    Jeff

  • Oracle Spatial function to find the closest channel line according to lat/long

    Hello

    Here's my scenario. I have a table that contains the geometries of type line (road network) channels. The line geomteries are of type Ohio state South (SRID 41104) plan.
    I have a requirement - given a lat/long, find the string line that aligns with this lat/long or the nearest set of strings of line at 0.02 miles.
    It is a typical example of an attempt to identify an accident on our road network situation. Accidents reported us in lat/long through the GPS system.
    How can I achieve this through any space function?

    Thanks for the help in advance.

    Thank you
    L.

    Hello L,

    SELECT
      r.
    FROM
      roadsegments r
    WHERE SDO_NN(r.geometry,
                 sdo_geometry(2001, 41104, sdo_point_type(lat,lon,NULL), NULL, NULL),
                 'sdo_num_res=2 distance=0.02 unit=mile') = 'TRUE';
    

    This will give you the two segments of road nearest you at 0.02 miles. See [url http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_operat.htm#i78067] documentation on the operator SDO_NN, especially the bit about the use of the index indicator.

    HTH,
    Stefan

  • Length of the string

    Hi all

    I intend to measure the length of the string and the length of the Arc in a gray-scale image. Please advise.

    You need to find to the first circle or outer circle?

    Part of Mathematics:

    The length of the rope of calculation, to find the RADIUS and the angle under which is seen in the center of the rope or perpendicular to the distance between the string and the center of the circle: once you have these settings, you can calculate the length of the rope using formulas:

    Source: http://www.mathopenref.com/chord.html

    Similarly, you can get for the length of the Arc: http://www.mathopenref.com/arclength.html

    Part of image processing:

    -I think that you can get the radius of the internal or external circle based on your requirement, using IMAQ detect forms.

    https://zone.NI.com/reference/en-XX/help/370281M-01/imaqvision/imaq_detect_shapes/

  • How to get the length of the string a vm?

    Hello

    I'm trying to automate some consolidation of virtual machines and would like to add script. I have over 800 virtual machines manually would not work.

    I would like to

    $allVApps = get-CIVApp

    foreach ($CIVm to ($allVApps |)) Get - CIVM)) {}

    find the number of channels and if greater than 8 consolidate them.

    }

    Someone has this practice? or something else?

    I'm in a cloud environment vSphere 5.5, installed latest powercli.

    Thank you

    Don't know why this does not work for others, but what I posted before work for me.  Here is a more complete version of how get the those of VAPP VM.  There are no doubt more direct ways, but that how I made it so far:

    1. get the VAPP

    $vApp = get-CIvApp-name 'Test-VAPP.

    2. get the VMS of vApp

    $VMs = $vApps.ExtensionData.Children.vm

    3. get the ones for the VM first in the list of $VMs:

    $VMs [0]. VCloudExtension.any.VirtualDisksMaxChainLength

    This last command returns 18 for me which is the "Length of the string" value in the properties of the Virtual Machine to the virtual machine in the vCD UI.

    I hope this helps.

  • find the number of underscores in a string

    Hi all -

    Is it possible to find the number of underscores in a simple string using SQL?

    Thank you-

    This?

    length (txt) -
           length (replace (txt, '_'))
    
  • How to find the size of the text string...

    Hi friends,

    How to find the size of the text, in KB or in bytes or MB, I have a text box control, when I type a text in do I find the size of the text that is entered control.please of entry help very urgent...

    Thnaks

    Balu-

    Hi David,

    Nice Solution, but I think that it will not give the exact size of the string for a particular case where the string contains UTF string as a single letter format can exceed more than 1 byte.

    So I think it should be modified as:

    private function getTextSize(value:String): String

    {

    var div_by:int = 100;

    var sze_is:String = 'KB ';

    var len_is:int = getUTFLength (value); now the length is actually measured, regardless of the format of the text

    If (len_is > 1000000)

    {

    div_by = 100000;

    sze_is = 'mb ';

    }

    Return(string(math.round(len_is/div_by)/10)+sze_is);

    }

    private void getUTFLength(value:String):int
    {
    var byteArray:ByteArray = new ByteArray();
    byteArray.writeUTFBytes (value);
    Return CharArray.Length;
    }

    Concerning

    -Vikash

  • Bug: Find/replace does not work if the statement contains the string is too long

    Hello

    in my sequence, I press Ctrl + F to open the Find dialog box and enter a string. All the checkboxes are checked 'Elements for search' and ' limit the search to "is not enabled.

    Now comes the finding it is only announcing the discovery in the main sequence.

    Other places in a sous-suite that are part of a labview vi action setting is not in the list. Also if I open the sequence and I'm looking at this place.

    If I create a comment in the subsequence containing the searchstring, then it is.

    When I open the properties of the action of labview and open the parameter that contains the string and click on check for errors, and then close all and supplementary search then the value lies.

    Is it possible that the variable is too long setting? It's about 200 characters and one thing very nested SationGlobals and the table and the TestSockets. Search string Dees is finally an arrayindex in this grand statement.

    It seems that this is the problem.

    Is this a known bug?

    Solved.

    There was an empty character at the end of the search string...

  • How to find the bytes in hexadecimal string start

    Hi, I'm a freshman for Labview.

    I want to find the beginning bytes in Hex string. For example, 12 1A 00 34 1A 01 23... How can I get my data of 3 bytes of the hexadecimal string which starts at 1 'a '?

    Thank you for your help.

    You will need to provide more information. You have a string that has values of bytes like this? In other words, you have the control/indicator string value "hex display mode", and that you have provided, that's what you have? Or, you have the string in normal view?

    If it is in hexadecimal display mode, then use one of the functions of the chain to get a subset of the string. Have you looked in the channel palette?

    If it is in normal display mode, then you must convert all 2 characters to hex values.

    To learn more about LabVIEW, it is recommended that you go through the tutorials and look over the material in tutorials the NI Developer Zone Learning Center , which provides links to other materials and other. You can also take a course online for free.

  • EXCEL ActiveX + error '-2146827284' (but not the string length limit)

    Hi all

    First of all thanks for your help!

    I have a strange error with excel activeX: "-2146827284!"

    Why strange? Because my export feature works perfectly on a computer but not on another... (both are windows 7 + Excel 2007)

    How my application works:

    I have to read an excel spreadsheet which preserves made with different types of instruments of measures.

    For each type of instrument, I have to create a specific worksheet with its measures.

    For example:

    1 spreadsheet excel with the many measures of 4 different types of instruments

    SHOULD GIVE

    4 excel spreadsheets containing the measures of each instrument (1 worksheet for a type of instrument).

    Hope I am clear...

    Why I do with LV? Because it's fun!

    Now that some snapshoot.

    1 - where the bug appears :

    2 - the message I get (translated from french to English):

    Additional information:

    -The size of the string I have write in excel cells is 6 characters max. More I put a condition to return an error if the string length is > 900 characters.

    Thanks a lot for your help!

    SO simple...

    It was just the name of the folder...

    I coded the name of the folder as a constant aim dev. And I do not mind that the name of the folder is not the same on both computers!

    "a missing letter = a week closed.

    Arrrgh

    all sorry to bother you

Maybe you are looking for