How to choose the value of a string are numeric together and words of letters (for example, TEST)

Hi all

How to choose the value of a string are letters (for example, TEST) and all numeric...

for example
TEST 123456
TEST 34567
123456 ABCD
1234 TEST
TESTING 12345
TEST 1@234$
YOUR T 123456

I want the results of the query as below.
TEST 123456
TEST 34567

And I tried to use regexp_like in this case but without success. See the code below.
SELECT * FROM TABLE WHERE regexp_like (Description, ' [TEST] % & [[: digit:]] + $');

How can I do this, please answer.

Thank you

WF

If you want to return only the rows that contain the string 'TEST', followed by zero or more space characters, followed by one or more digits?

How about this:

SELECT *.

FROM my_table

WHERE REGEXP_LIKE(description,'^TEST\s*\d+$')

Tags: Database

Similar Questions

  • How to check the value of a string is numeric, alphanumeric or characters?

    Hi all
    I have a task to validate an employee ID, assume that the employee Id is E121212. Now according to the validation rule, I need to check "the first letter of the employee Id is a character and rest are numbers." How can I do this? Please answer.



    Thanks and greetings
    Marie Laurence

    Hello

    You can opt for regexp_like in this case. See the code below

    with data as (
      select 'E121212' s from dual union all
      select '121212' from dual union all
      select 'EE121212' from dual union all
      select 'EE1212EE' from dual union all
      select 'É121212' s from dual
    )
    
    select
    *
    from data
    where
    regexp_like (s, '^[A-Z]\d+$')
    
    S
    E121212 
    

    ^ [A-Z] means that, at the beginnign (^), should be only between A - Z characters, uppercase. If you want to add lowercase letters, you can easily replace it [A-Za-z]. \d is a symbol for the numbers and + means it must complete at least one or more of her. $ means the end, so he stayed there until the end but nothig figures.

    If yoou want characters as allowed, you can change the character class to [: alpha:]

    select
    *
    from data
    where
    regexp_like (s, '^[[:alpha:]]\d+$')
    
    S
    E121212
    É121212 
    

    concerning

    Published by: chris227 on 26.07.2012 00:53
    fix

  • How to get the value of a string

    I have a problem where I am suppose to determine the value of a

    variable.

    However at the time of the design, I don't know the name of the variable.

    During execution, the name of the variable will be given and based on the

    given the name of the variable, I need to find the value of the specified

    the name of the variable.

    DECLARE

    NOM_DE_VARIABLE VARCHAR2 (1000);

    VARIABLE1 VARCHAR2 (1000): = 1;

    VARIABLE2 VARIABLE2 (1000): = 2;

    BEGIN

    NOM_DE_VARIABLE: = 'VARIABLE1 ';

    END;

    In the example above of the VARIABLE_NAME value is 'VARIABLE1 '.

    That's why I need to return a value of '1'.

    And if the VARIABLE_NAME is 'VARIABLE2', then the return value

    would be '2'.

    I know that this can be done using simple if else, however if the number of

    Variables is unknown or very large.

    So if on the other would not.

    Please advise, thank you

    The instinctive reactions are WTF!

    This is NOT how a codes in ALL languages - address variables directly and dynamically.

    But in PL/SQL, horribly enough, can be done using associative arrays.

    SQL > declare
    2 type TVariableContainer is table of indexes varchar2 (4000) by varchar2 (30);
    3
    var 4 TVariableContainer;
    5 varName varchar2 (30);
    6 start
    7 put variables into the container
    8 ('variable1') var: = 1;
    9 ('variable2') var: = 2;
    10
    11 set the name of a variable
    12 - a variable in the container
    13 varName: = 'variable1 ';
    14 dbms_output.put_line ('varName "variable1" variable value");
    15
    16. now solve this problem by assigning the
    17 - value of container that him
    18 varName: = var (varName);
    19 dbms_output.put_line (' varName is value ['| varName |']) ' );
    20
    21 - repeat
    22 varName: = 'variable2;
    23 dbms_output.put_line ('varName variable 'variable2' value');


    24 varName: = var (varName);
    25 dbms_output.put_line (' varName is value ['| varName |']) ' );
    26 end;
    27.
    varName variable value "variable1".
    varName is value [1]
    varName variable value "variable2.
    varName is value [2]

    PL/SQL procedure successfully completed.

    SQL >

  • How to capture the data of type string with agent script and then compared to an alarm

    Hello...

    How to capture the string with agent of script data and then create a rule to compare the string data to generate alarm?

    Thank you!...

    Start here:

    http://en.community.Dell.com/TechCenter/performance-monitoring/Foglight-administrators/w/Admins-wiki/6155.custom-script-agent-1-leverage-an-existing-monitoring-script-to-push-data-into-Foglight

  • How to choose the value null

    Hi all

    I use oracle 9i.
    I have a Book table and there column: book_id, book_name, book_rating etc.
    Books are rated on a scale of 1 to 10, and the database is associated with a book.
    There are books that are not yet rated and these recordings has a null value in this column to book_rating.

    I want to write a cursor that can browse this book_rating.
    I started with a loop for iteration of 1.10 (because I in 1.10 loop)
    and in this loop, I declare my cursor and where clause wrote:

    where book_rating = i;

    This condition will take care of the sides with a value of 1 to 10, but this custom work for null values.

    How can I write this code so that I can understand the books that are not rated so far (null in the column book_rating)?

    Thank you

    Will be something like this help

    FOR I IN 0..10
    LOOP
         SELECT ..
           FROM ..
          WHERE NVL(BOOK_RATE,0) = i;
    END LOOP;
    
  • How to show the value Color Picker (drawing area)

    Hi all

    How to make a Color Picker selection guide the user can see the selected color? In my example - the color selected by Color Picker must paint the place. All variants? Preferably with Dom.

    var wColor= new Window('dialog', ' ');
        wColor.orientation = "column";
        wColor.alignment="top";
        wColor.spacing=0;
            wgr1=wColor.add('group');
            wgr1.orientation = 'row';
            wgr1.alignment='top';
                btnRGB1= wgr1.add('button',undefined,'RGB');
                btnRGB1.preferredSize = [50,20];
                p1 =  wgr1.add("panel", undefined, "", {borderStyle:"silver"});
                p1.preferredSize = [22,22];
            wgr2=wColor.add('group');
            wgr2.orientation = 'row';
            wgr2.alignment='top';
                btnRGB2= wgr2.add('button',undefined,'RGB');
                btnRGB2.preferredSize = [50,20];
                p2 =  wgr2.add("panel", undefined, "", {borderStyle:"silver"});
                p2.preferredSize = [22,22];
    
        btnRGB1.onClick = function(){//-------------------------------------------------------
            app.showColorPicker();
        }
        btnRGB2.onClick = function(){//-------------------------------------------------------
            app.showColorPicker();
        }
    
    
    wColor.show()
    
    

    Try this:

    #target photoshop

    color1 = new SolidColor() var

    var Color2 = new SolidColor()

    var wColor = new window ("dialog", "");

    wColor.orientation = "column";

    wColor.alignment = "top";

    wColor.spacing = 0;

    wgr1 = wColor.Add ('group');

    wgr1.orientation = "row";

    wgr1. Alignment = 'top';

    btnRGB1 = wgr1.add ('button', undefined, 'RGB');

    btnRGB1.preferredSize = [50,20];

    P1 = wgr1.add ("panel", undefined, "", {borderStyle: "money"});

    P1. PreferredSize = [22,22];

    wgr2 = wColor.Add ('group');

    wgr2.orientation = "row";

    wgr2. Alignment = 'top';

    btnRGB2 = wgr2.add ('button', undefined, 'RGB');

    btnRGB2.preferredSize = [50,20];

    P2 = wgr2.add ("panel", undefined, "", {borderStyle: "money"});

    P2. PreferredSize = [22,22];

    btnRGB1.onClick = function() {/ /-}

    app.showColorPicker ();

    Color1. RGB. Red = app.foregroundColor.rgb.red

    Color1. RGB. Green = app.foregroundColor.rgb.green

    Color1. RGB. Blue = app.foregroundColor.rgb.blue

    g = p1.graphics;

    myBrush var = g.newBrush (g.BrushType.SOLID_COLOR, [color1.rgb.red/255,color1.rgb.green/255,color1.rgb.blue/255, 1]);

    g.backgroundColor = myBrush;

    try {App.foregroundColor = color1}

    {catch (e)}

    try {App.BackgroundColor = 2}

    {catch (e)}

    }

    btnRGB2.onClick = function() {/ /-}

    app.showColorPicker ();

    color2. RGB. Red = app.foregroundColor.rgb.red

    color2. RGB. Green = app.foregroundColor.rgb.green

    color2. RGB. Blue = app.foregroundColor.rgb.blue

    g = p2.graphics;

    myBrush var = g.newBrush (g.BrushType.SOLID_COLOR, [color2.rgb.red/255,color2.rgb.green/255,color2.rgb.blue/255, 1]);

    g.backgroundColor = myBrush;

    try {App.foregroundColor = color1}

    {catch (e)}

    try {App.BackgroundColor = 2}

    {catch (e)}

    }

    wColor.show)

  • How to replace the value of a column in a table based on the value in the second column?

    Hi, I would like to find in a table 2D for values that meet certain criteria (for example, a column< 0.98).=""  based="" on="" which="" rows="" meet="" this="" criteria,="" i="" want="" to="" replace="" the="" values="" in="" a="" different="" column="" of="" the="" array="" (change="" to="" 'nan'="" so="" that="" the="" values="" will="" not="" be="" included="" in="" any="" calculations="" on="" that="" column,="" for="" example="" the="" finding="" the="" mean).=""  i've="" attached="" a="" sample="" .csv="" file.=""  if="" the="" values="" in="" column="" 3="" (index="" 2)="" are="" less="" than="" 0.980="" (or="" some="" other="" user="" defined="" value),="" then="" the="" value="" in="" column="" 2="" (index="" 1)="" should="" be="" replaced="" with="" nan.=""  can="" someone="" help="" out="" with="" this="" search="" and="" replace="">

    Thank you

    Keith

    (using LV 2009 SP1)

    A few quick hits.

    You can merge the two for loops

    You have not need one of the constants 1 and 2 in the index table.  They will solve automatically when you expand on the index picture, once you have wired to 0 in the column index.

    It seems a lot of handling additional table spent unnecessarily.

    See below.  I did not try to duplicate your code to see how it actually works, but I believe that I have attached will give the same result with less steps.

  • How to retrieve the value of a measure over a period determined using VROPS 6.1?

    Hello!

    Is it possible to extract a metric, using supermetrics for example or any other means, the value of a measure over a period of time?

    For example, I will pick up average CPU usage of my VMs during the last hour with VROPS 6.1?

    How could I do that please?


    Concerning

    Unfortunately, you are just such a feature (apply the calculation over a period of time) is not supported.

  • How to connect the value of the input string to numeric values

    Hello

    I'm trying to figure out how to connect the value of unique user input string to numeric values. Basically I want the user to enter the name of a gas that I have a list for (I think I put the list of gases in a table >). Then I want to match numeric values 2 'a' and 'b', according to which gas, name of the user has set. These 'a' and 'b' values will be automatically matched with the name of the gas in a list that I put. For example, hydrogen gas has the value 3 for "a" and 4 for "b. when the user puts the ' hydrogen' name in a string constant, automatically 'a' and 'b' must be issued.» I have connect a and b to a formula

    Thanks for any help

    Hello

    It is perhaps not exactly what you are looking for, but perhaps you could use the enumerated data type and the array of clusters of points (a, b).

    Look at the VI I enclose.

  • How to get the value of a variant as a string

    I have an existing codebase, which transmits the values of the user interface to business logic as variants. I was prompted to connect all values passed in this way in a text file. I'm trying to figure out how to get the data as a string to a Variant value without having to deal on the type for the data descriptor. The flag variant the fact, so I think I can, too.

    Anyone know how?

    Thank you, all! I decided to use the XML approach:

  • How to choose the textfield values form and calculate

    Treat all

    Urgent please help

    How to choose the textfield values form and calculate totals. IE when clint fill amount textfield other textfields automatically calculate and display values. I am using uninstall.

    Thanks in advance

    My code is more

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 "/ >"

    < title > Untitled Document < /title >

    < / head >

    < body >

    < table width = "400" border = "0" align = "center" cellpadding = "0" cellspacing = "0" >

    < tr >

    < td width = "187" align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "amount_gbp" > total (GBP): < / label >

    < / strong > < table >

    < td width = "14" height = "30" > < table >

    < td width = "199" height = "30" > < label >

    < input type = "text" name = "textfield" id = "textfield" / >

    < / label > < table >

    < /tr >

    < tr >

    < td align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "admin_char_gbp" > Admin amount (GBP): < / label >

    < / strong > < table >

    < height td = "30" > < table >

    < height td = "30" > < label >

    < input type = "text" name = "textfield3" id = "textfield3" / >

    < / label > < table >

    < /tr >

    < tr >

    < td align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "agent_char_gbp" > Agent Charges (GBP): < / label >

    < / strong > < table >

    < height td = "30" > < table >

    < height td = "30" > < label >

    < input type = "text" name = "textfield4" id = "textfield4" / >

    < / label > < table >

    < /tr >

    < tr >

    < td align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "total_amount_gbp" > amount Total (GBP): < / label >

    < / strong > < table >

    < height td = "30" > < table >

    < height td = "30" > < label >

    < input type = "text" name = "textfield6" id = "textfield6" / >

    < / label > < table >

    < /tr >

    < tr >

    < td align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "total_paid_gbp" > Total paid (GBP): < / label >

    < / strong > < table >

    < height td = "30" > < table >

    < height td = "30" > < label >

    < input type = "text" name = "textfield7" id = "textfield7" / >

    < / label > < table >

    < /tr >

    < tr >

    < td align = "right" valign = "middle" class = "KT_th" > < strong >

    < label for = "balance_gbp" > balance (GBP): < / label >

    < / strong > < table >

    < height td = "30" > < table >

    < height td = "30" > < label >

    < input type = "text" name = "textfield8" id = "textfield8" / >

    < / label > < table >

    < /tr >

    < /table >

    < / body >

    < / html >

    Here´s a pointer which will show you how to set the calculation within a javascript function: dynamically calculate the sum of the fields

    See you soon,.

    Günter

  • How to change the value of string clustered, to implement using the node value of property instead of writing directly on the flow of data or using the variable

    new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture.   No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.

    Hi GerdW

    Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases.  Now I want to insert user event by changing the control and influential cases during run time.

    As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well.  But then, I found there are a lot of screws that are using the string unbundle.  One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.

    I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.

    I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?

    Mant thanks!

    Minyi

  • How to find the value?

    How to calculate the value of 2.50e + 2 in the analysis of string function when the %f format string is selected?

    the format may be stung a control

  • How to get the value of the TextField on Buton FieldChangeListener

    friends I am new on the development of blackberry applications could you please help me how to get the value of text I typed in the textField when I click the button?

    constructor

    public Dialogs()
    {
      
    using design in the same screen
      
    Display display = new MainScreen();
      
    ButtonField btnPress = new ButtonField();
    btnPress.setLabel ("press me");
    btnPress.setChangeListener (ButtonPressListener);
      
    TxtValue TextField = new TextField();
    txtvalue.setLabel ("enter something :");
      
    HFM VerticalFieldManager = new VerticalFieldManager (VerticalFieldManager.FIELD_VCENTER);
    HFM. Add (txtValue);
    HFM. Add (btnPress);
      
    mainScreen.add (hfm);
    pushScreen (mainScreen);
      
      
    }

    FieldChangeListener ButtonPressListener = new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
        
           
    Dialog.Alert (t.GetText ());
         
         
         
    }
    };

    any help would be appreciated.

    You must ensure that your FieldChangeListener has access to the object of txtvalue, while it can make a

    String inputString = txtvalue.getText ();

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

Maybe you are looking for