Get the string until first space

hi,
can anyone provide an example how to get the string until the first space?
i mean if the value is :
this is an example
how to get only the word "this" (before the very first space) by select?
thanks in advance,

There are several methods to achieve this:
SELECT SUBSTR(t.col1, 1, INSTR(t.col1 || ' ', ' ') - 1)
  FROM (SELECT 'this is an example' col1
          FROM dual) t
     ;     or in 10g using regular expressions:
SELECT REGEXP_SUBSTR(t.col1, '^[^ ]+')
  FROM (SELECT 'this is an example' col1
          FROM dual) t
     ;     C.

Similar Messages

  • How to get the date of first day of a week for a given date

    Hi gurus
    can any one say me how to get the date of first day(date of Sunday) of a week for a given date in a BW transformations. For example for 02/23/2012 in source i need to get 02/19/2012(Sunday`s date) date in the result. I can get that start date of a week using  BWSO_DATE_GET_FIRST_WEEKDAY function module. But this function module retrieves me the  start date as weeks monday(02/20/2012) date. But i need sundays(02/19/2012) date as the start date. So it would be really great if anyone sends me the solution.
    Thanks
    Rav

    Hi,
    The simplest way would be to subtract 1 from the date date which you are already getting in transformation routine, but instead of doing that subtraction manually which might need bit of errort, you can simply use another FM to subtract 1 from given date.
    RP_CALC_DATE_IN_INTERVAL
    Regards,
    Durgesh.

  • How can I get the amount of free space that is on my drive to show at the bottom of the drive in Lion.

    How can I get the amount of free space that is on my drive to show at the bottom of the drive in Lion.
    This is a must feature for me and I may have to go back to Snow Leopard.
    Please help!

    Right click on your desktop and choose "viewer options". Adjust the spacing and the size of your icons and you should be able to see the size of your drive(s) and the free space available on each drive with the exception of your bootcamp drive which will only show the overall size of the drive you have it on.  This may be different if you only have one system drive (like on a Mac Book Pro) with a partition containing bootcamp on it. this may only show you the overall capacity, I can't say for sure though as I only use a Mac Pro with 4 seperate Hard Drives which are showing both overall capacity and free space available. Hope this helps
    Denisimo

  • How can i get the maximum salary first in the order of ascending

    Hi,
    How can i get the maximum salary first in the order of ascending.
    I need the sql query.
    my output should like:
    Emp_Name Salary
    A 5000
    SS 100
    AA 300
    DD 700
    WW 2000
    Thanks,
    MuthyaM.

    Here is an example :
    SQL> with mytable as
      2  ( select 'aa' as col1,  300 col2 from dual union all
      3    select 'ss' as col1,  100 col2 from dual union all
      4    select 'a'  as col1, 5000 col2 from dual union all
      5    select 'dd' as col1,  700 col2 from dual union all
      6    select 'ww' as col1, 2000 col2 from dual )
      7  select col1, col2
      8  from   mytable
      9  order by decode(row_number() over (order by col2 desc),1,0,1),col2;
    CO       COL2
    a        5000
    ss        100
    aa        300
    dd        700
    ww       2000
    SQL>Nicolas.

  • How can i get the timestamp of first data at continue sample mode?

    how can i get the timestamp of first data at  continue sample mode?
    6023e pci , and c++ code
    thanks !

    The tangent ist the derivative of the curve in that point. You can try to use a numerical derivative vi or keep it simple an approximate with a line through the adjacent points.
    Gabi
    7.1 -- 2013
    CLA

  • No matter which page i run... i should get the home page first

    Hi,
    i have some jspx pages in my application
    No matter which page i run... i should get the home page first
    Because there is a chance that the user might remember the url of a certain page and copy paste that one in the browser... in such type of scenarios also home page should come first
    After i implemented Adf security in the redirect upon successful login i took the home.jspx page... but it is not going to home.jspx when i run some 'x' page and give the credentials for authentication.
    This for our project they dont want to implement at taskflow level for each and every taskflow... is there any higher level where we can implement such feature because home page is common for all.
    Thanx,

    No matter which page i run... i should get the home page first
    Because there is a chance that the user might remember the url of a certain page and copy paste that one in the browser... in such type of scenarios also home page should come first
    After i implemented Adf security in the redirect upon successful login i took the home.jspx page... but it is not going to home.jspx when i run some 'x' page and give the credentials for authentication.Just create a filter and put some logic like the one below:
      if(!request.getRequestURI().contains("homePage"))
                 ((HttpServletResponse)servletResponse).sendRedirect("http://server/yourApp/faces/homePage");
      else
          filterChain.doFilter(request, servletResponse);You can easily search for how to create a web application filter and register it in web.xml ..

  • I am using DVD Studio Pro to create a DVD. The assets total about 2.4GBs using a 4.7 GB disc I still get the error " not enough space on disc" Does anyone know why?

    I am using DVD Studio Pro to create a DVD. The assets total about 2.4GBs using a 4.7 GB disc I still get the error " not enough space on disc" Does anyone know why?

    Start by using this to make sure your assets really fit on the disk:
    http://www.kenstone.net/fcp_homepage/bit_budget.html

  • Trying to get the string from javax.xml.transform.Source

    I have a SOAP client that will submit a string of data to a url and return an xml string back. It works ok besides that last part.
    I found on another site someone took the returned XML and printed it to the system print box. I want to just get the string out to a variable to pass back..
    This chunk works:
    TransformerFactory tff = TransformerFactory.newInstance();
    Transformer tf = tff.newTransformer();
    Source sc = rp.getSOAPPart().getContent();
    StreamResult result = new StreamResult(System.out);
    tf.transform(sc, result);
    System.out.println();Instead of this I just want to catch the XML string in a String variable. Thanks for the help.

    Instead of giving your StreamResult System.out, give it a StringWriter. You can then call toString on the StringWriter, and get what you're after
    StringWriter output = new StringWriter();
    TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(output));
    String xmlResult = output.toString();

  • How to get the string's byte length?

    I have some string,I want to get the string's byte length,how
    can do it?
    for example:
    <cfoutput>#len('hihi,这是测试')#</cfoutput>
    output is 9
    I want to get the byte length is 14, how can i get it?
    Thanks.

    >> Fair cop. I didn't realise that asc() returned the
    codepoint rather than the
    > actual character code.
    >
    > and what would be the difference?
    Oh, sorry, whatever the term is (I'm crap with jargon). The
    value returned
    by asc() for those chars was only two bytes (ie: four hex
    digits). I
    didn't realise there was more to it than that, and that
    2-byte value maps
    to some other THREE byte value. I need to do some reading...
    > that's what both cf & java counted as the length.
    CHARACTER length, sure. No-one's disputing that. On the other
    hand,
    no-one's asking about it, either.
    > by adding a BOM you've already effected the encoding,
    which may or may not
    > match the original. so you still don't know how many
    bytes were in the original
    > string.
    [groan]
    Yes, that's a reasonable strawman there. I was only putting
    it in a file
    so I could save it and check the number of bytes occupied by
    the data.
    Clearly... CLEARLY... the OP is not asking for a character
    length of that
    string. They've said as much.
    I copy and pasted the string from their post, and used it as
    a
    demonstration of how "nine" is not the right answer for the
    BYTE LENGTH of
    that string. Whether or not the original string was UTF-8,
    UTF-16 or
    special-marmoset-encoding, it almost certainly was NOT in a
    fictitious kind
    encoding in which each of those particular characters only
    occupied one
    byte each, which would mean that "nine" is the correct answer
    to the
    question.
    When I copied those characters from either the web browser
    for from my
    text-based news agent, notepad identified them (and rendered
    them
    correctly) as UTF-8, so I'm fairly confident they ARE UTF-8.
    Of course
    this could be down to some intermediary encoding (pasting
    them in to the
    original posting, for example, via some encoding-transforming
    mechanism),
    but Occam's Razor suggests the original question was from a
    UTF-8 POV.
    But maybe we should quit speculating and ask the OP. Unless
    they've
    buggered off in despair of how drawn out all this is getting.
    For which I
    would not blame them.
    Adam

  • Getting the string value of a step in Test stand 3.1

    Hi All , can anyone advise whicn control I use to retrieve the string value of the STEP name using v3.1.
    It was the sequence context in earlier versions.
    thanks dht

    I'm assuming you want the step's name as a string? Inside TestStand there is the NameOf function that can be used with any TestStand object. i.e.
    Locals.mystring = NameOf(RunState.PreviousStep) or something like this� You can access this function outside of TestStand by using the PropertyObject.Evaluate() method.
    You could also use the TS API (in TS or in LV or someplace else) to start with a Step object, turn it into a PropertyObject, and then get its property �Name� which will return the string name of the step.
    Third option off the top of my head is to explore the Hidden Properties of TestStand, that you have to enable by going through the Configure menu. There�s a knowledge base about it somewhere on the NI website if you�re curious. If you remember browsing fo
    r the step name via a sequence context/expression browser before now, it was probably hidden properties that you were using.
    Cheers!
    Elaine R.
    www.bloomy.com
    Cheers,
    Elaine R.
    www.bloomy.com

  • How get the string back?

    Hello with this code I put my string in a byte array.
    String code = "This is a testString";
    bytes[] ver = code.getBytes();
    Can someone tell me how I can get the original string back?

    I tried this
    String s = (ver);
    When I do this and try to compile I get the error that
    found byte[] required java.lang.string

  • How to get the date of first day of the week

    hi ,
    how can i get the first day of the current week ?
    i have tried the following
    note : my sysdate is 3rd april 2007
    select trunc(sysdate , 'ww') from dual -- 4/2/2007
    select trunc(sysdate , 'w') from dual -- 4/1/2007
    select trunc(sysdate - 4 , 'ww') from dual -- 3/26/2007 -- shld return 25th mar 2007
    select trunc(sysdate - 4 , 'w') from dual -- 3/29/2007 -- shld return 25th mar 2007pls advise
    tks & rgds

    Hi!
    I'm considering MONDAY as the first working day of the current week. And, the code is accordingly --
    SQL> select to_char(sysdate - to_number(decode(to_char(sysdate,'DY'),'TUE','1',
      2                               'WED','2',
      3                               'THU','3',
      4                               'FRI','4')),'dd-mon-yyyy') res
      5  from dual;
    RES
    02-apr-2007Regards.
    Satyaki De.

  • How to get the string value from the RichSelectBooleanCheckBox component?

    I added a validator to a RichSelectBooleanCheckBox component which is binded to a String attribute of a View Object.
    I defined the mapping of boolean value to corresponding String value in the corresponding attribute binding in the page definition.
    When the validate() method of my validator was invoked, the new value passed to the validate method() was a Boolean value instead of the converted String value.
    I need to write validate() method generically so that it can handle more than one way of mapping boolean values to String values.
    How can I get the converted String value in my validator method() from the RichBooleanCheckBox component that was also passed to the validate() method as a parameter?

    use:
    int num = Integer.parseInt(s);

  • HT1925 I am having an issue with loading Itunes. I receive a missing dll file notice. Then another error message. I have reinstalled Windows & still get the error. I did not get the error until I recently did an ITunes update.

    I am having an issue with ITunes after a recent ITunes update. I can not open ITunes, I get a message missing MSVCR80.dll file, Then an error 7 message. I have redone the OS for Windows 7 and restarted the computer. I keep getting the errors.

    Do the following:
    Uninstall from Windows the following five programs: iTunes, Apple Software Update, Apple Mobile Device Support, Bonjour and Apple Application Support. You do this from an applet in Control Panel called Programs & Features (in Windows 8, 7, or Vista) or Add or Remove Programs (in Windows XP).
    Download the latest version of iTunes from Apple and note the location you're saving it to so you can find it once it's done.
    Run the iTunes installation as an administrator, just Right click iTunes installer and Run as Administrator.

  • Get the string between li tags, with regular expression

    I have a unordered list, and I want to store all the strings between the li tags (<li>.?</li>)in an array:
    <ul>
    <li>This is String One</li>
    <li>This is String Two</li>
    <li>This is String Three</li>
    </ul>
    This is what have so far:
    <li>(.*?)</li>
    but it is not correct, I only want the string without the li tags.
    Thanks.

    No one?
    Anoyone here experienced with Regular Expression?

Maybe you are looking for

  • Restoring Account Info

    My wife had logged into the Imac last year and created an apple ID which defaulted into the itunes "account". She only used it once to redeem Pepsi cap songs I didn't realize that her ID was in the account field and I just redeemed a $50 gift certifi

  • How do I play audio attachment in my PDF file?

    How do I play the audio attachment in my PDF files in android?

  • No Sound in Omnispehere & Trillian after the last update in Logic 8

    Hi, I'm on Leopard 10.5.8 and Logic 8, After install of both Omnisphere and Trillian, I have no sound on both plug-ins. I have everything on my internal HD, installed to the same path like previous updates. Updates: Omnisphere; Software 1.2.0n Patch

  • Simple select with "Or"

    This is very basic but I can't find any helpful resources out there that really give in depth query examples. I need a select statement that does something like: select * from table where column1 = '1' and column2 = '2' and column3 = '3' and (column4

  • Standard reports per Account groups

    Dear Sap Gurus! Please tell me if any standard reports are there to analyse customer on basis of Customer account groups linked with payment received debit credit and other fields.... thanks in advance ! Amlan Sarkar 9833301024