How can I set a value of column in SSIS by using Replace

How can I set a value of a column in SSIS using a Replace in Derive columns. I have here NameCode and I need to Set = 1 Where NameCode like LIKE '____99____'
eg. 1006993010... if 5th and 6th characters are 99
Else 0
Hope to hear from someone soon and I appreciate great help here.

If NameCode column is integer then you have to cast it correctly to String.
I am adding that to the expression provided by Rajen.
SUBSTRING((DT_WSTR,20)ProductCode,5,2) == "99" ? 1 : 0
-Vaibhav Chaudhari

Similar Messages

  • How Can I set up a JTable columns?

    Dear All,
    How can I set up my JTable columns to have the amount the user specifies?
    for example when the user types in 50 in JTextField 1 I want the JTables columns to then set to 50.
    How can this be done?
    Thanks
    lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

    As you can see I have tried this, but no success.
    If I am doing something wrong please accept my apology, and address me in the right direction.
    Thanks
    Lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
         ((DefaultTableModel)perstab.getModel()).setColumnCount(Integer.parseInt(name.getText()));
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • How can I set default values for Allocate Mode in AO config?

    Hi, How can I set default values for allocate mode in AO config. To be specific, in the attached vi, I need to set the Allocate Mode in AO Config to 'Use FIFO Memory (6)' if the value inside my case structure is false and to 'no change (0)' if the value inside the case strusture is true.
    Solved!
    Go to Solution.
    Attachments:
    generateWaveformFIFO.vi ‏15 KB

    Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
    Misha

  • How can i Set ArrayList values to selectOneListbox

    Please Let me know How can i Set ArrayList values to selectOneListbox dynamically from the managed bean

    Note: beanList is a list of selectItems
    ArrayList<SelectItem> beanList;

  • How can i get the value stored in the session object using its sessionid

    how can i get the value stored in the session object using its sessionid by running stand alone java application

    myforum wrote:
    how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing.

  • How can I set a value in a field before create when a New button is clicked

    Hi,
    I am using
    JDeveloper 10.1.3.1.0.3984 and
    JHeadstart 10.1.3.1 release 10.1.3.1.26
    I have one group and there is a detail group under that group.
    From main group to detail group there are 3 field relating those groups.
    field1
    field2
    fieldSEQ (auto-generated by database trigger)
    These 3 fields are PK.
    In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
    But I don't want to create the record with that SEQ as that will be created in the trigger.
    How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
    Can anybody help?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hello Syad,
    What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
    So something like:
    protected void create(AttributeList AttributeList) {
    super.create(AttributeList);
    SequenceImpl sequence =
    new SequenceImpl("KCP_SEQ", getDBTransaction());
    setFieldSeq( sequence.getSequenceNumber());
    If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team.

  • How can i set a long String to a xmltype field use PHP?

    i can set xml String to xmltype field with:
    $sql_insert_sql = "insert into g_province (p_id,p_regionid,p_provincenameobj,solt)
         values (g_province_q.nextval,'".$_GET['region_id']."',sys.XMLTYPE.createXML('".$xml_con."'),0)";
    but if $xml_con too long,i can not set this content into xmltype fields.
    then , i use :
    <?
    //(tabel_name:articles)DDL; //just for test;
    //create table articles (id number(11),content sys.xmltype);
    //----------This is insert test----------------------------------
    $conn = @OCILogon("in_user","user_in","bigfish");
    $stmt = @OCIParse($conn,"insert into articles (id,content) values(1,xmltype(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
    $clob = @OCINewDescriptor($conn,OCI_D_LOB);
    OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
    OCIExecute($stmt,OCI_DEFAULT);
    if ($clob->save("<root><a>JUST TEST</a></root>")){
    OCICommit($conn);
    echo "Insert succes!";
    else{
    echo "Insert default!";
    //---------------Insert end-----------------------------------------
    //---------------Select start---------------------------------------
    $sql = "select content from articles order by id desc";
    $stmt = @OCIParse($conn,$sql);
    @OCIExecute($stmt,OCI_DEFAULT);
    @OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
    echo "<br>Content is:\"".$rows[0]."\"";
    //---------------Select end-----------------------------------------
    ?>
    run it ,display these errors:
    Warning: ociexecute(): OCIStmtExecute: ORA-22816: unsupported feature with RETURNING clause in /home/www/bigfish/sgtest/testclob.php on line 12
    Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
    Insert default!
    Content is:""
    Warning: Unknown(): ociclose_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
    how can i set long content to xmltype fields??

    geng sun,
    Ora-00600 is an internal Oracle error. You will need to open a tar with Oracle.

  • How can I set default value to a transient parameter  in the VO

    I have created a transient parameter in the VO, which is type of boolean.
    When I try to input the "true" or "True" or "Y" in the 'default value',
    and then running the programm, but all failure.
    so I don't know how can i do.
    Genuinely waiting for you help, thanks in advance.

    Hi Sumury,
    First of all you could check if this transient attribute is read only. to check this, edit the VO and select the transient attribute under the Attributes tab. Then verify if it is marked as "Updateable Always" on the right-hand section.
    If it is updateable, then try setting the default value on the VO Implementation class: open the xxxVOImpl class, go to the transient attribute's setter (setxxx()) and change it to:
    <code> if (getXXX() == null) setAttributeInternal(XXX, "Y");
    else setAttributeInternal(XXX, value);</code>
    This might work. If it does not, then please post the exact message you are receiving when running the app.
    Hope this helps!
    Thiago

  • How can i set the values to text box by selecting from drop down list.

    hi ,
    i am using struts and jsps. i have a dropdown list of names(getting the values of names from database), i want to get address and phone number of that selected one.how can i get that?

    Hi swarupa,
    Well My advice in this senario wud Be
    Either U can make Use of XmlHttp Object through javascript(AJAX way).
    Or U need to Maintain the State of the entire form and then refresh the page to get those results....
    just for U r reference i am attaching a link which was programmed using ASP @ server side and which made use of XmlHttp Object.....
    http://www.w3schools.com/ajax/ajax_database.asp
    Just try to simulate the samething in your own way....
    REGARDS,
    RAHUL

  • How can I set up a 2 column layout in LiveCycle?

    Hi,
    I'm new to working with LiveCycle Designer. I'm using version 10.4, the OEM version bundled with SAP. Aside from being quite buggy, the capabilities seem pretty similar to LiveCycle Designer ES4, which I downloaded in a trial version. All of which is to say that this is a newbie question.
    I cannot, for the life of me, figure out how to set up a 2-column layout.
    On my master page, I have two content areas.
    When I create a new page, I am able to drag fields into the first content area I created, but not into the second content area.
    What am I doing wrong?
    Thanks,
    Janet

    Hi. 
    I am not a new LiveCycle Forms designer.  I am using Workbench ES2 (9.0.0.2.20121123.884160).  I have run into a new design problem related to a two column page. The business analytsts have designed the form in Word, where columns work great.  I have tried two subforms within the page. The problem with that is when the right column subform overflows, it overflows to the left column (as the left column has not overflowed), or when the left column overflows (whether or not the right column overflows) the right column begins on the left column's overflowed page.
    I have tried building a page with two side-by-side content areas in the Master Pages, including setting overflow parameters for each subform in the Design View, also with similar problems.
    I have tried using a table with no header and 1 row.  That one is interesting.  When only one cell overflows to another page, it works correctly.  When both columns overflow, the first text box in the subform in each cell is displayed at the top of the page and the remaining content of both cells overflow to the next page, leaving a nearly blank page containing only the one-line text label in each of the two columns.
    Is there some nearly hidden setting I am missing?  Is this possible within LiveCycle Designer Forms?
    Thanks for your attention to this request.
    Frank

  • How can we set default value within html:file

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?

    Hi,
    guess that one option in a RowImpl would be to check if the attribute is null or if the attribute value can be found in the VO that populates the list. If first is true or seconds false (cannot be found) you return the first value of the VO, making it the current attribute value
    Frank

  • How can I set a value to an Object Array

    I am declaring an object variable like this:
    final Object[][] data = {
    {"Mary", new Integer(5)},
    {"Alison", new Integer(3)},
    {"Kathy", new Integer(2)},
    {"Sharon", new Integer(20)},
    {"Angela", new Integer(4)}
    And I would like to declare it like this:
    final Object[][] data = new Object [6][3];
    But the matter is that when I try to set a value like this:
              data[0][0] = "Hola";
    I got the next Errors.
    TableEditDemo.java:95: ']' expected
              data[r][c] = "Hola";
    ^
    TableEditDemo.java:95: <identifier> expected
              data[r][c] = "Hola";
    ^
    TableEditDemo.java:95: cannot resolve symbol
    symbol : class data
    location: class TableEditDemo.MyTableModel
              data[r][c] = "Hola";
    ^
    3 errors
    Could Somebody Help me please???? Thank you very much.

    I don't see problem for your declaration. Is it possible you forgot to cast data back to whatever class?
    PC

  • How can i set my old ipod touch up to be used by someone else ie wipe all my details etc off and set it up for new user

    Hi i need help i have got a second hand ipod touch generation 4 how can i delete all of the previous owners stuff and set it up for myself to use for facetime etc

    Just restore it. When it gets to the point that asks you if you want to restore from back up or set up as new, select new.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

  • How can I set default value in a field based on a LOV?

    Here's the LOV:
    select txtName, ID
    from FAC_LK_PROJECT_PRIORITY
    order by 1
    I tried:
    select id from FAC_LK_PROJECT_PRIORITY priority where txtname = 'Medium';
    and set the default value type to be PL/SQL function body but that didn't work - I get this error:
    ORA-06550: line 2, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
    Error ERR-9131 Error in PLSQL function body for item default code, item=P19_PRIORITYID
    OK
    The item is a select list w/ db column as source: PRIORITYID

    Hi Scott. thanks for answering. I get from your post that I need to declare a variable and then return something. I changed it to this
    declare v_id number := null;
    begin
      select id into v_id
          from FAC_LK_PROJECT_PRIORITY priority
          where txtname = 'Medium';
      return v_id;
    end;and it works.
    Why do you use a loop? In case there's >1 row returned by the query?

Maybe you are looking for

  • Mikrofon funktioniert nicht Iphone 4

    Hallo mein Mikrofon funktioniert von jetzt auf gleich nicht mehr, wenn ich den lautsprecher einschalte funktioniert es ohne Probleme. Neustart, Wiederherstellung brachte keinen Erfolg. Danke für Support MfG Ralf

  • Air card usage overages and cost

    My wife and I have your 10 gig wireless plan for our computer using the air card too connect.  First of all it's way over priced for what we get,  But even though our router is security protected from hackers we have noticed that the last few months

  • How to restore image after cropping

    void cropLayer(PIActionDescriptor descPosition, int32 layerIndex, PIActionDescriptor  currLayer)         // get "currLayer" layer bounds        error = sPSActionDescriptor->GetFloat(descPosition, keyTop, &top);        error = sPSActionDescriptor->Get

  • URGENT: XSERVE RAID, FCP 5.04, and IT KEEPS FREEZING

    Let me lay it out: I have Xserve Raid and I am attempting to work with Final Cut Pro 5.04, whenever I run the programs w/o the XSR on it runs smoothly, but as soon as the XSR is turned on, I run into a slew of issues I can't figure out how to resolve

  • Can I choose the frame that displays before the viewer presses Play?

    I feel like I saw this in a tutorial, but now I can't find it again. Apologies if this has been covered elsewhere, and thanks!