Simple question - compare Strings with SSIS expression language

SSIS variables - strOne = YES, strTwo = YES. I want to compare strings using ssis expression language (ie inside a variable's expression box, constraint of task flow arrow etc).
Will @strOne == @strTwo be true ? I hope its not like programming languages where you need to do
@strOne.Equals(@strTwo) instead of ==. Also is @strOne == "YES" true ?

([User::strOne] == [User::Strtwo] ? True : False)
The third variable created should be of type boolean if you're using above expression. if its of type int return 0 and 1 instead of False and true
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to split a string with regular expression

    Hi.
    I need to split a string with a regular expression.
    Example
    String = "this is; a test";rune haavik;12345;
    And I want the output to be:
    "this is; a test"
    rune haavik
    12345
    If I use this code:
    private void test1()
    String str = "\"this is; a test\";rune haavik;12345;";
    int i=0;
    String[] tmp = str.split(";");
    while(i<tmp.length)
    System.out.println(tmp);
    i++;
    Then it splits also in the "" text.
    Regards
    Rune haavik

    Rune haavik:
    The most effective way to achieve the end result is, I believe, to read the characters one by one, using a flag that indicates if we are inside quotation or not.
    Well, if we are in a mind game, then the following should do.
           String[] tmp = str.split(";(?![^\"]*\";)");

  • Comparing Strings with "If" statements : help please. :-)

    I have an assignment for class... and having lots of trouble trying to figure out what I did wrong. I cannot find a solution.. if anyone can help me with this, it'd be much appreciated.
    Assignment Write a program to allow the user to calculate the area and perimeter of a square, or the area and circumference of a circle, or the area of a triangle.
    To do this, the user will enter one of the following characters: S, C, or T. The program should then ask the user for the appropriate information in order to make the calculation, and should display the results of the calculation. See the example program execution shown in class.
    The program should use dialog boxes.
    When expecting an S, C, or T, the program should reject other characters with an appropriate message.
    Get extra points for allowing both the uppercase and lowercase versions of a valid character to work. Name the program ShapesCalc.java.My error codes are
    incomparable types: java.lang.String and Char
    cannot find symbol variable output
    incomparable types: java.lang.String and Char
    incomparable types: java.lang.String and CharI've asked a friend and they said something about Strings cannot be compared in "If" statements... if that is the case.. how is this supposed to be arranged? If you can point me in the right direction, I will be very grateful! :-)
    What I have created so far
    import javax.swing.JOptionPane;
    public class ShapesCalc {
        public static void main(String[] args) {
          //Enter S,C, or T
          String input = JOptionPane.showInputDialog("Enter S,C, or T");
          //If Statements
          //Square
          if (input == 'S'){
               String lengthu = JOptionPane.showInputDialog("Enter length of a square");
               double length = Double.parseDouble(lengthu);
               double area = length * length;
               double perimeter = length * 4;
               String ouput = "The area is " + area + " and the perimeter is " + perimeter;
               JOptionPane.showMessageDialog(null, output);}
          //Circle
          else if (input == 'C'){
               String radiusu = JOptionPane.showInputDialog("Enter the radius of a circle");
               double radius = Double.parseDouble(radiusu);
               double area = 3.14159 * radius * radius;
               double circumference = 2 * 3.14159 * radius;
               String output = "The area is " + area + " and the circumference is " + circumference;
               JOptionPane.showMessageDialog(null, output);}
          //Triangle
          else if (input == 'T'){
               String baseu = JOptionPane.showInputDialog("Enter the base of a triangle");
               double base = Double.parseDouble(baseu);
               String heightu = JOptionPane.showInputDialog("Enter the height of a triangle");
               double height = Double.parseDouble(heightu);
               String output = "The area is " + (base * height) / 2;
               JOptionPane.showMessageDialog(null,output);}
          //Error Message
          else {
               String error = "Incorrect variable please enter S,C, or T only.";
               JOptionPane.showMessageDialog(null,error);}
          //Signature
          String signature = "Rodriguez, Markos has compiled a Java program.";
          JOptionPane.showMessageDialog(null,signature);
    }Edited by: ZambonieDrivor on Feb 22, 2009 6:52 PM

    ZambonieDrivor wrote:
    How would I go about on the extration of a single char from a String to make it comparable, I don't quite understand this part.Read the [Java API|http://java.sun.com/javase/6/docs/api/] for the String class and see what methods it has.
    I will convert the == to equals() method.If you want to compare primitives (ints, chars etc) then using == is fine. Only when comparing objects do you use the equals method.

  • Replace string with regular expression

    I am new to the regular expression. I am just trying to remove double quotes from a string.
    My sample string is sql statement(SELECT "SCHEMA"."TABLE1"."COLUMN1", "SCHEMA"."TABLE1"."COLUMN2" FROM "SCHEMA"."TABLE1", "SCHEMA"."TABLE2" WHERE "SCHEMA"."TABLE1"."COLUMN1" = "SCHEMA"."TABLE2"."COLUMN1" );
    This is what I came up with.
    String s = query.replaceAll("\\.\"", ".").replaceAll("\"\\.", ".").replaceAll("\\s\"", " ").replaceAll("\\s\"", " ").replaceAll("\",", ",").replaceAll("\"\\s", " ");
    But I want to optimize this line.
    Could anybody tell me how to call replaceAll once with using regular expression instead of calling replaceAll multiple times? Some table or column names can have double quotes, so I want to remove the double quotes without replacing the double quotes which is part of the table or column name.
    I'd appreciated it.

    caesarkim1 wrote:
    I am new to the regular expression. I am just trying to remove double quotes from a string.
    My sample string is sql statement(SELECT "SCHEMA"."TABLE1"."COLUMN1", "SCHEMA"."TABLE1"."COLUMN2" FROM "SCHEMA"."TABLE1", "SCHEMA"."TABLE2" WHERE "SCHEMA"."TABLE1"."COLUMN1" = "SCHEMA"."TABLE2"."COLUMN1" );
    This is what I came up with.
    String s = query.replaceAll("\\.\"", ".").replaceAll("\"\\.", ".").replaceAll("\\s\"", " ").replaceAll("\\s\"", " ").replaceAll("\",", ",").replaceAll("\"\\s", " ");
    ...Note that the following two lines are equivalent:
    s = s.replaceAll("a","").replaceAll("b","");
    s = s.replaceAll("a|b","");

  • "dynamic" String concat in Expression language

    I would like to do something like (in Java)
    String s = flag? "this" : value + "that";in EL it would be #{flag ? 'this' : value + 'that'} but this leads to an error because it tries to add as numbers and not concat as strings.
    how can I do this?
    thanks

    maurozoom wrote:
    thanks
    I've been googling for the whole day with no answer.You are terrible at it then.
    >
    I think there's no solution for my problem in ELHere are two search results which contain solutions to your problem from the search I posted:
    http://www.velocityreviews.com/forums/t133287-el-concat-strings.html
    http://marc.info/?l=myfaces-user&m=114123737923937&w=2

  • Simple question on Strings

    Is there a cleaner (and/or easier) way of adding a string value into another string? ie:
    String myString = "How You?";
    int i = myString.indexOf(" ");
    String a = myString.substring(0,i); //should equal "How"
    String b = myString.substring(i,myString.length()); //should equal " You?"
    String c = a + " Are" + c; //should equal "How Are You?"

    Sounds good to me.
    Although in this particular example you could have done either:String c = myString.replaceAll(" ", " Are "); // (1.4+)-or-String c = myString.replace(" ", " Are "); // (1.5+)Also there are the StringBuffer or StringBuilder (1.5+) classes which have an insert(int,String) method.
    Regards

  • Re: comparing String with a NodeValue in XML

    Hello Syed,
    you have to do the comparison it with ".equals()" instead of "==", thus try:
    if (search.equals(node.getFirstChild().getNodeValue()){
    Reinhard

    Thanks Reinhard
    works just fine. The only thing left is
    if (node.getFirstChild().getNodeValue() != search)
              System.out.println(" Search Result NOT Found ");
    cus its still displaying the message "NOT Found"
    cheers
    Syed

  • A simple question about deployment with SDM

    I've deployted an EAR onto thte server with SDM. Now want to redeploy it. Should I undeploy the old one first, or can I simply depoy it again?

    Hi Thomas
    You can redeploy the Ear file through SDM by selecting the option:
    "<b>update deployed SCAs/SDAs that have the same or lower component versions than the selected SCAs/SDAs</b>" after adding Ear file to deploy in deployment tab under "<b>Deployment Configuration</b>"
    Cheers !!!
    Best Regards
    Satish Kumar.

  • Nokia X6 simple question to start with

    Hi,
    just bought a X6 and struggling like many. I think I know how to use the GPS (will try this weekend) but I am used to the GPS pointing towards the actual position, not the north. A car GPS or a Tomtom point in the direction you're going or pointing the device, but how can I change that on my X6 ?
    thanks for your patience
    Pierre from Belgium

    I have an X6 16GB and always get a satellite lock in under two minutes. Even the first time I used the map function I got a lock in under two minutes. Also when I type in a destination the map points in the direction I am travelling and the compass (lower left at bottom of screen) points north, which is the same as my TomTom. Obviously you guys are doing something wrong. Have you read the online user manual. I always make a habit of reading tne user manual of any product I am thinking of buying before I make a purchase. I think it is called (1) research and (2) Common sense. So I suggest you read the online manual and also the FAQ's. I must admit the maps function is not as intuitive as the TomTom but once you have set a destination and are using it for navigation to get to your destination it works the same as the TomTom. I know this because I have them both in their cradles along side of each other in my car.

  • [Simple Question] g.drawImage() - with "double" arguments for location

    I think the subject says it all, I'm looking for something kind of like this:
    double x = 7.5;
    double y = 2.4;
    g.drawImage(img, x, y, this);Thanks,
    Nate

    natdizzle wrote:
    I'm just trying to slow down a picture thats moving around the screen, but the design is kinda complex. I guess I just need to think about it.There's a technique in programming about making something time-based as opposed to frame based. Usually we start off making something frame base and end up getting fustrated when drops or speed ups in the fps cause drastic effects in the smoothness of the game/animation.
    To combat this we make a program time based by storing a global variable, say "frameSpeed". We then program as though it were a constant 30 fps (or any other arbitrary number). The "frameSpeed" would then be +30 / actual fps+ . So if we were moving at 60 fps then "frameSpeed" would be .5.
    This global variable is then used in all the calculations. So where as previously we may have had
    x += xSpeedwe now have
    x += xSpeed * frameSpeedWhen you introduce more complex concepts like acceleration the math is a little harder. But if you can make your program time based, then it will be smooth across many frame rates. You could even forcefully manipulate "frameSpeed" to cause your whole program to speed up or slow down into a bullet-time effect.

  • Compare Strings using JSTL

    How can I compare strings with JSTL? One string is a stored date and the other is a generated date. My goal is to set the correct date in a dropdown menu with date values (yyyy-MM-dd) by comparing the current date with the stored.
    Code
    <%
    Calendar cal = Calendar.getInstance(timezone, locale);
    Format fm = new SimpleDateFormat("yyyy-MM-dd");
    String date2 = (String) fm.format(cal.getTime()); %>
    <c:set var="date1" value="${mb.date}" />   // from database lookup (MySQL Date)
    <p><c:out value="${date1}"/>=<%=date2%>:<c:out value="${date1 == '<%=date2%>' }" /></p>The result is:
    2004-08-03 = 2004-08-03 : false

    well, about this:
    <%
    Calendar cal = Calendar.getInstance(timezone, locale);
    Format fm = new SimpleDateFormat("yyyy-MM-dd");
    String date2 = (String) fm.format(cal.getTime());
    pageContext.setAttribute("date2",date2);
    %>
    <c:set var="date1" value="${mb.date}" />   // from database lookup (MySQL Date)
    <p><c:out value="${date1}"/> .equals <%=date2%>:<c:out value="${date1eq date2}" /></p>I try to use the EL 'eq' like you would use '.equals()' in regular java, and EL '==' like regular java '==' And since we are comparing Strings here, which are objects, we would use .equals rather than ==, since == compares refernce and .equals compares value...

  • Simple question: validate infocube data by comparing it with PSA data

    Hi all,
    I want to validate infocube data by comparing it with PSA data, for that i went through PSA via context menu. After that i generated export datasource. Then i am not able to find PSA Export datasource? where can i find that..
    Thanks
    raju

    Hi all,
    I´ve tryied to VALIDATE INFOCUBE DATA BY COMPARING IT WITH PSA DATA making the step by step contained in the HOW TO ...
    The problem is that I have the following error when i activate the transfer rules after aggregating the infoobjet 0TCTREQUID and don´t know how to resolve it:
    " IDoc segment /BIC/CICA7ZBW_RECEP_DI could not be assigned to IDoc ZSCA002
    Message no. RSAR240
    Diagnosis
    The transfer structure is assigned to IDoc ZSCA002 as an IDoc segment for the data transfer between source system and Business Information Warehouse.
    This assignment failed.
    System response
    IDoc segment /BIC/CICA7ZBW_RECEP_DI not known to IDoc V2&. Therefore, no data import can take place from the source system for this InfoSource."
    Any idea of what could have happend?
    Thanks in advance,
    Diego

  • Question about expression language

    Hello,
    I have a question about expression language - is it possible to access one variable using abother EL as variable name? For example?
    ${applicationScope[${sessionScope.project.name}]}Or is there any other way of achieving that?
    Thanks a lot for your help
    Cheers,
    Maciej
    Edited by: swider on Oct 29, 2008 2:12 AM

    I ran some other tests and I found out that following expression does not return value:
    ${applicationScope[sessionScope.project.aclId]}but this one is working
    ${applicationScope[sessionScope.aclId]}It is very strange. Project class ia simple JavaBean, has two members (Long and String).
    Any ideas what can be wrong with that?
    Cheers

  • I PXI 1010 with Digital Osci, RIO cards. Any simple projects to illustrate PXI with Signal Express and/or using Digital Osc.?

    I have PXI 1010 with card for Digital Osc. Also have ELVIS. Any suggestions on oa simple project to illustrate applications of PXI - using Dig OSc and/or ELVIS. Any suggestions to illustrate PXI with Signal Express exercises. This is for undergraduates in EE Engg.

    Hi, yes, that does help, thank you for your reply.  Signal express does make it easy to work with multiple devices, as I am, though something seems to be amiss with the timing between cards.  For example, setting Signal Express to do nothing more than log data at 100 pts/sec on all channels on all three cards (PCI-6289), and using the software trigger in Signal Express to start the digitization process, and the stop button, to stop data logging, certainly seems to be a very convenient solution.  However, the longer I record (an hour seems to be enough time), the more likely that a signal recorded on all three cards, will not synch, point to point, (comparing signals recorded on channel 0 on all three cards, which I believe should be captured simultaneously through out the recording process, for example) and data recording does not stop simultaneously on all three cards.  I can handle the data logging not stopping simultaneously, but my source signal apparently not being recorded synchronously is a whole other problem, and the impetus for my question.  Thanks for the tip about NI-SCOPE, I was going to start working with that on a different project.
    I am using the most recent versions of SignalExpress, NIDAQmx drivers, etc., on a PC running 64-bit windows 7.
    regards,
    Brian

  • SSIS Expression to Server Name from a Connection String

    Hi,
    I have an SSIS variable which contains a connection string as follows; -
    User::strD​YNconnecti​on {Data Source=myServer;Init​ial Catalog=myDatabase;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX} String
    I need to get the server name from the above variable using an SSIS expression so I can pass the server name to another function.
    Thanks in advance,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Hi Kieran,
    This works fine when the Data source comes first in the connection string (which it usualy does). but when it doesn't,
    e.g.
    Init​ial Catalog=myDatabase;Data Source=myServer;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX}
    you will get 'myDatabase' as an answer
    I would add 'Data source =' in the find string (and adjust for length of this search string to add sufficient offset)
    e.g.
    SUBSTRING(RIGHT(@[User::strDYNconnection],LEN(@[User::strDYNconnection]) - 11 - FINDSTRING(@[User::strDYNconnection],"Data Source=",1)),1,FINDSTRING((RIGHT(@[User::strDYNconnection],LEN(@[User::strDYNconnection]) - 11 - FINDSTRING(@[User::strDYNconnection],"Data
    Source=",1))),";",1) - 1)
    Even this is not foolproof, when the Data source is the last element in the string and there is no ending ;
    e.g.
    Init​ial Catalog=myDatabase;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX;Data Source=myServer}
    the formula needs to be extended further with a ( ? : ) operator around the last operator to see if the last ";" was found or not.
    Jan D'Hondt - SQL server BI development

Maybe you are looking for

  • External Hard Drive doesn't show particular folder

    I have this weird issue with my hard disk. Have been using Seagate GoFlex 1 TB for quite some time, on Windows as well as on Mac. Recently I had copied a folder with lot of videos on Windows. But when I opened the Hard Disk on Mac, the folder was bla

  • URGENT: TRANSPORTING APPRAISAL TEMPLATE

    Dear Friends, I had created an appraisal template in my SandBox development client. I then downloaded it and then uploaded it in the Golden Masters Client. I also created a transport request at the time of saving the template in Golden Masters. In my

  • IPad mini freezes when keyboard pops on password field

    Hi, Is it just me? When in a form it's turn for the password field (registrations take two of these -.-), it usually stops the iPad (iOS 7) and you have to wait in order to start typing on the keyboard, or you type and then it writes it down pretty f

  • Re: EOS 5D Mark II fails to connect (Code 43) but 5D Mark III connects fine!

    Hi Mike, I'm new to this forum and this is my first post. I had looked for the Delete Post option but couldn't locate it. Here's a quick update. I later discovered the one pin on each of the 5D Mark II port was bent, using a VisibleDust sensor loupe.

  • How do you calculate a (base * power) sans math.pow?

    I've been tasked with trying to figure out how to do an exponent question without using the math.pow(3,2) method. How would I do that?