How do i compare each vector value to find  a match with curent value

My select statement contain more that one value .So I strore it in vector .But currently it does not compare each value .So I dont know wrong .How to search entire vector and find the matching one.
Below are the coding I used :
<%String sql_query3 = "SELECT DISTINCT (ir_tran_typ) "+
                                          "  FROM intrcd ";
                           System.out.println("trans type"+sql_query3 );           
                            try{
                                rset = db.execSQL(sql_query3);
                            catch(SQLException e) {
                                System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query3);
                            while(rset.next()){
                                tran_cde = rset.getString("ir_tran_typ");
                                        tran_typ.addElement(rset.getString("ir_tran_typ"));
                                        System.out.println("trans type 34 "+tran_typ );%>
                                        <% }%>
                                      alert(obj.value);
                              <%for(int i=0 ;i<tran_typ.size();i++){
                                 System.out.println("trans type 222  "+ tran_typ.size());
                                   tran_cde =tran_typ.elementAt(index).toString();%>
                                   <%System.out.println("trans type before "+ tran_cde);%> 
                                    eval(document.all.tran_cde.option
                                  if(D == <%=tran_cde%> ){
                                   <%System.out.println("trans type D"+ tran_cde);%>     
                                   <%String sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                          "  FROM intrcd"+
                                          " WHERE ir_tran_typ = 'D' " +
                                                    " ORDER BY ir_rea_cde ";
                           System.out.println("query"+ sql_query2);           
                            try{
                                rset = db.execSQL(sql_query2);
                            catch(SQLException e) {
                                System.err.println("Error in query - emmast2 - transaction_main.jsp " +e +" sql " +sql_query2);
                                    index = 1;
                            while(rset.next()){
                                    rea_cde = rset.getString("ir_rea_cde");
                                    rea_desc =  rset.getString("ir_rea_desc");
                                   tran_typ.removeAllElements();
                                   }%>
                              if( R == obj.value){
                                   alert(R)
                                  if(R== <%=tran_cde%> ){
                                   <%System.out.println("trans type R"+ tran_cde);%>     
                                   <% sql_query2 = "SELECT ir_rea_cde,ir_rea_desc"+
                                          "  FROM intrcd"+
                                          " WHERE ir_tran_typ = 'R' " +
                                                    " ORDER BY ir_rea_cde ";
                           System.out.println("query 2"+ sql_query2 );           
                            try{
                                rset = db.execSQL(sql_query2);
                            catch(SQLException e) {
                                System.err.println("Error in query - intrcd - transaction_main.jsp " +e +" sql " +sql_query2);
                                    index = 1;
                            while(rset.next()){
                                    rea_cde = rset.getString("ir_rea_cde");
                                    rea_desc =  rset.getString("ir_rea_desc");
                                   }%>
          <%}%>
            }

Dude, your code is a MESS! Learn to use spacing and nicer indentation...
My select statement contain more that one value .So I strore it in
vector .But currently it does not compare each value .So I dont know
wrong .How to search entire vector and find the matching one.What???? Can you please try and explain yourself again? What is it you are trying to do/achieve?

Similar Messages

  • How could I replace hard coded value in my sql query with constant value?

    Hi all,
    Could anyone help me how to replace hardcoded value in my sql query with constant value that might be pre defined .
    PROCEDURE class_by_day_get_bin_data
         in_report_parameter_id   IN   NUMBER,
         in_site_id               IN   NUMBER,
         in_start_date_time       IN   TIMESTAMP,
         in_end_date_time         IN   TIMESTAMP,
         in_report_level_min      IN   NUMBER,
         in_report_level_max      IN   NUMBER
    IS
      bin_period_length   NUMBER(6,0); 
    BEGIN
      SELECT MAX(period_length)
         INTO bin_period_length
        FROM bin_data
         JOIN site_to_data_source_lane_v
           ON bin_data.data_source_id = site_to_data_source_lane_v.data_source_id
         JOIN bin_types
           ON bin_types.bin_type = bin_data.bin_type 
       WHERE site_to_data_source_lane_v.site_id = in_site_id
         AND bin_data.start_date_time     >= in_start_date_time - numtodsinterval(1, 'DAY')
         AND bin_data.start_date_time     <  in_end_date_time   + numtodsinterval(1, 'DAY')
         AND bin_data.bin_type            =  2
         AND bin_data.period_length       <= 60;
      --Clear the edr_class_by_day_bin_data temporary table and populate it with the data for the requested
      --report.
      DELETE FROM edr_class_by_day_bin_data;
       SELECT site_to_data_source_lane_v.site_id,
             site_to_data_source_lane_v.site_lane_id,
             site_to_data_source_lane_v.site_direction_id,
             site_to_data_source_lane_v.site_direction_name,
             bin_data_set.start_date_time,
             bin_data_set.end_date_time,
             bin_data_value.bin_id,
             bin_data_value.bin_value
        FROM bin_data
        JOIN bin_data_set
          ON bin_data.bin_serial = bin_data_set.bin_serial
        JOIN bin_data_value
          ON bin_data_set.bin_data_set_serial = bin_data_value.bin_data_set_serial
        JOIN site_to_data_source_lane_v
             ON bin_data.data_source_id = site_to_data_source_lane_v.data_source_id
            AND bin_data_set.lane = site_to_data_source_lane_v.data_source_lane_id
        JOIN (
               SELECT CAST(report_parameter_value AS NUMBER) lane_id
                 FROM report_parameters
                WHERE report_parameters.report_parameter_id    = in_report_parameter_id
                  AND report_parameters.report_parameter_group = 'LANE'
                  AND report_parameters.report_parameter_name  = 'LANE'
             ) report_lanes
          ON site_to_data_source_lane_v.site_lane_id = report_lanes.lane_id
        JOIN (
               SELECT CAST(report_parameter_value AS NUMBER) class_id
                 FROM report_parameters
                WHERE report_parameters.report_parameter_id    = in_report_parameter_id
                  AND report_parameters.report_parameter_group = 'CLASS'
                  AND report_parameters.report_parameter_name  = 'CLASS'
             ) report_classes
          ON bin_data_value.bin_id = report_classes.class_id
        JOIN edr_rpt_tmp_inclusion_table
          ON TRUNC(bin_data_set.start_date_time) = TRUNC(edr_rpt_tmp_inclusion_table.date_time)
       WHERE site_to_data_source_lane_v.site_id = in_site_id
         AND bin_data.start_date_time     >= in_start_date_time - numtodsinterval(1, 'DAY')
         AND bin_data.start_date_time     <  in_end_date_time   + numtodsinterval(1, 'DAY')
         AND bin_data_set.start_date_time >= in_start_date_time
         AND bin_data_set.start_date_time <  in_end_date_time
         AND bin_data.bin_type            =  2
         AND bin_data.period_length       =  bin_period_length;
    END class_by_day_get_bin_data;In the above code I'm using the hard coded value 2 for bin type
    bin_data.bin_type            =  2But I dont want any hard coded number or string in the query.
    How could I replace it?
    I defined conatant value like below inside my package body where the actual procedure comes.But I'm not sure whether I have to declare it inside package body or inside the procedure.
    bin_type     CONSTANT NUMBER := 2;But it does't look for this value. So I'm not able to get desired value for the report .
    Thanks.
    Edited by: user10641405 on May 29, 2009 1:38 PM

    Declare the constant inside the procedure.
    PROCEDURE class_by_day_get_bin_data(in_report_parameter_id IN NUMBER,
                                        in_site_id             IN NUMBER,
                                        in_start_date_time     IN TIMESTAMP,
                                        in_end_date_time       IN TIMESTAMP,
                                        in_report_level_min    IN NUMBER,
                                        in_report_level_max    IN NUMBER) IS
      bin_period_length NUMBER(6, 0);
      v_bin_type     CONSTANT NUMBER := 2;
    BEGIN
      SELECT MAX(period_length)
        INTO bin_period_length
        FROM bin_data
        JOIN site_to_data_source_lane_v ON bin_data.data_source_id =
                                           site_to_data_source_lane_v.data_source_id
        JOIN bin_types ON bin_types.bin_type = bin_data.bin_type
       WHERE site_to_data_source_lane_v.site_id = in_site_id
         AND bin_data.start_date_time >=
             in_start_date_time - numtodsinterval(1, 'DAY')
         AND bin_data.start_date_time <
             in_end_date_time + numtodsinterval(1, 'DAY')
         AND bin_data.bin_type = v_bin_type
         AND bin_data.period_length <= 60;
      --Clear the edr_class_by_day_bin_data temporary table and populate it with the data for the requested
      --report.
      DELETE FROM edr_class_by_day_bin_data;
      INSERT INTO edr_class_by_day_bin_data
        (site_id,
         site_lane_id,
         site_direction_id,
         site_direction_name,
         bin_start_date_time,
         bin_end_date_time,
         bin_id,
         bin_value)
        SELECT site_to_data_source_lane_v.site_id,
               site_to_data_source_lane_v.site_lane_id,
               site_to_data_source_lane_v.site_direction_id,
               site_to_data_source_lane_v.site_direction_name,
               bin_data_set.start_date_time,
               bin_data_set.end_date_time,
               bin_data_value.bin_id,
               bin_data_value.bin_value
          FROM bin_data
          JOIN bin_data_set ON bin_data.bin_serial = bin_data_set.bin_serial
          JOIN bin_data_value ON bin_data_set.bin_data_set_serial =
                                 bin_data_value.bin_data_set_serial
          JOIN site_to_data_source_lane_v ON bin_data.data_source_id =
                                             site_to_data_source_lane_v.data_source_id
                                         AND bin_data_set.lane =
                                             site_to_data_source_lane_v.data_source_lane_id
          JOIN (SELECT CAST(report_parameter_value AS NUMBER) lane_id
                  FROM report_parameters
                 WHERE report_parameters.report_parameter_id =
                       in_report_parameter_id
                   AND report_parameters.report_parameter_group = 'LANE'
                   AND report_parameters.report_parameter_name = 'LANE') report_lanes ON site_to_data_source_lane_v.site_lane_id =
                                                                                         report_lanes.lane_id
          JOIN (SELECT CAST(report_parameter_value AS NUMBER) class_id
                  FROM report_parameters
                 WHERE report_parameters.report_parameter_id =
                       in_report_parameter_id
                   AND report_parameters.report_parameter_group = 'CLASS'
                   AND report_parameters.report_parameter_name = 'CLASS') report_classes ON bin_data_value.bin_id =
                                                                                            report_classes.class_id
          JOIN edr_rpt_tmp_inclusion_table ON TRUNC(bin_data_set.start_date_time) =
                                              TRUNC(edr_rpt_tmp_inclusion_table.date_time)
         WHERE site_to_data_source_lane_v.site_id = in_site_id
           AND bin_data.start_date_time >=
               in_start_date_time - numtodsinterval(1, 'DAY')
           AND bin_data.start_date_time <
               in_end_date_time + numtodsinterval(1, 'DAY')
           AND bin_data_set.start_date_time >= in_start_date_time
           AND bin_data_set.start_date_time < in_end_date_time
           AND bin_data.bin_type = v_bin_type
           AND bin_data.period_length = bin_period_length;
    END class_by_day_get_bin_data;

  • GR Value is not matching with PO Value while posting good receipt.

    Hi Experts,
    My client has raised the PO with accounts assignment category K (COST CENTRE) with material description.
    but he has received invoice receipt before good receipt.while invoice receipt he has entered wrong value for some qty as per PO intially and cancelled that wrong entry.
    I have gone through original & cancelled invoice document accounting entries. below is entries:
    Original invoice document accounting entries:
    GR/IR Clearing account: Debited
    Vendor account: Credited
    during cancelling the above document it should be vendor acc is debited and GR/IR account is credited but in the system below entries taken place
    Cancelled invoice document accounting entries:
    Vendor account : Debited
    GR/IR Account : Credited
    Consumption Account : Credited
    Why consumption acc taken place here. pls help what are the possibilitis....
    these entries affecting good receipt value means while taking goods receipt for some qty out of full qty value is not matching with PO value.
    but while cancelling the  GR documents system taking correct values as per PO. Please help.
    Kindly help in this regards
    Regards
    Mohan

    Hi,
    Check the Credit Memo document whether G/L tab is there & whether any G/L account is entered ?
    I think instead of cancelling the MIRO document they might have posted a vendor credit memo manually by specifying a consumption GL.
    Thanks & Regards,

  • The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assi

    Hi ,
    We have enabled context sensitive DFF in Bank Branch Page for HZ_PARTIES DFF , We have created Flex Map so that only bank branch context fields are only displayed in the bank branch page and  as we know party information DFF is shared by supplier and Customer Page so we dint want to see any Bank Branch fields or context information in those pages.
    We have achieved the requirement but when open existing branches bank branch update is throwing below error message :
    "The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assistance."
    this error is thrown only when we open existing branches, if we save existing branch and open then it is not throwing any error message.
    Please let us know reason behind this error message.
    Thanks,
    Mruduala

    You are kidding?  It took me about 3 minutes to scroll down on my tab to get to the triplex button!
    Habe you read the error message? 
    Quote:
    java.sql.SQLSyntaxErrorException: ORA-04098: trigger 'PMS.PROJECT_SEQ' is invalid and failed re-validation
    Check the trigger and it should work again.
    Timo

  • A filter value for Query is set with some value automatically

    Hello SAP sourcing Guru!
    I created a query which has several filters.
    Some of Filter's type is VLV.
    When I preview the query somehow the filter values are already set with some value even though I did not set the default value.
    For example, filter name is Region and there are four regions: Asia, NA, Europe, and SA.
    I want to select one of them from drop-down menu. But Asia was already selected when I clicked the preview button for the query. I want to see "Please Select" instead of Asia from drop-down menu. I did not select "Prefill value from cache" for the filter. I made the filter Optional only. I did not set Default Value either for the filter.
    Any clues?
    Thank you for your response in advance.

    Hi,
    In the Default value field of the filter prompts, you need to mention the Class Reference ID of the corresponding field. E.g., if you have Contract document phase as a filter, then in that if you want to display a blank or none value, then you should use null:2016.
    Similarly for vlv type, the system has a value 616. Hence if you want to display a None value insteead of Asia, use the following in the Default value field:
    0:616:null.
    The way to find the class reference ID is to goto the RG > Class Reference > Look for the field that you are attempting to default on.
    Hope this helps,
    Vikram

  • MB5b Value is not matching with MB52 value

    Hi Expert,
                     Please tell me what is the difference between tcode mb5b and mb52.In our system MB5B Valuated Stock Qty and Value is not Matching with MB52 (Unrestricted + GIT+ stock in QI) stock and value.
    Edited by: lifesgud on Apr 26, 2011 2:50 PM

    Hi,
    Please post this thread on the Inventory Management forums for the relevant expertise (component MM-IM-GF-REP). Unfortunately I don't have sufficient permissions to move it for you.
    Rgds,
    Colum

  • How can I have each pass through a for loop communicate with a new indicator?

    Hello,
    I am using 16 color boxes to indicate how 16 channels are behaving.  If a color box is blue, its respective channel is running correctly, red means it has failed etc.  I am continuously checking each channel using a loop, and I wanted to update the channel colors every loop.  I have made an array of 16 numbers corresponding to the color I wish to have (which are blue = running, red = failed, green = completed, black = not in use).  However, I cannot find a way to pull these 16 numbers out of the array and to the color boxes short of 16 index arrays connected to the color boxes. 
    I understand how to convert each individual number to a color, I just don't know how to use a 16 times for loop to communicate with a different color box each pass through.  Is there any way to do this or should I just go for brute force?
    Thank you.
    Solved!
    Go to Solution.

    Sorry I keep making new posts.  Attached is an example i wrote up.  There are three cases in the disabled structure, each has a different implementation of what i belive your specs are.
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect
    Attachments:
    update color box.vi ‏24 KB

  • How to find and replace with sequential values?

    im building a website. it contains 12 main images per page and luckily according to my design the source code per page contains 12 <img> tags only (rest is background and stuff). now for many pages i keep using a particular page as template and then change each and every image by browsing and clicking. Now i want to make my work easy.
    the images that i want to add in every page are sequentially file named.  001.jpg , 002.jpg .......... and so on.
    So is there some way that i can use find and replace , to find the <img> tags and fill them all with values sequentially that is the first <img> tag containts 001.jpg and the second containts 002,jpg and so on .
    the pages are many thats why i want to make this easy
    thanks very much for help

    Will they ever do this?   I just wish Adobe would purchase TextPad and integrate it into Dreamweaver.  In TextPad, from the manual:
    Other TextPad options in the replacement string:
    \i Generate a sequence number.
    \i(N,M) Ditto, starting at N and incrementing by M.
    So beautifully simple.

  • C# How Do I Search Through A List To Find A Particular Variable's Value?

    I have a list containing instances of a class containing several variables, one of which is a boolean. I need to write an algorithm that will search through every class instance in that list and find the item(class instance) where that boolean is set to "true."
    Here's the code I've tried so far:
                bool ActiveQuestion = Questions.Find(item => Questions.ThisIsActiveQuestion == true);
    In this line of code, the list is named "Questions," the class is named "Question" and the boolean within that class is named "ThisIsActiveQuestion." To re-state what I want to do, I want to go through the list and find the class
    in which that boolean is set to "true."

    Something like this
    List<Question> someList = new List<Question>();
    IEnumerable<Question> query = from q in someList where q.IsTrue select q;
    public class Question
    public bool IsTrue;
    “If you want something you've never had, you need to do something you've never done.”
    Don't forget to mark
    helpful posts and answers
    ! Answer an interesting question? Write a
    new article
    about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.

  • Values in CK13N not matching with cost element report

    Dear SAP Experts, when I go to t code CK13N in the column (Itemization of column) I can see for the cost elemnt total values as 241023 with the Qty as 10000, but when I check in the material & the report FBL3N not sure from where its taking 241023. When I run the FBL3N report do I have enter any specific dates to match the entires.
    Thanks in adv for your reply

    Dear Sachin
    CK13N is dependent on your  costing lot size where as in FBL3N you see the actual expenses posted to GLs so there is no match. For example in ck13n for labour charges you may be having a value of Rs 100000/- for 10000 qty lot size where as actually Rs 80000/- or 120000/- are booked for labour charges. then you will see 100000/-in CK13N whereas in FBL3N you will see 80000/- or 120000/- as the case may be.
    Means One is actual booking and the other is estimated figure for a certain costing lot size.
    Hope this clears your doubt.
    Regards
    Rajneesh Saxena

  • Safara 5.1.5 pass old value for a hidden field with new values

    Hi
    I have the JSP pages which used to be working in Safra 5.1.3. There is a hidden field: mac, submitted to and from this JSP page.
    Page A submits "mac" with value1, backend a java action received this value and change it to value2 after some calculation, value2 is set to page B. I can see the hidden field "mac" contains value2 in page B. But when I submit page B, the value being transmitted is still value1.
    I tested to change this field to a visible text field rather a hidden one. The value being passed will be the correct one: value2.
    Other browsers except Safari 5.1.5 do not have such strange behavior. 
    Is there any solution for this problem apart from changing my form filed names?
    Thanks.

    you can only list what was stored.
    changes in values for a characteristic can be monitored in CL20N via menu Environment > Change documents
    change history for classification is only stored if you activated this.
    maybe it is not set active in your system, then see SAP Note 943559 - FAQ: Frequently asked questions about the classifctn. system

  • How do i test split by value functionality in mesage mapping with multiple

    how do i test split by value functionality in mesage mapping with multiple values ?
    regards,
    venkat

    repeat your source node. in mapping editor you can view queues by right clicking to mapped element.. selecting Display Queues option.. this will show u your values .
    You can also select this Display Queue option for splitByValue option
    for example
    source--->splitByValue>target
    Try viewing your queues to each this step... for splitByValue in display Queue you will see context inserted(grey colour) accodingly

  • Arch compared to Vector

    I'm quite newbie for Linux, but not afraid for commandline. It's the way to learn how things works, isn't it? Is that good enough to try Arch? I'll see.
    I've had it with Windows and like to get a working, good performing and stable desktop with basic SOHO apps installed and VMware to experiment with other distros and oses without multibooting.
    So I need a no nonsense, light weighted OS on top wich is compatible with al my hardware, and is capable to run VMware and.. eh... there was some very good performing whats-it-called program to run any other Linux.  So I can use windows in a virtual machine as long as I need it.
    Arch and Vector are both famous for speed.
    So...how is Arch compared to Vector on speed, compatibilty, stabilty?
    And since my computer is 24 hours a day online, security isn't unimportant.
    So.... are they... usable for my goal? If not.. does anyone have a better idea?

    I find Arch faster than Vector.  Vector is actually made for slower machines, while Arch is designed for PIII or AMD-K7 and up.
    Vector is more oriented towards the newcomer, more graphic configuration tools and the like, while Arch is aimed towards people more used to editing text configuration files.
    Security, well, both enable you to use iptables, which is how I usually secure a machine.   There are various other firewall implementations out there, which should work on either distribution.
    Vector makes it a ~bit~ (in my opinion, and this could just be because I haven't used it that much and didn't do that much research) harder to get under the hood, so to speak, and edit the various configuration files.
    Both are nice distributions, with different target audiences.  I think you'll learn more about Linux using Arch, but that could be my opinion. Vector is based on Slackware, which is sort of the classic vanilla Linux.
    On a 686 (PIII or K7 and up) I think you'll find Arch to be faster.

  • How can I find the element with the closest value to a calculated "target value" in a 1D array?

    Hello all,
    may be the following question is very simple, but I am relatively new in labview and it would be great if somebody could help me:
    I have a acquaried 1D array of data-points. Now, I have to find the element in this array which value is the closest to a calculated "target value".
    After finding the element with the value close to the "target value", I have to get the position of this element (i.e. the index) in the 1D array.
    Now, I have to use this index to find and extract the element at this position in an other 1D array.
    It would be very nice if somebody could help me with this problem.
    Thank you,
    beam

    Find attached a sample vi that you can modify.
    Attachments:
    select_target_value.vi ‏22 KB

  • Multiplot graph with missing values fills them with zero instead of NaN

    I have a waveform graph with multiple arrays (2D) which has different numbers of points in each array.  LabVIEW finds the array with the most points and then plots all arrays with that many points.  It assigns the missing points a value of zero and displays those zero values.  This means arrays with fewer points than the maximum will have values of zero appear in their plots.  This can be avoided by filling in missing points with NaN.  I am acquiring data in a loop and displaying it which requires continuous determination of the number of actual points and filling in of missing points with NaN.  Not difficult, but this could be avoided if LabVIEW would fill missing points with NaN instead of with zero.  Any way to have this happen automatically ?
    Steve
    Attachments:
    Graph MultiPlot Missing Data.vi ‏18 KB

    You can also consider using an XY graph so you don't have to do additional data manipulation. See attached for comparison.
    Attachments:
    Graph MultiPlot Missing Data mod.vi ‏22 KB

Maybe you are looking for