Check name field with RegEx

Hi,
Regular Expression is something new to me, and I understand it in it's basic explanation form.
Anyways, I have a table with a first name column, and a last name column.
The table has over a million records, anyways, I started to do something, but then I got confused.
select name_first from schema.table
where REGEXP_LIKE(name_first, [a-zA-Z]*);
So what I wanted to do is scan the name first, and name last to make sure that only legal characters were used, there should be no spaces, no numbers, and no other crazy stuff, so I would like to do a Select Statement and return anything that looks weird and if nothing weird matches, do nothing.
Any help would be appreciated.
Thanks

The query you were using is not correct. It will not return any row because it basically say find any string that don't have a-z and A-Z anywhere in it.
Example,
TEST@rman> l
  1   with t as (select 'ttt' val from dual
  2  union all select '%6gg' val  from dual
  3  union all select 'thisD' val from dual
  4  union all select 'L*;' val  from dual
  5  )
  6  select * from t
  7* where not REGEXP_LIKE(val,'[a-zA-Z]*')
TEST@rman> /
no rows selected
-- The correct one is
  1   with t as (select 'ttt' val from dual
  2  union all select '%6gg' val  from dual
  3  union all select 'thisD' val from dual
  4  union all select 'L*;' val  from dual
  5  )
  6  select * from t
  7* where not REGEXP_LIKE(val,'^[a-zA-Z]*$')
TEST@rman> /
VAL
%6gg
L*;
Or
  1   with t as (select 'ttt' val from dual
  2  union all select '%6gg' val  from dual
  3  union all select 'thisD' val from dual
  4  union all select 'L*;' val  from dual
  5  )
  6  select * from t
  7* where not REGEXP_LIKE(val,'^[[:alpha:]]*$')
TEST@rman> /
VAL
%6gg
L*;

Similar Messages

  • Predefault "User Name" field with Login Name

    Hi,
    Predefault in "LS Medical User Verification" BC does not work. I tried to do the following but all did not work:
    * Put a predefault value in the "User Name" field, System: Creator
    * Create a calc field "SCR Login", calc value: LoginName (). Set predefault of "User Name" field, Field: 'SCR Login"
    * Expose "SCR Login" in the applet. Field is blank in UI.
    We are using the vanilla "LS Medical User Verification Applet" for user verification and we want to predefault the User Name field with the current user logged in. How can I achieve this?
    Thanks,
    Jasmin

    Hi,
    I believe Predefault/Postdefault will only work with NewRecord even and since the User Verification Popup Applet does not go to that event on load that is why it does not work.
    Since the client wanted to default the user name with the current user logged in, we just removed the User name field from the popup applet and pass the TheApplication().LoginName() to the Authentication Business Service.
    Thanks,
    Jasmin

  • Performance on searching a name field with the like clause

    Hi.  We run 2012 std and I suspect we'll be running into challenges as my user has expressed an interest in searching data based on a like clause across a contact name column that is varchar(80).  The like clause is shown below.  The
    question is whether or not an index on this column will (if we make one) even be used when a like clause is introduced?  And any other advice the community may offer.  I'll ask my user if they could limit the search to patterns that match starting
    in position 1 but suspect they'll say no.  Currently the table has 1.5 million rows , one pk, and is approx 1100 bytes wide if varchars are fully used.
    where ltrim(rtrim(e.[ContactName])) like '%' +IsNull(@contactName1,'') + '%'

    Hi.  We run 2012 std and I suspect we'll be running into challenges as my user has expressed an interest in searching data based on a like clause across a contact name column that is varchar(80).  The like clause is shown below.  The
    question is whether or not an index on this column will (if we make one) even be used when a like clause is introduced?  And any other advice the community may offer.  I'll ask my user if they could limit the search to patterns that match starting
    in position 1 but suspect they'll say no.  Currently the table has 1.5 million rows , one pk, and is approx 1100 bytes wide if varchars are fully used.
    where ltrim(rtrim(e.[ContactName])) like '%' +IsNull(@contactName1,'') + '%'
    Hi db042190,
    >> The question is whether or not an index on this column will (if we make one) even be used when a like clause is introduced?
    A simple index use an exact value in order to compare it (it orer the tree according to the value). For most cases it will not be a good solution for filtering by "like" (in some cases it can help you use "index scan", but it will not
    be able to use "index seek"). There are several options that can help in this issue dapending on your interface and the way you use the data:
    (1) Full Text Index as Olaf mentioned
    (2) Another option, which is very useful in some cases, based on using an external table, which store list of searching words (if the user try a new search then you can scan the original table, which this is one-time-job for each new word). This is actually
    work on the same idea of using FTS, but it is more flexible and give you direct control if you need to use word searching and not phrase/free-text searching. This table is indexed and the search is done on this table, and not the original table. Those two
    tables have relations many-to-many, and you use a simple JOIN to get the results 
    >> limit the search to patterns
    This can be a game changer!
    There is a simple solution that might help you in this case which is very useful! you can create a computed column that store the value according to your patterns, and then create index on that
    column. For example if the your pattern is filter by "starting with 10 specific char" then you can use simple LEFT function like in this code:
    CREATE TABLE t (LongText nvarchar(MAX), MyPatSearch as convert(nvarchar(10),LEFT(LongText,10)));
    GO
    CREATE NONCLUSTERED INDEX IX_MyPatSearch ON t (MyPatSearch);
    GO
    * using computed column with string like in this example, you have to use CONVERT since Data type is requirements for index computed column.
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Requesting help in splitting name field

    I'm moving from my CRM Goldmine to another CRM.  Goldmine keeps the name in the "Name" field with both first and last name.  The new CRM keeps is name in two fields: "Firstname" & "LastName"
    I have my data in an Access Database.  How can I split the name to get the the first name separated from the lastname.
    For example:  How do I split "John Smith" in one column into two columns "John" & "Smith"
    Thank you for all your help.
    Karolus

    With great difficulty.
    John Smith is easy.  Treat it as a space delimited list.  The problem comes with names like John Paul St Pierre.
    If this was my problem, I'd probably do the simple ones automatically and the complicated ones manually, as long as there weren't too many of them.

  • Removing punctuation in last name field

    Hi all,
    I have to write an API to an email system which does not accept punctuation as part of the mailbox. One of the fields I am using to build the mailbox is the persons last name. The problem I am experiencing is the use of punctutation in the last name field with individuals that have names for example like O'Leary, O'Shea, Baker-Newbie, etc... How would one write the syntax to remove punctuation from a column?
    Thanks,
    Mike

    I would consider the Oracle TRANSLATE function:
    How you do things depends on what you want to do with the punctuation characters. If you are going to omit then:
    TRANSLATE(last_name,
    'ABCDEFGHIJKLMNOPQRSTUVWXYZ!£$%',
    'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
    or something like it (just add the characters to omit to the end of the 'from' string) take care to escape any quote symbols in your from string.

  • Strange problem while checking Mandatory fields

    Hi ,
    I am checking mandatory fields with the method following method.
    CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( VIEW_CONTROLLER = my_controller ).
    It was working fine for mandatory fields and also showing one extra input field which is not mandatory with red border .
    Please tell me how to avoid this and What could be the problem.
    Thanks and Best Regards,
    Vijay

    Hi Vijay,
                the extra vield thats showing in re d will be a field that doesnt support blank entry. try commenting the method thats calling CL_WD_DYNAMIC_TOOL.
                CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW will check only mandatory fields.. thats for sure.
       the error message thats showing on the optional fild is coming from some standard check
    Regards
    Sarath

  • Hiding fields with same name

    Hi,
    I have a form built in ADOBE LC Designer ES. The form has multiple pages. I have some fields with the same name and distributed across subforms. Is there a way I can hide the fields using the common name or do I have to refernece each and every field to hide it?
    Thanks,
    Nakul

    Is the condition for hiding the fields the same in every case, i.e. a checkbox being checked? If it is, you could put the same script in each field:
    if (checkbox1.rawValue == 1){
         this.presence = "hidden";
    You would still have to either paste the script into each field or make it a function that gets referenced in each field, but at least it would be a copy - paste rather than having to type out the path to each field.

  • Lsmw error - no fields with the same name

    Dear Experts,
    I am trying to upload master data through LSMW through Standard Batch/Direct Input but when i am executing the step READ DATA it is throwing me error as
    File 'C:\Documents and Settings\Guest\Desktop\DMS.TXT' and source structure 'ZEQUI_STRUTURE' have no fields with the same name.
    Even though i cheked my flat file in notepad i used the following field for it
    AEDAT
    EQTYP
    SHTXT
    EQART
    GROES
    ERDAT
    ANSDT
    ANSWT
    WAERS
    HERST
    HERLD
    TYPBZ
    BAUJJ
    BAUMM
    SERGE
    SWERK
    STORT
    BEBER
    GEWRK
    ABCKZ
    EQFNR
    BUKRS
    ANLNR
    KOSTL
    IWERK
    INGRP
    TPLNR
    HEQUI
    Regards,
    Rip.
    Edited by: Julius Bussche on Jan 20, 2009 11:04 AM
    Please use meaningfull subject titles

    Hi Ripel,
    When you are assinging a file if it has field names in first row then select "Field names at Start of file", if not names then uncheck the box at "File Structure".
    If fields are using, then check the tabulator in file and Uncheck the "Field order matches Source structure Definition."
    Regards,
    Sunil
    Edited by: Sunil Reddy Sibbala on Jan 20, 2009 11:10 AM

  • Check boxes, name fields, and interactivity in Acrobat/InDesign

    I posted this in the InDesign forum and am lead to believe it is impossible to do through InDesign...
    [quote]
    We are a high production print shop and do most of our proofing via PDF. We email the customer a PDF and they print it out, show it to their customer, mark changes, and fax it back to us. We'd like to start letting the customers email their proofs back to us with a check box marked for either OK or Changes Needed, as well as a place for a name and date.
    It appears that InDesign will not do this natively. I can make Acrobat do this, no problem. What I tried to do was to take a PDF of the "Proof OK" box with the check boxes and name fields and drop it into InDesign in hopes that the embedded PDF would hold it's interactive capabilities. It does not.
    Is there a way to make this work like I need without a bunch of scripting in a language I don't know well? Taking the hundred or so proofs each day and manually making them interactive PDFs is not really an option for obvious time reasons.
    Thanks,
    Mike
    [/quote]

    I thought you could create form fields in InDesign that would carry over to the PDF...
    But if you can't, you could (get someone to) create a batch process that adds the required fields. It wouldn't cost much. ;^)
    George

  • How can I have two fields with the same name if it makes sense?

    Hello, folks :)
    I have a pretty hard time figuring out how I can have two text fields with the same binding name.
    The whole problem is that when I need two fields with the same binding name they are still differnent coz they have the same name but differnt indices.
    I should make a form filled at runtime by merging a pdf form file and an fdf file data file. And I have no choice to do it differently. And my form file needs some data like customerName, companyName twice in one form. But there's only one possible buinding name indexed zero.
    How can I create a field with absolutely the same name or is it just impossible due to possible name conflicts? And is there a workaround to this problem? I just need one piece of data repeated in different places.
    Thanks for your replies :)
    P.S. if u think that the problem is not clear enough let me know. I'll supply you with more details. But the general process can not be changed.
    One pdf should be mergred with an fdf with as the result of their merge a new filled and flattened form. I have no control over fdfs their are generated by Oracle and I can not fill the form using XML files coz this process should be integrated in a working application.

    I just thought about a really ugly workaround with a server-side script adding values to fdf files but it's a bit of work and tests and personally i think it's a bad idea :-(

  • How to allow user to select pdf file on local machine and populate field with file name only

    Folks,
    I have a project requirement that I am stumped on.  I am admittedly a novice, so forgive questions that may seem obvious.
    My requirement is a form running on a client system where the user can click a button and select a PDF file name from a PDF on their local machine and then populate a form field with that file path & filename.  The file names vary between all machines, so there is no static list.  Note that the PDF is not embedded, nothing is executed, I simply need the file name.
    There are several of these on a form (20+), so manual name entry is too error prone.   I would like to use a 'browse' type dialog, but can not figure out how to implement it.
    I've looked at app.browseForFile, but the users can not install a javascript file in their adobe folder or any other files;  the functionality has to be integral with the original PDF. 
    Functionally, this is no different from the image object file browse, except that I need a PDF instead of an image file, so there doesn't seem like there should be a security issue that is any different from those surrounding the image object.
    I've been stumped on this for the entire week, and I have a deadline rapidly approaching, so any examples or suggestions (please remember I'm a novice) would be greatly appreciated! 

    Thanks for the reply Paul - do you have any sample code of how to attach the PDF?  Or how the user can select a PDF to open?  I might be able to attach it, retrieve the file name, and then un-attach it.
    Alternatively, do you know how to retrieve the file name from the imagePath object?  It will let you select PDF files, but I can't find info on how to retrieve the file name.   It should be the way you would retrieve the file name for an image.
    As a novice in this, thanks for your help and patience!

  • The field "GLTPC" is unknown, but there is a field with the similar name*

    Hi all
    When i am running the report painter reports in SAP
    i am getting this error .
    Syntax error in program    SAPFGRWG
    in include                  FGRWGE60
    in line                      19
    Last changed by            SAP
    Author                     SAP
    The field "GLTPC" is unknown, but there is a field with the similar name
    "GLTPC".*
    Please help me whenever
    Regards,
    suchithra
    Edited by: Rob Burbank on May 22, 2009 9:00 AM

    Hi All
    All 8A group Report painter reports i.e GLPCt table Reports are not executed properly
    Can you please help me out
    Regards,
    suchithra

  • Hiding Fields with the same name

    I have multiple fields across a form with the same name
    TxtName#1
    TxtName#2
    TxtName#3..... TxtName#24
    They are all share the same name because they should all have the same data.
    I want to be able to hide some of these fields, based on the number entered in another field TxtQty.
    for example if TxtQty=2 then
    TxtName#3-TxtName#24 will be hidden and only TxtName#1 and TxtName#2 will be visible.
    Can anyone please help?
    Thanks!

    The easiest way is to rename TxtName #1 and #2 to "TxtName2", and use the following custom Validate script for each:
    // Copy this field's value to the TxtName fields
    getField("TxtName").value = event.value;
    You can then hide all of the TxtName fields with:
    getField("TxtName").display = display.hidden;

  • Set "peoples or groups" field with current user "login name" in sharepoint list form using javascript

    hi friends
    i am trying to set peoples or groups field in sharepoint  list form with current user login name
    here my code
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    $(document).ready(function NewItemView () {
    var currentUser;
        if (SP.ClientContext != null) {
          SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
        else {
          SP.SOD.executeFunc('sp.js', null, getCurrentUser);
        function getCurrentUser() {
          var context = new SP.ClientContext.get_current();
          var web = context.get_web();
          currentUser = web.get_currentUser();
          context.load(currentUser);
          context.executeQueryAsync(onSuccessMethod, onRequestFail);
        function onSuccessMethod(sender, args) {
          var account = currentUser.get_loginName();
          var accountEmail = currentUser.get_email();
          var currentUserAccount = account.substring(account.indexOf("|") + 1);
        SetAndResolvePeoplePicker("requester",account);
    // This function runs if the executeQueryAsync call fails.
        function onRequestFail(sender, args) {
          alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
     function SetAndResolvePeoplePicker(fieldName, userAccountName) {
       var controlName = fieldName;
        var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
        var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
        var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
        peoplePickerEditor.val(userAccountName);
        spPeoplePicker.AddUnresolvedUserFromEditor(true);
    </script>
    but it is not working
    please help me

    Hi,
    According to your post, my understanding is that you wanted to set "peoples or groups" field with current user "login name" in SharePoint list form using JavaScript.
    To set "peoples or groups" field with current user "login name”,  you can use the below code:
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    function SetPickerValue(pickerid, key, dispval) {
    var xml = '<Entities Append="False" Error="" Separator=";" MaxHeight="3">';
    xml = xml + PreparePickerEntityXml(key, dispval);
    xml = xml + '</Entities>';
    EntityEditorCallback(xml, pickerid, true);
    function PreparePickerEntityXml(key, dispval) {
    return '<Entity Key="' + key + '" DisplayText="' + dispval + '" IsResolved="True" Description="' + key + '"><MultipleMatches /></Entity>';
    function GetCurrentUserAndInsertIntoUserField() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
    Function.createDelegate(this, this.onFailure));
    function onSuccess(sender, args) {
    SetPickerValue('ctl00_m_g_99f3303a_dffa_4436_8bfa_3511d9ffddc0_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', this._currentUser.get_loginName(),
    this._currentUser.get_title());
    function onFaiure(sender, args) {
    alert(args.get_message() + ' ' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(GetCurrentUserAndInsertIntoUserField, "sp.js");
    </script>
    More information:
    http://alexeybbb.blogspot.com/2012/10/sharepoint-set-peoplepicker-via-js.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Linking/Grouping Text Fields with a Check Box Field

    Disclaimer: I know nothing about coding/scripting in Acrobat (or in any language, for that matter).
    I have 4 sets of text fields, call them A, B, C, and D. All of the fields in set A will have a value entered. There are 10 fields in set A while sets B, C, and D may have as many as 104. Sets B, C, and D will always have a one-to-one-to-one correspondence with each other (B1 is associated with C1 and D1 only and so on). My dilemma/desire is two fold:
    First:
    I want to be able to group 3 to 4 of the fields in set C if I tick a check box/radio button/whatever field type works. When the fields are grouped, I want their values to be the same within the grouping. These fields should also be ungrouped when the marker field is unchecked/deactivated. No field will ever be in any more than one group.
    Second:
    I want values for set B to equal a value of set A if there is a value entered in that B's corresponding C field.
    Please don't hesitate to point out where I can make any of this clearer.
    Thank you in advance,
    Joseph
    P.S.
    If one or both of these is not doable in Acrobat, would you please kindly point me to a program that can do this?

    Steve,
    Sorry, I referenced InDesign and this file was created in Illustrator. (I have been working with numerous files created in both InDesign and Illustrator, with numerous challenges). I do not have the native document nor Illustrator software, only Acrobat. When I previously loaded the InDesign-created pdf file(s) into Acrobat, I was unable to use the Text TouchUp Tool because I do not have the fonts on my system that were used to create the documents in InDesign, thus I am denied access to the text. With this file, created in Ilustrator; I assume because the text resides within the image created that encompasses the entire page, the Text TounchUp Tool and Object Tool have no response when I click on the page after activating the tools with a click, although the Tool Bar allows me to click on the icons to activate the functions.
    I have read elsewhere that InDesign and Illustrator files are exported as images, thus requiring either Photoshop or Illustrator to fully edit outside of the originating software. However, I was hoping that I could create interactive forms by overlaying fields with Live Cycle Designer - I did not anticipate the default setting of the check box labels being unchangeable. Sounds like I am at a dead-end with this issue??
    Linda

Maybe you are looking for