convert a string into several strings

I have a column 'name' in which records are like "shailesh singh negi", 'vipin kumar singh'... my requirement is to split this column into three columns such as "first name", "middlename", "name" and the chain should insert respectively as 'shailesh' in 'name', 'singh' in "middlename" and "negi" in the "lastname" column I used a query to split into two columns bt not able to do the same wid three columns...
request for two columns is like that...
substr (name, 1, instr(name,' ')-1) select firstname,
substr (name, instr (name, "") + 1) lastname
table;

Hello

See first Instr and Substr functions
Example of

select substr('shailesh singh negi',1,instr('shailesh singh negi',' '))  firstname ,
substr('shailesh singh negi',instr('shailesh singh negi',' ')+1,instr('shailesh singh negi',' ',1,2)-instr('shailesh singh negi',' '))  middlename ,
substr('shailesh singh negi',instr('shailesh singh negi',' ',1,2)+1,length('shailesh singh negi')-instr('shailesh singh negi',' ',1,2)) lastname
from dual;

Tags: Database

Similar Questions

  • Convert a word into several PDF documents document

    Hello

    I would like to convert a word into several documents PDF document. (i.e. convert word page 20 20 single-page PDF document). Is it possible to do this easily and quickly.

    I used the word mail merge to create several cover letters in word

    I would now like to convert each cover letter (which is 1 page each) individialized PDF so I can email attachments

    I currently have been copying and pasting my document master word in a document word fresh (a page at a time), then record, then conversion to PDF a cover letter at a time. Although it works it is a long time and I thought that there may be an easier and faster way to do

    All thoughts, suggesstions, would be greatly appreciated

    Thank you

    It is possible to convert the word document to PDF and the PDF file is opened:

    Document

    Extract Pages

    1-20

    Check "extract pages as separate files.

    This will give you 20 separate files.

    I hope that helps!

  • Convert a line into several lines

    Hello

    I have a Calendar_1 table with 4 columns and 1 row

    CREATE TABLE Calendar_1
    (
    Sunday (1) tank,.
    Monday (1) tank,.
    Tuesday (1) tank,.
    Wednesday char (1)
    );

    INSERT INTO Calendar_1 VALUES ('A', ' B ', 'C' ' d ' ");
    COMMIT;

    I need to get my result under a single column 'DAYS' as shown below

    DAYS
    --------
    A
    B
    C
    D

    Could you please provide me with the required SQL code

    Concerning
    -Learnsequel

    Like this

    select decode(l, 1, sunday, 2, monday, 3, tuesday, 4, wednesday) days
      from calendar_1
      cross join (select level l from dual connect by level <= 4) 
    
  • How to split a string into several substrings parent using a delimiter

    Hello

    I am forced to split a string into several substrings parent using a delimiter.

    And insert these substrings in variuou of the columns of a table in a row.

    For example. The sting is: ABC * DEF * GHI * JKH *.

    where ' *' is the separator.

    Desired output:

    Col1 Col2 Col3 Col4 Col5

    -------     --------     --------     -------     ---------

    JKH GHI ABC DEF (null)

    Could you please guide me how can I achieve this.

    Thank you

    Bogoss

    Hello Salim,

    Leave the thread for reference... got this excerpt:

    with t as

    (

    Select "c: its: hgfd:1:23" Str

    )

    Select

    REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 1, null, 1) col1

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 2, null, 1) col2

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 3, null, 1) col3

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 4, null, 1) col4

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 5, null, 1) col5

    t;

    This code snippet works well, but for the fixed columns. Here are 5 predefined columns.

    But I need to have a logic that I can browse the string any No.. sometimes.

    For example. If I get 3 secondary channels of the parent chain... I need to insert into 3 columns.

    And if I get 6 strings under... I need to insert into 6 columns.

    Could you please help me develop a logic like that.

    I use Oracle database 10g.

    And the data are currently being collected on external table... but I can store in a variable or a column of a database table.

    Thank you

    Bogoss

  • Converts a date into a date/time object string

    I have a JDBC call to enter data, including a date/time stamp.  For the life of me, I can't understand how to convert this string to a date/time field correct.  It is important, because I need to use validation strings to present a time more simplified users on a form.  But I like to keep the original date/time, so I can insert it again into a SQL db at the end.  I created a test process, so I can watch the progress.


    ' input string = ' 18/08/2010 16:41:23.

    Expression = dateTime-analysis-withFormat (/process_data/@datestring,"yyyy/MM/dd hh', 'FR', 'US', 'WIN',"CDT")

    Result = 18 August 2010 22:41:23 this

    So I try to put this value into a date field and I get the error:
    : Invalid ISO8601 DateTime:August 18, 2010 21:41:23 GMT:java.text.ParseException: date of: "August 18, 2010 22:41:23 this."


    I tried like 100 different variations to associate with an object date and time with the same result.  I can use the functions of analysis-dateTime or analysis-dateTime-withFormat throughout the day, but I can't get this string value in a proper date field.  Any ideas?  Please help as I'm about to pull out my hair... ... who won't be pretty.

    (Note: I know that my time zone came through OK but I am not concerned about it right now)

    To resolve this problem, I use ExecuteScript activity with the code:

    import java.util.Date;
    import impossible;

    String dateString = patExecContext.getProcessDataStringValue ("/ process_data/@input");

    SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-DD hh: mm :"); ")
    Date date = (Date) formatter.parse (dateString);

    patExecContext.setProcessDataValue ("/ process_data/result", date);

    where

    entry - process line with the dates of the string variable '2010-01-01 23:59:59 '.

    Date - date process variable

  • converting a string to some general engineering

    Hello world

    All know how to convert a string of engineering in a normal formatted string?

    Thank you

    Hi nem.

    in your vi there is no 'CH2-01. Do you mean "DAQ21"?

    See the attachment for a few minor changes (deleted sequence, its inhabitants, to build a better way). Why divide you your berries into 4 parts when you need to rebuild all the berries again?

    Are you sure this isn't a problem of formatting Excel? You set all the numbers in the excel worksheet to display in the form of "numbers"?

    When I try your vi I do not get any number in scientific format in Excel. (And I would say to transpose Excel import data...)

  • Convert the string separated by commas in the rows

    Dear gurus,

    I want to convert the string separated by commas in the rows to insert in the collection.

    for example, the string 1234,2323,23232,2343,34234
    Higher up in the chain must be converted to ranks in order to insert into the table or the collection

    Thanks in advance
    Sanjeev

    String in rows separated to convert the comma.

    with t
    as
    (
    select '1234,2323,23232,2343,34234' as txt from dual
    )
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
      from t
     connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    
  • Converts a string to a problem posed by the

    Hello!

    I get an ORA-01861: "literal does not format string" when you try to convert a string
    on a date.

    Currently stored as VARCHAR2
    14SEP11
    Should be
    to_date(start_op, 'DD-Mon-YY HH24:MI:SS') AS FORMATTED
    Date format
    NLS_DATE_FORMAT                DD.MM.RR 

    user545194 wrote:
    Hello!

    I select the column name:

    select to_date(start_op, 'DD-MON-YY') AS FORMATTED from table
    

    Column name: start_op

    A conversion problem?

    SQL> create table otn(p_date varchar2(7));
    
    Table created.
    
    SQL> insert into otn values('14SEP11');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select to_date(p_date,'DDMONYY') from otn;
    
    TO_DATE(P
    ---------
    14-SEP-11
    
    SQL> 
    
    SQL> alter session set nls_date_format='ddmonyy';
    
    Session altered.
    
    SQL> select to_date(p_date,'DDMONYY') from otn;
    
    TO_DATE
    -------
    14sep11
    
    SQL> 
    
  • convert a string to a clip in as3.0

    Hi all,

    I am quite new to the 3.0 action script and before you ask I have google, but without much success. So my question is how to convert a string to a movie clip instance?

    I need to manage then this movie clip instance with the methods of the tween class.

    So, I

    var str:String = "a";

    var mc:MovieClip = new MovieClip();

    and I want to have is how the film clip mc contains the letter 'a' on the inside.

    Any suggestions are appreciated.

    import flash.text.TextField;
    import flash.display.MovieClip;
    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;
    Import fl.transitions.TweenEvent;

    var str:String = "a";

    var myText:TextField = new TextField();

    myText.text = str;

    var myMC:MovieClip = new MovieClip();
    myMC.addChild (myText);
    addChild (myMC);
    var myTween:Tween = new Tween (myMC, "x", Strong.easeOut, 40, 300, 5, true);

    OR

    import flash.text.TextField;
    import flash.display.MovieClip;
    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;
    Import fl.transitions.TweenEvent;

    var str:String = "a";

    var myText:TextField = new TextField();

    myText.text = str;

    addChild (myText);

    var myTween:Tween = new Tween (myText, "x", Strong.easeOut, 40, 300, 5, true);

    There are several ways to do so. The foregoing cannot be the best or most effective. Essentially, the text in your channel must be defined as a container of text field text property, and then the container of text field should be added to the displaylist. Then it can be interpolated.

  • Simple question AS... Convert a string to a component name

    This should be a fairly simple thing to do, but I don't see what to look for when looking for an answer...

    I have a datagrid that when selected compares the datagrid selected with a value in a table in componentList. If the values match, I do the componentList [0]. NomComposant visible canvas. How I do at the moment, but there must be a better way.

    LitVar.visible = false;
    for (var i: int = 0; i < componentList.length; i ++)
    {
    If (reportsGrid.selectedItem.RptCnt == componentList [0].) RptCnt)
    {
    If (componentList [0].) NomComposant == 'LitVar') {}
    LitVar.visible = true;
    }
    }
    }


    My question is how to that the component componentList [0]. NomComposant visible?

    The values stored in the [n] componentList. NomComposant are names of paintings on my form. I intend adding about 15 paintings hidden on this form and I don't want to go through all these names, as does the above code. What I want to do is to convert the string to the [n] componentList. NomComposant table and make sure that visible canvas.

    Or in other words, how to rewrite componentList [0]. ComponentName.visible = true; If it actually works?

    Thanks in advance for the help!

    Have an ordinary day...
    KomputerMan ~ |  :-)

    The answer to this is provided by Jeff Tapper to me, so a BIG thank you Jeff! All he needed to do is to take my thong and turn it into a component name, and then make it visible like this...

    for (var cc:int = 0;< componentlist.length;="">
    {
    var componentName:String is componentList [cc]. NomComposant;
    This [NomComposant] .visible = true;
    }

    I knew it was simple...

    Have an ordinary day...
    KomputerMan ~ |  :-)

  • [Oracle 8i] How to convert a string (timestamp) in a date?

    I find it difficult to know how to convert a string to a date time stamp (or possibly several).

    The timestamp is 20 positions, character (NOT NULL, CHAR (20))
    in the format: YYYYMMDDHHMMSSUUUUUU
    where Y = year, M = month, D = day, M = Minutes, S = seconds and U = microseconds

    The reason why I want to convert it is so that I can compare a timestamp to each other (that is, I want to be able to find the MIN (timestamp), MAX (timestamp) and make comparisons of inequality).

    Is this possible?

    Thanks in advance for the help on this!

    Hello

    As Damorgan said, if all you want to do is find which is the earlier or later, then you can just compare the strings: they are in a format where it works.

    If you need to do other things, such as compare to today date or see the difference between two of your lines of days, you will need to convert it to date. (He has no reason to convert them to numbers).

    A new TIMESTAMP data type, which manages the fractions of a second, was introduced in Oracle 9.
    Since you use Oracle 8 (depending on your subject line), or it must be
    (1) ignores the microseconds, or
    (2) use a separate column for microseconds.

    Whatever it is, use TO_DATE to convert the first 14 characters in DATE:

    TO_DATE ( SUBSTR (txt, 1, 14)
            , 'YYYYMMDDHH24MISS'
            )
    

    where txt is your column of type CHAR.
    To convert microseconds to a number (between 0 and 999999):

    TO_NUMBER (SUBSTR (txt, 15))
    
  • How to convert the string to a full decimal point and left shift

    Hey guys I tried to convert gps string to an integer, like this

    A string that is 2467.8976 and I need to convert it to a similar integer as point of this 2467.8979 so that I can shift the decimal point to the left (24.678979) which i coudnt do it with the chain. It's just been my 2 weeks with the labview so be gentle. Thank you

    Hi Awais07,

    Once you have created an indicator that signals the output of parsing the string, right-click on this indicator > display... Format > increase the value of the digit 9

    Kind regards

    Lennard.C

  • Converts a string fragment file values

    Function wich use to convert the string fragment values?

    I have this string in the file:

    Instrument: NOR-DAQ; Date: 01-10-2008;
    Quantity: voltage [V];
    Results: 1.23,3.45,5.65,6.89,...;

    And I need to values - 1.23,3.45,5.65,6.89

    Hi crisdragon,

    You must use the native LabVIEW file and the string API.

    I gave you an example.

    Hope this helps.

  • Convert the string with number of floats a number

    How to convert the string as "- 8.9E - 03" to a number of TestStand?

    Thanks in advance

    Hello

    Try to use the Val() function

    In the expression, it looks like this

    People of the country

    .nValue = val (Locals.strValue)

    Locals.nValue = Val("-8.9E-03")

    Hope this helps

    Jürgen

  • convert a string to a path

    I want to assign a value to a global variable of the station (type: number) to the local variable (type: number).

    The problem is, that knowledge straight from the global variable of the station at the time of execution.

    I have a string like "StationGlobals.PARAMETER.SWITCH.xx.nRESISTOR_VALUE" - the characters 'xx' variable will be replaced when running...

    Now I want to convert this string to a path variable to assign to the local variable (type: number) the value of the global variable of the station (type: number)

    Do you know how I can do?

    Greetz

    Jonathan K.

    Try

    Locals.nCurrentResistorValue = Evaluate (Locals.sFunctionPath)

  • How to convert the string with numbers in U8 with ascii

    Hello

    I have a string with only numbers 0. 9 paper.

    Now, I want to convert to table-U8.

    He works here, but now the problem: How can I change each character to its ascii value?

    Example:

    entry: 123 (string)

    output: x 31, x 32, x 33 (U8-array)

    Thanks for the help

    It's very easy

    String to Byte Array Function
    Have the Palette: string/array/path Conversion functions

    Converts a string to an array of unsigned bytes. Each byte in the array has the ASCII value of the character corresponding to the string.

Maybe you are looking for

  • Ant video Dowloader does not work on firefox 16.0.2?

    I download many videos using the ANT, it's my fav add on Mozilla

  • Qosmio G20 system with CD recovery

    Hello everyone I have a G20 in which the internal CD-ROM does not work. I have the recovery CD is possible to make the recovery of the system by connecting the hard drive to another computer and retrieve the system recovery? I did tried to extract th

  • Satellite C660-17F just died on me

    I was watching a movie on my Toshiba Satellite C660-17F and all of a sudden the computer off because he go hibernate mode, so I plugged the power. I could see two lights in the front of the laptop from its power source, and the other to indicate the

  • How to trigger the value change in the structure of the event

    HII everyone, like the title, how should I trigger the value change event to display a message... Here is my connection... I want to trigger structure of the event to bring up the subvi, when the flame and the led are TRUE State... I have using the n

  • Can I reset my password forgotten CM1415fnw

    Hello I have not forgotten my password on the control panel of the Laser Jet Pro CM1415fnw in administration. But if I had, would there be opportunities that reset at home? Best regards