To get the position of the characters in the string in sql

hi all,
I need to get the position of the characters in the sql , the string like this '10101110111010111' , is it possible to get the answer like this
pos char
1 1
2 0
3 1
4 0
and so on .
Thanks in advance .

select level pos,substr(:your_string,level,1) "char"
  from dual
connect by level <= length(:your_string)Regards
Etbin
Edited by: Etbin on 24.9.2011 8:46
put char between double quotes http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/ap_keywd001.htm#BABCJAEB

Similar Messages

  • Is it possible to get the position of a charcter from a string ?

    Hi !
    Is it possible to get the position of a charcter from a string ?
    Example:
    @VAR contains the following text "ABCDEFGHIJKLM"
    I'am seaching for FGH, it start on pos. 6 en ends on pos 8.
    How can I get these numbers 6 and 8 ?
    So, I can use them in the MID(text,start,len) function.
    Thanks!

    Hi Sooraj,
    I'll explain more in detail:
    From a web-service I get a variable called @Spec.
    This variable contains the following:
    "MOTORTYPE[CR]D-QW1234[LF]PART[CR]1234-FRD-X[LF]"
    or
    "MOTORTYPE[CR]ABC[LF]PART[CR]E-435[LF]"
    I need the values behind MOTORTYPE[CR] and behind PART[CR]
    But you’ll see that the positions of these values are different each time.
    If there is a way to get the (start) position of "MOTORTYPE[CR]" or "PART[CR]" and the (end) position of the first "[LF]" behind that,
    then I could use the MID() function to get the correct values.
    The values will be displayed in a table view (between other fields).
    An ABAP-call/function won’t work . . . how should I invoke this within a table column/field object ? (system action ?)

  • HELP!! How to get the position of active windows in the desktop

    How to get the position of active windows in the desktop

    You mean, active windows other than the program you're running, or windows the program puts there? And a real desktop (like where MyComputer is), or a desktop pane?

  • When I try to send an email I get a message - Non ASCII characters in the local part of the recipient address.

    I am trying to send an emails to Italy. When I click send I get a message ( Non-ASCII characters in the local part of the recipient address). [email protected]  is one of the email address I am trying to send to. My other email address' work OK. I have sent emails to these Italian address before with no problem.

    Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Finding the position of an integer in a string

    I haven't done much Java programming for the past 3 months, but I'm trying to get back into it now, but I'm having some trouble. I'm trying to break up a string of integers, to store each individual integer in an array.
    So, if I had something like 132412344, a for loop would put them all into separate arrays.
    I know that there is a charAt() function, but is there something like that for integers?

    Do you know whether every single character in the string is an integer?
    If it is, then toCharArray will get you the array. Then you could loop through it to parse each character into an int. You can use Character.digit to do that.
    I doubt that there's any method that automatically splits a string and returns the integers represented by the characters in a string. It seems like too specialized a method. But I could be wrong.

  • How to retrieve the position of 2 cursors in the same plot?

    Hi, I have actually 3 different questions.
    1. I would like to know if there is a way to get the cursor positions of two cursors? I want to use these values in another part of the program. I have via the property node of the plot gotten the x-value of one of the cursors, now I need the x-value of the other cursor.
    2. I would like to be able use a control to switch between the x scale of a plot to be logarithmic or normal. Is this possible?
    3. How can build an executable that is not executed when I start the VI? I didn't have problem doing this when I was using version 7.1, but now I don't find the option not to run the VI on startup.
    Any help on any of these problems would be highly appreciated!

    (1) See image for two possible solutions. The bottom solution is useful if you have many cursors and want to get all positions:
    (2) see answer above.
    (3) There is a bug in LabVIEW 8.20 that does not allow to turn off "run when opened" for built applications.
    Message Edited by altenbach on 04-18-2007 11:24 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    GetCursorPositions.png ‏4 KB

  • While scrolling IE 11 doesn't update (on time) the position of an element inside the viewport

    Hi,
    It's essential to check the following jsFiddle demo http://jsfiddle.net/rbtbar/1dudpeox/ to see the issue.
    If you scroll the viewport, the position of the fixed element is not immediately updated, which makes a bad impression to the users. It happens only in IE. Neither Chrome nor FF got this problem.
    Regards,
    Robert

    Hello rbtbar,
    There are many web designs which don't support several web browsers. Maybe they have used un-supported script for making their web design which don't supports IE. Otherwise, if it is not, then your problem must get fixed if you reset IE settings.
    I searched alot and found some links:
    Link: https://github.com/jsfiddle/jsfiddle-issues/issues/311
    Also 
    Link: http://stackoverflow.com/questions/15260947/why-jsfiddle-is-not-rendering-at-all-in-ie8-and-previous-versions
    So we can clearly understand it is not supporting IE currently! Which means, there is
    NO fault with IE. Similarly, it may NOT work on
    IE 11 too, due to their CSS. According to your description, I can just say "IE 11 is partially supported"
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Need help in finding the position of a SubString in a String

    Hi All,
    I have a VARCHAR2 column in my table which has data similar to '152-425-3265-8-5623-45'.
    I want to find the position of the numbers in the column.
    For example:
    If i give 8 - query should return me 4.
    If i give 425 - query should return me 2.
    The numbers are delimited with '-' value.
    Please help.
    Thanks in advance.
    Edited by: 868171 on Jun 24, 2011 4:33 AM
    Edited by: 868171 on Jun 24, 2011 4:34 AM

    do you know the max number of dashes?
    if so
    with t as (select  '152-425-3265-8-5623-45' code, '425' num from dual union
                   select  '152-425-3265-8-5623-45' code, '8' num from dual)
    select code, num, case num when  regexp_substr( code,'[^\-]+',1,1) then '1'
                   when  regexp_substr( code,'[^\-]+',1,2)  then '2'
                   when  regexp_substr( code,'[^\-]+',1,3) then '3'
                   when  regexp_substr( code,'[^\-]+',1,4)  then '4'
                   when  regexp_substr( code,'[^\-]+',1,5) then '5'
                   when  regexp_substr( code,'[^\-]+',1,6)  then '6'
                   else 'not found' end result
    from t
    CODE     NUM     RESULT
    152-425-3265-8-5623-45     425     2
    152-425-3265-8-5623-45     8     4or if you have 11g you can use regexp_count
    with t as (select  '152-425-3265-8-5623-45' code, '425' num from dual union
                   select  '152-425-3265-8-5623-45' code, '8' num from dual)
    select code, num, regexp_count(regexp_substr(code,'^.*'||num||'.'),'-')
    from tEdited by: pollywog on Jun 24, 2011 7:55 AM

  • How do i return the count of matching characters in 2 string

    hi guys,
    is there any comparision function in oracle that return the number of matching character between 2 string ?
    example - 'josephine' and 'johnny'
    return 3 ('j','o' and 'n')
    please advice,
    Best Regards,
    Noob

    Hi,
    Type creation:
    CREATE TYPE t_character AS OBJECT
       v_character varchar2(1)
    CREATE TYPE characterList AS TABLE OF t_character;
    /Function creation:
    CREATE OR REPLACE FUNCTION fnc_compare_string(p_string_1 IN VARCHAR2,
                                                  p_string_2 IN VARCHAR2) RETURN VARCHAR2 IS
       RESULT  VARCHAR2(4000);
       v_list1 characterList := characterList();
       v_list2 characterList := characterList();
       v_first BOOLEAN := TRUE;
       c_separator CONSTANT VARCHAR2(1) := ',';
    BEGIN
       FOR i IN 1 .. length(p_string_1) LOOP
          v_list1.EXTEND;
          v_list1(i) := t_character(substr(p_string_1,
                                           i,
                                           1));
       END LOOP;
       FOR i IN 1 .. length(p_string_2) LOOP
          v_list2.EXTEND;
          v_list2(i) := t_character(substr(p_string_2,
                                           i,
                                           1));
       END LOOP;
       FOR reg IN (SELECT DISTINCT *
                     FROM TABLE(CAST(v_list1 AS characterList))
                   INTERSECT
                   SELECT DISTINCT * FROM TABLE(CAST(v_list2 AS characterList))) LOOP
          IF v_first THEN
             v_first := FALSE;
             RESULT  := RESULT || reg.v_character;
          ELSE
             RESULT := RESULT || c_separator || reg.v_character;
          END IF;
       END LOOP;
       RETURN(RESULT);
    END fnc_compare_string;Test:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> select fnc_compare_string('post', 'most') from dual;
    FNC_COMPARE_STRING('POST','MOS
    o,s,t
    SQL> select fnc_compare_string('post', 'jhon') from dual;
    FNC_COMPARE_STRING('POST','JHO
    o
    SQL> select fnc_compare_string('post', 'was') from dual;
    FNC_COMPARE_STRING('POST','WAS
    s
    SQL> select fnc_compare_string('post', 'w') from dual;
    FNC_COMPARE_STRING('POST','W')
    SQL> Regards,

  • I get "there are non ASCII characters in the local part of the recipient's address" when trying to send emails as BCC. email addresses are all good!

    I used to send out christmas greetings from my biz to groups of 20 customers, in BCC format. all addresses are good, but the emails don't get sent now because of the supposed ASCII problem.

    Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Order by on the basis of last characters of the column

    hi
    i have this type of data in Column
    ABL - Allied Corp. services (XES) - Newyork
    ABL - Allied Corp. services (XES) - Chicago
    SBS - Logistics - Newyork
    ETC..
    As the last characters are for city and i want to perform order by on the basis of city.The naming convention is "the name always contain two hiphens(-)
    and the city name in the last".(means after second '-')
    Regards

    SQL> INSERT INTO dt_test VALUES('ABL - Allied Corp. services (XES) - Newyork');
    1 row created.
    SQL> INSERT INTO dt_test VALUES('ABL - Allied Corp. services (XES) - Chicago');
    1 row created.
    SQL> INSERT INTO dt_test VALUES('SBS - Logistics - Newyork');
    1 row created.
    SQL>
    SQL> select
    2 column_1
    3 FROM
    4 dt_test
    5 ORDER BY
    6 SUBSTR(column_1, INSTR(column_1,'-',1,2) + 2);
    COLUMN_1
    ABL - Allied Corp. services (XES) - Chicago
    ABL - Allied Corp. services (XES) - Newyork
    SBS - Logistics - Newyork

  • How to change the position of my report in the web browser?

    when I create a report by HTMLDB, the report is always on the left side of the browser. how to move it to the center? I tried to use other templates, but it did not work.

    Hello,
    Try on the outer table of the template add the attribute align="center"
    <table summary="" align="center">.........
    Carl

  • How to get the position of a tag in XML,when i am using the org.xml.sax

    Hi,
    I am able to parse a xml document.I want to get the position of a tag in the document.So that by keeping that as reference, i can access other tags.Plz help me.I am using org.xml.sax API.

    Hello Friends
    After research , I could also find another way to check the existence of a node .We can even use CHOOSE to check the existence.
    <xsl:choose>
          <xsl:when test="(/mynode)">
              your action if the mynode is found
          </xsl:when>
          <xsl:otherwise>
                    action if mynode is not found
          </xsl:otherwise>
    </xsl:choose>
    Thanks.
    Wishes
    Richa

  • How to delete characters to the right of the cursor position

    On a PC, the <Delete> key deletes characters to the right of the cursor, while <Bkspace> does the same for characters on the left.
    On the MAC, the <Delete> key removes only characters to the left of where the cursor is, and there is no <Bkspace> key.
    Although <fn> plus <Delete> can achieve this 'rightward' delete, is there a way to do it using a single key on the MacBook?
    Thanks. Replies appreciated.

    Hi Stevenray1
    You have two delete keys on your Mac keyboard. The one in the place of the "backspace" key does indeed remove characters to the left of the cursor. But if you look at your keyboard there is a second one in the set of keys above the cursor keys. On my keyboard that delete key also has an arrow with an X in it pointing to the right. Use that one and you'll see that it will remove characters to the right of the cursor.
    Rick

  • How to determine the geometric bounds of characters in ID CS3

    I am working on a script that needs to know the positions/bounds of the text hyperlinks on a page. Although you can get bounds for page items such as text frames it doesn't seem possible to get the bounds of characters, ranges of characters or even hyperlinks. It doesn't seem right that you should have to calculate the position of specific characters. Am I missing something?
    Many thanks in advance.

    Chris,
    have you looked at the properties:
    horizontalOffset and
    endHorizontalOffset
    for a character/word ?
    Stefan

  • Handling Non-English characters in the payload

    Hi Gurus,
    We are currently facing an issue in XI with Non-English characters. When we are trying to process Non-English characters in the payload , they are getting converted in to Junk characters at the receiver end. This scenario inbound to SAP ( File to Idoc scenario ) . Is there a way that Non-English characters can be handled in XI.
    Regards,
    Nick

    Hi Nick,
    I have knowledge of some problems when showing some kind of chinese character when
    dusplaying XML messages. If it's the case, check notes:
    #1135671 - ITS HTML viewer: incorrect display of xml documents
    #1072127 - ITS HTML Control: xml file rendering problem
    With regards,
    Caio Cagnani

Maybe you are looking for

  • LZM Scheduling agreement: delivered lines still generate requirement in MRP

    Hi all, The problem I have is simple: - schedule agreement for finished goods of type LZM - the forecast lines are not updated daily and sometimes we can still have forecast lines for which deliveries were already performed Those lines are still pres

  • EJB Exception occurred during invocation from home: com.bea.content.manager

    BEA 8.1 Team, Is there any limitation on BEA Repository such as number of nodes, etc. I have a serious production issue. All i could see from the LOG file is the stact trace which i have posted it here. ####<Aug 24, 2006 8:04:57 AM CDT> <Info> <EJB>

  • :( AT&T iphone stolen, found, returned damaged

    Hi, I am at my wits end and wonder if anyone can suggest a solution.... last night my new iphone 3 gs was stolen from my car when I was on a late night run to the grocery store for milk. This morning a friend that works at the grocery store showed up

  • ORA-02049

    HI, I get the "ORA-02049: timeout: distributed transaction waiting for lock" error message when i run the query it works fine when i run it in pl/sql developer but in apex.... no bueno what does this error mean and how can i fix it??? select a.object

  • Confused About Router Whereabouts

    Alright here's the basic gist: I'm totally lost. I just bought a Wireless -G Broadband Router with SpeedBooster and a Wireless -G PCI Adapter with Speedbooster, okay? So I go an hook up my Compaq computer and discover I dunno what to even do. Alright