Separate First/Last names from Field?

Greetings
I have a table in which the first and last names are in one
field (?) which I need to get into their own fields.
I would create a new table:
CREATE TABLE new_table
AS
SELECT #SpanExcluding(?, ?)# as last_name
#SpanExcluding(?, ?)# as first_name
FROM existing_table; ?
Any help would be appreciated.
newportri

You would use the string manipulation tools available to you
in your
database management system of choice to split the string of
one field
into to values to update the two new fields you create.
This answer is a bit vague, because all the different
database
management systems out there offer slightly different string
manipulation functions.
But I believe your SQL is going to look a bit like this. I
may be a bit
off here since I don't do this type of data manipulation very
often.
UPDATE myTable
SET
firstName = left(fullName,find(fullName,' ')),
lastName = right(fullName,find(fullName,' '))

Similar Messages

  • How to break first,last name from rows to columns?

    drop table t1;
    create table t1
    (c1 varchar2(100)
    insert into t1
    values(' <First Name >david </First Name>');
    insert into t1
    values(' <Last Name > smith </Last Name >');
    insert into t1
    values(' <First Name >Harry </First Name >');
    insert into t1
    values('<Last Name > Bird </Last Name >');
    select * from t1;
    C1
    <First Name >david </First Name>
    <Last Name > smith </Last Name >
    <First Name >Harry </First Name >
    <Last Name > Bird </Last Name >
    4 rows selected.
    out put should be
    First Last
    David Smith
    Harry Bird
    Thanks

    If homework I'd probably be looking at the string manipulation functions. If a real application I'd be looking at a different table design, and given that these look like xml tags that are or should be defined in a schema, using XMLDB.
    Niall Litchfield
    http://www.orawin.info/
    drop table t1;
    create table t1
    (c1 varchar2(100)
    nsert into t1
    values(' <First Name >david </First Name>');
    insert into t1
    values(' <Last Name > smith </Last Name >');
    insert into t1
    values(' <First Name >Harry </First Name >');
    insert into t1
    values('<Last Name > Bird </Last Name >');
    select * from t1;
    C1
    <First Name >david </First Name>
    <Last Name > smith </Last Name >
    <First Name >Harry </First Name >
    <Last Name > Bird </Last Name >
    4 rows selected.
    out put should be
    First Last
    David Smith
    Harry Bird
    Thanks

  • In Infopath - From User Group webservice First & Last Name are not displaying

    Hi, I am working on Internet faced Infopath Sharepoint 2010 web application.In Infopath form we used a User Group web service to retrieve the first and last names when opening the form. In Development environment its working fine (Ex:- http://sharepoint2010dev:45/)
    then we extend the webapplication with domain name in url.(Ex:http://Domainsp:80/) then the first and last names from User Groups is not working.
    Please give your suggestions to resolve this isssue.
    Any help is appreciated..!

    Hi,
    According to your post, my understanding is that the User Group web service not worked when extend the web application with a domain name in URL.
    Did you change the URL to the UserGroup web service in the Data Connection Wizard?
    As you had changed the URL, I think you should change the URL(http://<site>/_vti_bin/UserGroup.asmx), then check whether it works.
    http://blog.ianchivers.com/2011/01/using-sharepoint-usergroup-web-service.html
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How can I obtain the first 10 charcter from field and the last 4 characters

    Hi
       I need to obtaind the first 10 characters from field AWKEY from BSEG table, and the last 4 characters, how can I obtain certains position from field??
        Example:
      AWKEY field from BSEG can be for example :
    51000573112002
       This mean that you can obtain separately:
    5100057311 - BELNR (field)
    2002- GJAHR (field)
        As you can see, the first 10 positions are BELNR and the last 4 positions are GJAHR.
         But sometimes you find in old rows:
    5100057312US502001
         This mean that you can get from this field:
    10 positions for BELNR : 5100057312
    4 positions for BUKRS or WERKS : US50  - in this case, I don´t know if its is BURKS or WERKS...for this reason only I want to take only the first 10 positions and the last 4 position to compare.
    4 posiition for GJAHR: 2001
       I rewards all the answers.
       Thank you.
    Alicia

    Hi, thank you for yours answers
    Let me try to explain more what I need to do:
    I have a Internal Table that I create with EKBE table:
      SELECT  MANDT EBELN EBELP GJAHR BELNR BEWTP BUDAT
              MENGE WRBTR WAERS WERKS SHKZG DMBTR
              ZEKKN VGABE BUZEI
        INTO CORRESPONDING FIELDS OF TABLE LIST_EKBE
        FROM EKBE
          WHERE EBELN IN R_EBELN
            AND BEWTP IN ('E','Q','R').
    The result is all the rows that have this conditions..then with this internal table I need to looking for each BELNR in BKPF table, but sometimes you can find the row compare EKBE-BELNR with BKPF-BELNR...but in many cases, you don´t find the row in this way, you need to add EKBE-BELNR and EKBE-GJAHR and looking for in BKPF with field AWKEY..
    For this reason I CONCATENATE in this way:
    LOOP AT LIST_EKBE.
        V_BELNR = LIST_EKBE-BELNR.
        V_GJAHR = LIST_EKBE-GJAHR.
        CONCATENATE V_BELNR V_GJAHR  INTO V_AWKEY.
        SELECT SINGLE MANDT BUKRS BELNR GJAHR AWKEY
        INTO (BKPF-MANDT, BKPF-BUKRS, BKPF-BELNR,
             BKPF-GJAHR, BKPF-AWKEY)
        FROM BKPF
        WHERE AWKEY = V_AWKEY.
    ENDLOOP.
      But I saw that sometimes you don´t find the record in BKPF because the AWKEY is formed with BELNRBUKRSGJAHR....or may be with BELNRWERKSGJAHR ...I don´t know if is BUKRS or WERKS the second field...for this reason I try only read in the select..if its posible the first 10 postions and the last 4 positions...but Im not sure if its possible..
      The reason for that I looking for the BELNR field in BKPF field for AWKEY its because sometimes de BELNR in BKPF its different..example:
    In EKBE you have:
    BELNR: 5105618260
    GJAHR: 2006
    If you looking for in BKPF you don´t find sometimes exactly the field BELNR : 5105618260.. then you need try looking for the AWKEY field then you need to add BELNR+GJAHR..example:
    BKPF:
    BELNR: 5105611111
    GJAHR: 2006
    AWKEY: 51056182602006
    But in other cases... I found that in AWKEY exist for example:
    BELNR: 5105611111
    GJAHR: 2006
    AWKEY: 5105618260US502006
    In the last case I supouse that I can divide in:
    AWKEY: 5105618260-US50-2006 ... but I don´t know what its the field that have the information US50..may be is BUKRS or may be its WERKS
    May be some people know what its exactly this field and can help me..
    With the solution that some of yours give me..I don´t know the how I can make the select? and if its posible make in this way
    Thank you a lot

  • Remove First & Last Name Validation in Get Support

    Hi All,
       I have enabled the self management of password for portal users. I have to remove the First & Last Name validation  and make it optional, I have also made (ume.logon.logon_help.name_required = false)  in configtool and taken the restart of the server, but still it is validating the names.
    If anyone have removed the validation for the above, can help me.
    Thanks in advance.
    Regards
    Ponnusamy

    Hi Ponnuswamy,
    the right place to remove the validation is the par file of the login page.
    Get the par file from the portal. unzip the par file.
    under the PORTAL-INF\lib u will find the umelogonbase.jar
    Extrat the jar. get the java file named
    SAPMLogonLogic.java.
    Modify the piece of code in the java file.
    private void performForgotPassword()
            throws IOException, UMException, FeatureNotAvailableException {
            String methodname = "performForgotPassword";
            if (trace.bePath()) {
                trace.entering(methodname);
            try {
                String longUid = this.proxy.getRequestParameter(LogonBean.LONGUID);
                if (longUid != null) {
                    longUid = longUid.trim();
                // check for email id
                String email = this.proxy.getRequestParameter("email");
                String lastName = this.proxy.getRequestParameter("lastname");
                String firstName = this.proxy.getRequestParameter("firstname");
                String noteToAdmin = this.proxy.getRequestParameter("notetoadmin");
                IUser userFrom = UMFactory.getUserFactory().getUserByLogonID(longUid);
                if (email.equalsIgnoreCase(userFrom.getEmail()) &&
                        firstName.equalsIgnoreCase(userFrom.getFirstName()) &&
                        lastName.equalsIgnoreCase(userFrom.getLastName())) {
                    // email matched, assign a new password and email to user
                    String newPass = UMFactory.getSecurityPolicy().generatePassword();
                    IUserAccount ua = UMFactory.getUserAccountFactory()
                                                       .getMutableUserAccount(longUid);
                    ua.setPassword(newPass);
                    ua.save();
                    ua.commit();
    this is the original coding.
    remove the check for last name and first name in that
      if (email.equalsIgnoreCase(userFrom.getEmail()) &&
                        firstName.equalsIgnoreCase(userFrom.getFirstName()) &&
                        lastName.equalsIgnoreCase(userFrom.getLastName()))
    complie the java file. get the class and store it in the umelogonbase.jar . put the jar back in the original place. deploy the par.
    u will get the desire result.
    cheers,
    Sithi

  • Display first last name ecord

    source schema like 
    <ns0:empdetails xmlns:ns0="http://BizTalk_Server_Project3.Schema1">
      <employee>
        <FirstNmae>Kapil</FirstNmae>
        <lastname_x0020_></lastname_x0020_>
      </employee>
      <employee>
        <Firstname>Kiran</Firstname>
        <Lastname>Kumar</Lastname>
      </employee>
      <employee>
        <Firstname>Naresh</Firstname>
        <lastname>Kumar</lastname>
      </employee>
     </ns0:empdetails>
    destination will be 
    <employee>
        <Firstname>Kiran</Firstname>
        <Lastname>Kumar</Lastname>
      </employee>
    the first last name record should come and igoner another records if contains last name or not .

    You can acheieve this using Scripting functoid ( Script Type "Inline XSLT Call Template"). Refer to below XSLT script to use. Map output from this scripting functoid to destination node. 
    <xsl:template name="Employee">
    <xsl:if test="boolean(/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''])">
    <employee>
    <Firstname>
    <xsl:value-of select="/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''][1] /*[local-name()='Firstname' and namespace-uri()='']"/>
    </Firstname>
    <Lastname>
    <xsl:value-of select="/*[local-name()='empdetails' and namespace-uri()='http://BizTalk_Server_Project3.Schema1'] /*[local-name()='employee' and namespace-uri()=''][lastname!= ''][1] /*[local-name()='lastname' and namespace-uri()='']"/>
    </Lastname>
    </employee>
    </xsl:if>
    </xsl:template>
    Thanks,
    Pavan
    MCTS-Microsoft Biztalk Windows Server 2010

  • Table name from field

    Dear Sapers,
    How to find table name from field name to write functional spec.Pl elaborate it for normal & zdevelopment.Points will be rewarded for useful answer.
    Thanks in advance.

    Hi Uday,
    Just for the sake of help this reply......
    You can find the name of tables by using F1 button keeping cursor on the respective field that you want to bring in development. From there you have to move to Technical details through technical details button.
    If that field or values are getting saved into some structure then you have to search the right database tables. According to your module many database tables are there (that you can search from sdn.sap.com directly). That totally depends on your report/development that you want to bring in......
    In any development deciding the right table for start up ( I mean to say tables that will give you input fields in your FS) is critical, latter you have to search linking tables and have to give logic about how to pass values from what to what field and what to what table..... In this case Transaction code SE11 and SE16 are useful......
    This all is slightly confusing and tedious too...... Closely work with you ABAPer to get into many things and have successful development....
    Have nice development....
    Cheers!
    Abu Arbab

  • First, Last name fields in Numbers -- Three columns on iWeb page

    I'm new to this (both Numbers and iWeb) and I'm trying to help someone with their page (it's for a local candidate).  They have an excel spreadsheet with names and a bunch of other stuff.  they want to put the list of first and last names on their "supporters" webpage, separated by a space, without having to do it manually -- at this point about 900 such names.
    I can get the names out of Excel and into Numbers, obviously.  And I think I know how to get the list into iWeb, if I can generate it (using an iWeb snippet, which I'd also love help with if anyone here knows THAT as well).
    What I can't seem to do is create a list, in three columns, with First name (single space) last name.  Whatever I put in the formula bar seems not to do anything. And I haven't even BEGUN to figure out how to generate the three-column list.
    Any help would be gratefully appreciated.  As dunce-worthy as possible -- believe me, I won't be offended if anyone talks down to me.

    Hi d,
    I think it's the "three column specification that's throwing me. You might need to clarify that.
    The names are currently entered with First names in one column and Last names in the adjacent column. Here's a way to combine the first and last names into a "full name".
    In the "Full" column, the formula is:
    =B&" "&C
    In Last, First, the formula is:
    =C2&", "&B
    To list the names in a three column table in iWeb, you may need to start with a three column table in Numbers. This one pulls the names from column D (Full) of the table above, and distributes them into three columns. The original table has had four names added, and has been sorted.
    Note that the original table has been named "Data".
    The Data table contains the formula(s) shown above.
    The second table, "Aux", calculates the number of cells needed in each of the three columns so that no column is more than one cell longer than the shortest. Doing this calculation in an auxiliary table greatly simplifies the formulas needed in the final table.
    This table contains a single formula, entered in B2, and filled right to D2. Note that A2 is referenced in the formulas in the final table, "3 Columns". A2 may be empty, contain text, or contain the number zero.
    B2 (and fill right): =QUOTIENT(COUNTA(Data :: $C),3)+IF(MOD(COUNTA(Data :: $C),3)>COLUMN()-2,1,0)
    The third table, "3 Columns" displays the names in three columns.
    It contains a single formula, placed in A1 and filled right to column C and down to row 10.
    3 Columns::A1 (and fill right and down): =IF(ROW()<=Aux::B$2,OFFSET(Data :: $A$1,SUM(Aux::$A$2:A$2,ROW()),3),"")
    Descriptions and further examples for the functions used may be found in the iWork Formulas and Functions User Guide. The guide may be downloaded via the Help menu in Numbers.
    Regards,
    Barry

  • Embedded PDF filename = first+last name

    Hello,
    I am currently setting up a website for a sports club and they would like a fillable pdf for online registration that will then be emailed to them upon completion.
    Firstly somehow I need a identifier field I believe if I can use say the first two letters of the first and last name plus the seconds modifier it will be unique. Which they can use as a reference.
    If anyone has any ideas on how to acheive this please let me know =)
    Secondly when the user clicks save or email it would be really handy for the filename to automatically change to the unique identifier.
    Thirdly I'll be embedding this PDF in a joomla article, does anyone have any ideas if I could create a button that would send the pdf as an attachment automatically through joomla when a user presses the submit button in the PDF?
    I have searched all morning (6 hours now) and havn't got far at all, so I decided to come here. Any help is very much appreciated!

    Renaming the file is something that you need to do server-side when you're
    generating the PDF file, before serving it to the user. If the file is not
    generated by a server but is simply offered to the user as a static file on
    the server, then it's not possible.
    I don't know much about Joomla, but I don't think you could achieve this
    with a script from within a PDF, either.

  • Outlook task & Contacts first, last name swap

    Hi,
    Sorry if this has been raised before.
    I'm using Windows XP SP2 / Outlook 2003 / Nokia 6275 / Bluetooth. Synching Outlook and phone works successfully except for two small issues:
    * Completed Tasks in Outlook do not delete from phone even though Settings > Calendar options states "PC Sync removes recently completed To-do items from mobile phone".
    * My Outlook contacts are all stored "last name, first name" and sync correctly to phone. However once every month or so some Outlook records (not all) get corrupted and name field is changed to "first name last name"
    Any ideas?

    I am not sure what you mean. If you mean Last name/first name to First name/Last name Go into contacts>options>Settings>Name display and set according to your needs. There are three options there.

  • Wrong replication of partner "last name" from CRM to ECC.

    Hi everyone,
    In the specific environment of our company, we create business partners in CRM using t-code 'BP'  they are then instantly replicated to ECC (we visualize them using t-code 'XD03').
    When we create a partner as a person, the fields 'first name' and 'last name' (which are 2 distinct zones ) are concatenated into one single zone when replicated into ECC. I have visualized BDOCS using t-code SMW01, and haven't seen anything abnormal.
    I have been trying to debug the replication process, without any success.
    Please any clues on what I should do to get the problem solved would be very much appreciated.
    Many thanks
    C.K.

    Hi Rashi,
    Sorry for the late reply.
    Goto ECC system and find the FM "BAPI_SALESDOCU_PROXY_UPLOAD" and set the break point using your RFC user id (RFC user id from CRM to ECC and RFC user id should have the debug rights).
    Once you create the order in CRM and it will come to debug in ECC.
    Check TI_EXTENSION_IN tables whether your values are coming in.
    If not your CRM Middleware BADI coding was not done correctly.
    Hope this would help you.
    Regards,
    Bala

  • Why Address Book email addresses without first&last name stacked up under random names when moved to Lion?

    Often in Snow Leopard I would add an email address to my address book wihtout filling in the name fields. For example, Iif I got an email from [email protected], I would "add to address book but never fill out the card completely with the first and last names. The card showed with just an email address. Just left it as the email address. I never had any problems doing this and it always showed up as a single email address on a single card. Oh woe is me! When I moved to Lion I now have multiple unrelated email addresses under some of these "email only" cards. These seem to be the folks who were cards as an email address w/o first and last name fields. Not only that, I have multiples of the "email only cards" and each one has a different set of mutliple "email only" addresses under it. But, at least one of the "email only cards" just has the desired email w no other info. Can I fix this other than manually?
    I now have a disaster of an Address book.

    ok, I've spent some time doing various scenarios.
    I have managed to replicate one scenario which does as you say.
    If my contact in the address book:
    With name details as Peter Foo
    email address: [email protected]
    where there is an inserted space before the name peter, of course this is not instantly noticeable, but it is as if you hit the space bar just before typing the email address.
    Then when I use the Contacts Sidebar in a Write message, it will add the email address like this:
    Peter Foo <" peter"@somewhere.com>
    which of course in invalid.
    but in the address book, if highlight the contact, in the section below the email address in blue -if I click this to send an email the email address is printed exacly with the space and it will send as if nothing is wrong.
    So i'm asking you to check those email addresses which insert incorrectly via the Contacts sidebar. They only do this for me if there is a hidden inserted space at the start of the email address.

  • HT4515 Contacts I don't want them duplicated by first & last name

    I do not want to have the contacts duplicated with first &amp; last name. Don't want to have to separate couples either. Still deciding to upgrade &amp; may not if cant do what I want

    OK... hang on... Who, exactly, transferred them in?
    If you had someone at a phone shop... Verizon or AT&T, for example, transfer your contacts from an old phone, especially those stored on a SIM, then you DO have multiple entries. Those transfers almost always result in a royal mess.
    Create a new entry from scratch. Joe Smith or something. Then go back and look at the list. Do you see 2 entries for it, one under J for Joe and one under S for Smith?

  • Search combination of Org Name1 and Person First + Last Name

    Hi Everybody,
    Business Case:
    We have organizations witch have persons who are in a relationship to the organization. It must not be "contact person of". When a Person calls now our employee he had to find the correct person. To make this search easier i need a combined search for organization name1 and person fist + last name. The result must be all persons with a relationship to the company searched.
    Environment:
    SAP CRM 4.0 SP9 with Add On for Service Industries.
    User Interface: PC-UI.
    Is there a function module or class to do this search?
    Regards
    Gregor

    Hi Everybody,
    I've found a solution by implementing this Function module and adding it to the Query method:
    FUNCTION z_org_pers_search.
    *"*"Lokale Schnittstelle:
    *" IMPORTING
    *" REFERENCE(NAME_ORG1) TYPE BU_NAMEOR1
    *" REFERENCE(NAME_ORG2) TYPE BU_NAMEOR2 OPTIONAL
    *" REFERENCE(NAME_LAST) TYPE BU_NAMEP_L
    *" REFERENCE(NAME_FIRST) TYPE BU_NAMEP_F OPTIONAL
    *" CHANGING
    *" REFERENCE(CT_PARTNER_KEYS) TYPE CRMT_BSP_OBJECTKEY_TAB
    * Daten definition for partner search with COM_BSP_SEARCH_BP
    DATA: ls_search_criteria TYPE comt_bsp_bp_seareq_incl,
    ls_control TYPE comt_bsp_search_control.
    * Daten definition result tables
    DATA: it_org_keys TYPE bup_partner_guid_t,
    it_org_with_rel TYPE bup_partner_guid_t,
    it_pers_keys TYPE bup_partner_guid_t,
    ls_org_with_rel LIKE LINE OF it_org_with_rel,
    ls_pers_keys LIKE LINE OF it_pers_keys.
    * Search for Organizations
    ls_search_criteria-bp_name1 = name_org1.
    ls_search_criteria-bp_name2 = name_org2.
    ls_control-organizations = 'X'.
    CALL FUNCTION 'COM_BSP_SEARCH_BP'
    EXPORTING
    * IV_PARTNER1 =
    is_search_criteria = ls_search_criteria
    is_control = ls_control
    * IV_MAX_HITS =
    * IV_CHECKS = 'X'
    * IMPORTING
    * EV_HITS =
    * ET_BUT020 =
    CHANGING
    ct_partner_keys = it_org_keys.
    * Search for Persons
    FREE: ls_search_criteria, ls_control.
    ls_search_criteria-bp_name1 = name_last.
    ls_search_criteria-bp_name2 = name_first.
    ls_control-persons = 'X'.
    CALL FUNCTION 'COM_BSP_SEARCH_BP'
    EXPORTING
    * IV_PARTNER1 =
    is_search_criteria = ls_search_criteria
    is_control = ls_control
    * IV_MAX_HITS =
    * IV_CHECKS = 'X'
    * IMPORTING
    * EV_HITS =
    * ET_BUT020 =
    CHANGING
    ct_partner_keys = it_pers_keys.
    SELECT partner2 AS partner INTO CORRESPONDING FIELDS OF TABLE it_org_with_rel FROM but050
    FOR ALL ENTRIES IN it_org_keys WHERE partner1 = it_org_keys-partner.
    DELETE ADJACENT DUPLICATES FROM it_org_with_rel COMPARING partner.
    LOOP AT it_org_with_rel INTO ls_org_with_rel.
    READ TABLE it_pers_keys WITH KEY partner = ls_org_with_rel-partner INTO ls_pers_keys.
    IF sy-subrc = 0.
    APPEND ls_pers_keys-PARTNER TO ct_partner_keys.
    ENDIF.
    ENDLOOP.
    ENDFUNCTION.
    Best regards
    Gregor

  • Contacts first & Last name

    Good day,
        Can anyone help in switching my contacts in X3 from last - first display to First - Last Display.
    Thanks

    I am not sure what you mean. If you mean Last name/first name to First name/Last name Go into contacts>options>Settings>Name display and set according to your needs. There are three options there.

Maybe you are looking for

  • SQL Loader: handling difference datatypes in data file and table column

    Hi, I am not sure if my question is valid but I am having this doubt. I am trying to load data from my data file into a table with just a single column of FLOAT datatype using SQL Loader. But very few insertions take place, leaving a large number of

  • Will Lion work......it just might...or not.

    I have a 2006 17-inch iMac, first ever intel iMac.  It was originally a 1.83 Ghz Intel core duo.  I have since changed the processor to a T7600.  An intel core 2 duo 2.33Ghz with the 667Mhz Bus.  This is the fastest processor that you can put into th

  • Airport Extreme USB disk password issue fix ETA?

    Many people who have a USB drive connected to their Airport Extreme 802.11n have had problems where it repeatedly asks for the password to connect to the USB disk, but never allows you access until you reboot the router. This has been an issue for so

  • How to install kde?

    hi! How do i install kde. What other packages should i install? thank you benny

  • EmbedFonts woes

    Sorry, I posted this on the tail end of another topic but was worried it wouldn't get looked at because it was marked as answered. I have had this problem in the past and just gotten around it by manually drawing a dynamic text field and embedding fo