Count from a string

i am using this formula
{USR_CR_RISK_CHANGE;1.DETAIL}[instrrev({USR_CR_RISK_CHANGE;1.DETAIL},'OLD: LowRisk')-1 to length({USR_CR_RISK_CHANGE;1.DETAIL})];
this retrieves
OLD: LowRisk NEW: MediumRisk
which is what i want
i want to then get a count of how many risk changes there were from low to medium
the original string looks like this
| LastOper OLD: SQLUSER NEW: LUCI01| LastModify OLD: May 11 2009 10:03AM NEW: May 11 2009 12:17PM| RiskClass OLD: LowRisk NEW: MediumRisk
if there is a way to get a count from the original string that would work also
thanks

if instr({@OLD LOW RISK},'LowRisk') > 0
and
instr ({@OLD LOW RISK},'MediumRisk')>0 then
1 else 0
This seems to work

Similar Messages

  • How to extract an element value from a String of HTML

    I have a web service that returns a fragment of HTML that contains a number in a table. The return parameter type is a string. I need to get this number and use it in a BPEL while loop, as the condition for the loop (while the number > 0).
    I have tried using the function bpws:getVariableData() but the BPEL PM faults and says: XPath expression failed to execute. Error while processing xpath expression. I think this is because I am trying to apply an XPath expression over a String variable.
    The return value from my web service looks like this:
    <whileConditionResultSet>
    <part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="response">
    <ns1:string_Response xmlns:ns1="http://systinet.com/xsd/SchemaTypes/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d:string">
         <p>SQL Query: select count(*) from delta_manages</p>
         <p><table border='1'>
              <tr> <th bgcolor='#C0C0C0'>COUNT(*)</th></tr>
              <tr> <td>28</td></tr>
              </table>
         </p></ns1:string_Response>
    </part>
    </whileConditionResultSet>
    How do I get the value from the HTML table into a BPEL variable?

    the doSqlService() which executes an arbitrary SQL statement, returns a string of HTML like this:
    <doSqlServiceResponse>
    <part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="response">
    <ns1:string_Response xmlns:ns1="http://systinet.com/xsd/SchemaTypes/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d:string"><p>SQL Query: select count(*) from delta_manages</p> <p><table border='1'> <tr> <th bgcolor='#C0C0C0'>COUNT(*)</th></tr> <tr> <td>14</td></tr> </table></p></ns1:string_Response>
    </part>
    I then copy the result to the whileResultString variable
    <variable name="whileResultString" type="xsd:string"/>
    <copy>
                                       <from variable="doSqlServiceResponse" part="response" query="/ns1:string_Response">
                                       </from>
                                       <to variable="whileResultString"/>
                                  </copy>
    I realise too, a root element will be needed. This is not a mission critical problem as we could change the web service at the other end. It was originally designed for a client to display the results rather than use them within a business process. Anyway, I'm just interested to know if I can create a node from this string data in BPEL.
    Ross.

  • How to get specific character from a string

    I have a value such as: 0-5 or 123-30. This is a combination
    from 2 different IDs.
    All I need is to get the number on the right (5 from 0-5 OR
    30 from 123), any number on the right of the "-" character not
    including
    the "-"
    I'm not sure what ColdFusion function can I use safely.
    I said safely since all I can find is either Left or Right
    functions. With these 2 functions, I need to specify the number of
    character to extract while in my case the application is growing so
    the ID may currently be only 1 digit each (0-5) but later it may
    grow longer (123-5677).
    If anyone know the function, please help me. Thank you!

    Something like this?
    Mid(string, Find("-",string)+1 ,
    Len(string)-Find("-",string))
    Since
    Mid(string, start, count)
    and
    Len(string or binary object)
    and
    Find(substring, string [, start ])
    Or perhaps ....
    ListLast(string, "-")
    since
    ListLast(list [, delimiters ])
    Phil

  • Collumn Count from Database Table

    Hello,
    I wan't to get a Collumn Count from a Table in my Database, but I don't know how to do that.
    I use a ResultSet, and if i press ctrl + spacebar in NetBeans I get a list of all kind of things I can get out of the result set but I can't find CollumnCount anywhere.
    I thought I could use a try catch statement like this:
    try
    for(i=1; i<999; i++)
    myResultSet().getString(i);
    catch( Exception e )
    AantalKolommen = i--;
    But everytime I get an Exception over Invalid Crursor State and "i" keeps standing on 1.
    Does anybody know a way to find out how to get a collumns count????

    To retrieve the columns for a table use
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)
    To get the columns for your result set use
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSetMetaData.html#getColumnCount()
    To get the ResultSetMetaData use
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html#getMetaData()

  • How to get separators from a string

    I need to find the thousand separator, hundred separator and decimal separator from a string. I need to check which separator is available in a string ie., thousand or hundred separator. There may be a case where there is no separators.
    Please suggest me. I would be greatful if you provide me a code snippet.
    Thanks in advance...

    Hi Ananth,
    Try following:
    //For decimal fraction
    if (Count(Split(StrReverse(ToText ({OINV.DocTotal})), '.') ) > 1) then "With Decimal" else "Without Decimal"
    //For Units
    //Convert numbers to string valule
    //Reverse the string so that you cold parse them accordingly in units, hundreds, thousands etc
    //and finally split and parse each comma
    if
        Length
            Split
                    (Split(StrReverse(ToText ({OINV.DocTotal})), '.')[2]) , ','
                )[1]
        ) <= 2
    ) Then "Hundreds"
    Else "Thousands"
    You can continue on length of each subscript in array for hundreds, thousands, millions...
    Cheers,
    Kashif Ali

  • Strip the first character from a string

    i am trying to strip the leftmost character from a string
    using the following:
    <cfset Charges.DTL_CHG_AMT_EDIT =
    #Right(Charges.DTL_CHG_AMT_EDIT,Len(Charges.DTL_CHG_AMT_EDIT)-1)#>
    i keep getting the following error:
    Parameter 2 of function Right which is now -1 must be a
    positive integer

    > RemoveChars() much easier than Right()? How so?
    Semantically, if the object of the exercise is to *REMOVE
    CHARacters from a
    string* (which it is, in this case), it is simply better
    coding to use
    removeChars() rather than right(). That, and it's one less
    function call
    (the RIGHT() solution also requires a call to LEN() for it to
    work).
    So removeChars() is "easier" because it reflects the intent
    of the exercise
    directly, is simpler logic, is easier to read, and - I can't
    be arsed
    counting keystrokes - is probably less typing.
    That'd be how.
    Adam

  • Replacing a set of characters from a string in oracle sql query

    I want to replace a set of characters ( ~    !     @    #     $     %     ^     *     /     \     +    :    ;    |     <     >     ?    _  ,) from a STRING in sql
    select 'TESTING ! ABC 123 #'
    FROM DUAL;
    What is the best way to do it? Please provide examples also.

    What is your expected output... The query I posted just removes them, it never replaces them with spaces..your string already has space.. if you want to remove space as well .. try this...
    SELECT TRANSLATE ('TESTING ! ABC 123 #', '-~!@#$%^*/\+:;|<>?_, ', ' ') FROM DUAL;
    Output:
    --TESTINGABC123
    Else post your expected output..
    Cheers,
    Manik.

  • Problems with Reflection API and intantiating an class from a string value

    I want to instantiate a class with the name from a String. I have used the reflection api so:
    static Object createObject(String className) {
    Object object = null;
    try {
    Class classDefinition = Class.forName(className);
    object = classDefinition.newInstance();
    } catch (InstantiationException e) {
    System.out.println(e);
    } catch (IllegalAccessException e) {
    System.out.println(e);
    } catch (ClassNotFoundException e) {
    System.out.println(e);
    return object;
    Let's say my class name is "Frame1".
    and then if i use:
    Frame1 frm = (Frame1) createObject("Frame1");
    everything is ok but i cannot do this because the name "Frame1" is a String variable called "name" and it doesn't work like:
    name frm = (name) createObject("Frame1");
    where i'm i mistaking?
    Thanks very much!

    i have understood what you have told me but here is a little problem
    here is how my test code looks like
    Class[] parameterTypes = new Class[] {String.class};
    Object frm = createObject("Frame1");
    Class cls = frm.getClass();
    cls.getMethod("pack",parameterTypes);
    cls.getMethod("validate",parameterTypes);
    everything works ok till now.
    usually if i would of had instantiated the "Frame1" class standardly the "cls" (or "frm" in the first question ) object would be an java.awt.Window object so now i can't use the function (proprietary):
    frame_pos_size.frame_pos_size(frm,true);
    this function requires as parameters: frame_pos_size(java.awt.Window, boolean)
    because my cls or frm objects are not java.awt.Window i really don't find any solution for my problem. I hope you have understood my problem. Please help. Thanks a lot in advance.

  • How can i store values from my String into Array

    Hi guys
    i wants to store all the values from my string into an array,,,, after converting them into intergers,,,, how i can do this becs i have a peice of code which just give me a value of a character at time,,,,charat(2)...BUT i want to the values from String to store in an Array
    here is my peice of code which i m using for 1 char at time
    int[] ExampleArray2 = new int[24];
    String tempci = "Battle of Midway";
    for(int i=0;i>=tempci.length();i++)
    int ascii = tempci.charAt(i); //Get ascii value for the first character.

    public class d1
         public static final void main( String args[] )
              int[] ExampleArray2 = new int[24];
              String tempci = "Battle of Midway";
              for(int i=0;i<tempci.length();i++)
                   int ascii = tempci.charAt(i);
                   ExampleArray2=ascii;
              for(int i=0;i<ExampleArray2.length;i++)
                   System.out.println(ExampleArray2[i]);

  • Getting char values from a string problem

    Hi,
    Here's an example of what I'm trying to do:
    boolean loopSwitch = true;
    while (loopSwitch)
         String orderDecider = JOptionPane.showInputDialog (null, "Would you like your numbers to be ordered in   ascending or descending order(A/D)",      "Order decision", JOptionPane.QUESTION_MESSAGE);
         if (orderDecider == A)
         loopSwitch = false;
         }I basically want the user to input either a/A/d/D and to get the char values from the string so I can use them in an if statement.
    Basically, I wanna parse the string into a char.
    Is this possible?
    Thanks.
    Edited by: xcd on Oct 16, 2009 8:38 AM

    Why not just use the String.equals() method to compare a String to a String?
    But if you must, you can use the String.charAt() method to return a char at a particular location in the String.
    Note: char literals need to be surrounded by single quotes ('A') and String literals need to be surrounded by double quotes ("A").

  • Removing Null values from character string

    Hi All,
    Can i remove NULL values (hexadecimal - 0000) from character string. I am uploading a file from presentation layer (shared server) and getting NULL values in many fields which i want to remove.
    please assist.
    Thanks for you help..
    Regards,
    Mohaiyuddin

    Hi,
    Most likely, nobody needed it, but if anybody in future will need the solution for related problem  - here's solution:
    data: lv_nullchar type xstring value '0'.
    shift lv_xstring right deleting trailing lv_nullchar in byte mode.
    shift lv_xstring left deleting leading lv_nullchar in byte mode.
    This hack deleting null chars in lv_xstring at end file and at begining of file. Works perfect for me, where i also worked with files.

  • How to get the Values i need from a String???

    hi i need some help on my program,
    I have a Server that actually sent some data to my Client.
    The data consist of some messages and intergers . The whole piece of data is stores as a String message.
    ARRAY 'Monitor Chart' 2 5
    'Total OverFlow' 'Queued' 'Completed' 'Host Resets' 'Errors'''
    0.0 1.0 2.0 3.0 4.0
    'Series1' 11.0 0.6 8.6 11.5 6.6
    'Series2' 12.8 6.7 21.6 11.1 30.0Inside the Client i need to get the values out to showed on my textfields
    Example :
    Tf1 = 11.0
    Tf2 = 0.6
    Tf3 = 8.6
    Tf4 = 11.5
    Tf5 = 6.6
    Question: How to i get the values out from the String???

    using the split() method. i am able to split everything now
    so it appear somthing like this :
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class testing{
         String d1 =     "ARRAY 'Monitor Chart' 1 5";
         String d2 = "'Total OverFlow' 'Queued' 'Completed' 'Host Resets' 'Errors'";
         String d3 = "'' 0.0 1.0 2.0 3.0 4.0 ";
         String d4 = "'Series1' 11.0 0.6 8.6 11.5 6.6 ";
         String d5 = "'Series2' 12.8 6.7 21.6 11.1 30.0 ";
         String data = d1 + d2 + d3 + d4 + d5;     
         public testing(){
              System.out.println(data);
              String[] result = data.split("\\s");
              for(int x=0;x<result.length;x++)
              System.out.println(result[x]);
         public static void main (String args[])throws IOException{
            testing Application = new testing();
    }ARRAY
    'Monitor
    Chart'
    2
    5
    'Total OverFlow'
    'Queued'
    'Completed'
    'Host Resets'
    'Errors'''
    0.0
    1.0
    2.0
    3.0
    4.0
    'Series1'
    11.0
    0.6
    8.6
    11.5
    6.6
    'Series2'
    12.8
    6.7
    21.6
    11.1
    30.0
    but how do i get the values out ??how do i noe it is which index or wad?
    11.0
    0.6
    8.6
    11.5
    6.6

  • File Adapter - how to get the file count from a folder

    Hi All,
    I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
    Thanks,
    JJ

    Hi Sarath,
    Thank you for your reply.
    Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
    When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
    The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
    Thanks,
    JJ

  • Escape single quote from a String variable

    Hi,
    I have a String variable called "name" which i am using in my form tag.
    <form name=test action="test.jsp?fname=<%=name%>" method="post">
    But i am getting Javascript error if the "name" variable contains a string with some special characters like single quote( ' ).
    Plz help me to escape this special char from my String variable.
    Thanks..

    You need to url-encode the value using the URLEncoder class.
    http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html
    For example:
    <form name=test action="test.jsp?fname=<%=URLEncoder.encode(name, "ISO-8859-1")%>" method="post">

  • Link between Delivery schedule line counter from PO and the material docume

    Dear Gurus,
    I have one PO with single line item having delivery schedule -
    Material 1 -
    delivery schedule 01.01.2009     2000
                                                         01.03.2009    5000
    I have received quantity against this Po
    I want to know where I can find the link between Delivery schedule line counter from PO and the material document
    Best regards
    Sar

    There is no link from the MAterial document line item (Table Mseg) to the PO Schedule Line (EKET).
    If this is for Evaluating an on time delivery or GR, you may consider the following approach.
    PO details Po Date  QTY
    Sch1   01Jun2009   200   
    SCH2  08Jun2009   100
    GR Details
    GR1   01Jun2009   180
    GR2   07Jun2009   110
    GR3  09Jun2009      10
    Calculate a *** total qty for the PO Line.
    PO details Po Date  CUMUL QTY
    Sch1   01Jun2009   200   
    SCH2  08Jun2009   300
    Calculate a *** total qty for the ontime GR.
    PO details Po Date  CUMUL PO QTY  CUMUL GR on time
    Sch1   01Jun2009   200                180
    SCH2  08Jun2009   300                 290 (180+110)  the 3rd GR was too late
    Evaluate the PO SChedule Lines as follows:
    Po SCL qty + CUMUL GR QTY - CUMUL PO QTY = ADJ GR ON Time Qty
    SCH1 01Jun2009
    200 + 180 - 200 = 180 on time for 01Jun2009 date ( 90% fill rate)
    SCH2 08Jun2009
    100 + 290 - 300 = 90 on time for 08Jun2009 date (90 % fill rate) the first 20 of the GR on 07Jun2009 went to fill the late, early date.
    Best of luck !
    SCH2 100 +290 - 300 = 90 on time for 07Jun2009 date

Maybe you are looking for

  • Running a ProC program from Apps

    Dear all , We have developed custom Pro C Program. It's a huge scheduling program which does somany calculations and prints the log in the Concurrent Program Log using Printf statement. Whenever we run this program from the Backend using telnet login

  • External Displays

    How many individual (not mirrored) external displays can the Macbook Pro support? I need at least 4 for a project that's coming up. Thanks, -Ian B.

  • Audiobook - Part 4 won't play

    Hello! I purchased "The Long Tail" from the iTunes Store. All 4 parts of it play in iTunes but part 4 will not play on my Nano 2G. I have scrubbed and reset it with no joy. When I select the track after a brief pause it will just skip onto the next t

  • Estuve descargando unos cuantos videos de anime desde mega pero cuando cerre el navegador los videos se perdieron , Porque paso eso?

    descargue para ser exactos 27 capitulos de un anime desde mega pero hallé raro que no se me guardaran en la carpeta de descargas y en ves de eso se me guardaban en el escritorio solo 7 episodios se me quedaron en la carpeta de descargas los demas que

  • Inbuilt Item Rendering inside DataGrid .

    Hi , Please find the screen shot attached with this Thread . The data is been populated into the Datagrid from DataBase using ArrayCollection as DataProvider . Now i want to have Radio Buttons displayed at the begning of the each row of Names Column