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

Similar Messages

  • 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,' '))

  • How to convert a table data from rows to columns?

    Hi,
    I have a Employee table of the following format:
    Emp_id | Emp_name | Salary
    101 | James | 1000
    102 | Julia     | 2000
    I have to convert or transpose the table data as follows using a SQL statement/function -
    Emp_id | 101     |     102
    Emp_name | James |     Julia
    Salary     | 1000 |     2000
    How do I achieve this?
    Please help me.
    Thanks,
    993012
    Edited by: 993012 on Mar 11, 2013 3:26 AM

    993012 wrote:
    Hi Pavan,
    Thanks for the prompt reply.
    The link seems to be of not relevant to my question.
    My question is to clearly transpose the rows to columns and vice versa without any changes to data.
    Regards,
    993012I do not see any modification to the data in the Link posted by Pavan. Anyways, One catch with Transposing the Rows is, you need to know the Number of Columns you need to project.
    With Static SQL, there is no way to do so. Hence, you will need PL/SQL with Execute Immediate/Dynamic SQL.
    See demostration by Tom Kyte on Dynamic Pivots to have a look at the example and adapt to your situation.
    Although, I will debate on the need to do it in SQL. Because what you are upto is a part of Reporting and there are many reporting Tools which will have this functionality in-built. SQL, ideally should not be used for reporting purposes. It sole purpose it to store and pass the data to be rendered by Client Software i.e. Java or Third Party tools.

  • 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

  • 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

  • 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

  • How doI change my last name on my bill and profile? Using maiden name, need to update to married name

    How doI change my last name on my bill and profile? Using maiden name, need to update to married name

    Yea its a good thing to update because 95% of the Time a Rep. may ask for the Primary owner of the lines and if your not that person you can't hardly do squat with it. Case in point with my With our Lines my Mom was the Primary owner and i couldn't do Anything with out them wanting to talk to her first. Getting a Phone, Making Changes, Check statuses, Heck there was one time i remember i couldn't even pay the bill not exaggerating there it was basically out of my Hands my Mom got tired of this and she changed it.. Now that i'm considered as second Owner and i can do as only my mom could there are a still a Few rare occasions that a Rep will ask for her on but for the Most of it i have free Range with the Account..  b33

  • 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

  • Discoverer Report: How to find Business Area name from Report Name.

    Hi
    I opened a report in Disco Desktop 4 -> Resonsibiolity --> Report Name.
    So I know Report name but don’t know which Business Area it belongs to.
    How to find Business Area Name from Report Name?
    Cheers
    Vijay

    Hi,
    There is no relationship between reports and business areas. Each report can be built from many folders. Each folder can be in many business areas.
    However you can try the following SQL which may give you the result you want for an v5 EUL. You will have to modify for Discoverer 4 EUL:
    select distinct doc_name, obj.obj_name folder_name, bas.ba_name
    from eul_us.eul5_documents doc
    , eul_us.eul5_elem_xrefs xref
    , eul_us.eul5_expressions exp
    , eul_us.eul5_objs obj
    , eul_us.eul5_ba_obj_links bol
    , eul_us.eul5_bas bas
    where xref.ex_from_id = doc.doc_id
    and doc.doc_name = &your_report
    and xref.ex_to_id = exp.exp_id
    and obj.obj_id = exp.it_obj_id
    and bol.bol_obj_id = obj.obj_id
    and bas.ba_id = bol.bol_ba_id
    Rod West

  • How do I remove my name from an ipod prior to donating it to someone?

    I would like to donate my ipod touch to someone as I just bought another one. How do I remove my name from the device prior to donating it? I was able to remove all of my apps, music and videos but not the name.

    Go into your settings>general>reset, then select Erase All Content and Settings. 

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • How to check my job name from the database...

    I have written one job scheduler which is as follows :
    SQL> ED
    Wrote file afiedt.buf
    1 DECLARE
    2 X NUMBER;
    3 JobNumber NUMBER;
    4 BEGIN
    5 SYS.DBMS_JOB.SUBMIT
    6 (
    7 job => X
    8 ,what => 'scott.SPLITSMS;'
    9 ,next_date => SYSDATE+1/1440
    10 ,interval => 'SYSDATE+1/1440 '
    11 ,no_parse => FALSE
    12 );
    13 JobNumber := to_char(X);
    14* END;
    15 /
    PL/SQL procedure successfully completed.
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    how to check my job name from the database...
    what is the command used to check the job_name ????
    and how can i ensure that my job scheduler is running properly...???
    please help ........my dear friends.....!

    957029 wrote:
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not existYou can use DBA_* views only if the User has been Granted a DBA Privilege.
    how to check my job name from the database...
    what is the command used to check the job_name ????You can use USER_JOBS view to check. But, is it not that you have just created the Job, so you must be knowing it?
    and how can i ensure that my job scheduler is running properly...???If USER_JOBS.FAILURES is Non Zero, that means the Job has encountered a problem that needs to be Investigated. Similarly, the LAST_DATE, LAST_SEC, NEXT_DAY, NEXT_SEC can be used to determine if the Job has been running successfully.
    if you are on 11g, you should consider using DBMS_SCHEDULER.

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to find the form name  from VA02 T.code

    how to find the form name  from VA02 T.code

    Hi Rajyam,
    I guess you are looking out for the formname which prints sales related documents.
    If this is what you want,then go to the T-code NACE and select the option K1Sales activities and click on the Output Types button on the top.The new window has all the types of Output types listed.Select the most appropriate and double click on the Processing routines button in the left side screen.
    The new window lists the program names and the forms associated with that output type.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • How to find the dsn name from an *.rpd file provided?

    How to find the dsn name from an *.rpd file provided? All the ODBC details which would require to run your dashboard.

    Hi
    DSN name is not a part of .rpd file. So There is no information about DSN name in .rpd file.
    Thanks
    Siddhartha P

Maybe you are looking for

  • Error during creation of shopping cart

    Hi All, I am creating a shopping cart on behalf of user. Initially, vendor was not coming up. Then i saw, in the user organisation str. pur grp is not maintained. I maintained the same and now the vendor list is coming up but when i select the vendor

  • Sales order block for delivery

    How to put delivery block to existing open sales order for particular sold to party(customer). Is there  any table or TCode where we can put multiple sales order to put this block. Dont tell VD05 bcos that will apply only to new sales order not to ex

  • File with clear background places with white background

    Hi, I upgraded to PS10 and when try to place a saved pdf in IDCS2 the background changes from clear to white. Is there a way to place it so the background doesn't show? Am I mixing up Illustrator and PS10 functions? Thanks, Garrett

  • How send parameter in prerender() function for query

    Sir I use requestbean for sending data to next page Because want use this parameter in query I get data as per this parameter But when I call next page not pass parameter value to next page and query use blank parameter I write code in prerender() Se

  • Slideshow Quality to iDVD

    Hello, could anyone offer any advice on sharing slideshows to iDVD? The basic question is how to retain optimum quality from original photograph to slideshow to eventual burn on to iDVD.