Help!! with my if statements

I am using the following code on a JSP page, it evaluates the nulls just fine, but for some reason it does not seem to evaluate my strings to see if they are the same which gives me several duplicate lines....
<UL>     <% if(strTemp1=="") {%>
     <LI style="list-style-image : url(../Html/images/BrightBlueArrow.gif);">&nbsp
          <A class=normal href="<%= strLOC1 %>"><%= strDESC1 %></A>
          <%} else if(strDESC1!=strTemp1){%>
     <UL>
          <LI style="list-style-image : url(../Html/images/SmallBrightBlueListMark.gif);">
               <A class=normal href="<%= strLOC1 %>"><%= strDESC1 %></A>
          <%} if(strDESC2!=null && strDESC2!=strTemp2) {%>
          <UL>
               <LI style="list-style-image : url(../Html/images/SmallBrightBlueListMark.gif);">
                    <A class=normal href="<%= strLOC2 %>"><%= strDESC2 %></A>
          <%} if(strDESC3!=null && strDESC3!=strTemp3) {%>
               <UL>
                    <LI style="list-style-image : url(../Html/images/SmallBrightBlueSquare.gif);">
                         <A class=normal href="<%= strLOC3 %>"><%= strDESC3 %></A>
          <% }
          strTemp1=strDESC1;
          strTemp2=strDESC2;
          strTemp3=strDESC3;
          %>
               </UL>
          </UL>          
     </UL>
</UL>
Can anyone please point to me what it is that I am doing wrong??
Thanks,
aa1724

Thanks that worked for me!!!
One more question... Is there a way that I can indent my lines other than the one I am using??

Similar Messages

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Help with this update statement..

    Hi everyone,
    I am trying to update a column in a table .I need to update that column
    with a function that takes patient_nbr and type_x column values as a parameter.
    That table has almost "300,000" records. It is taking long time to complete
    almost 60 min to 90 min.
    Is it usual to take that much time to update that many records?
    I dont know why it is taking this much time.Please help with this update statement.
    select get_partner_id(SUBSTR(patient_nbr,1,9),type_x) partner_id from test_load;
    (it is just taking 20 - 30 sec)
    I am sure that it is not the problem with my function.
    I tried the following update and merge statements .Please correct me if i am wrong
    in the syntax and give me some suggestions how can i make the update statement fast.
    update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
    merge into test_load a
    using (select patient_nbr,type_x from test_load) b
    on (a.patient_nbr = b.patient_nbr)
    when matched
    then
    update
    set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
    there is a index on patient_nbr column
    and the statistics are gathered on this table.

    Hi Justin,
    As requested here are the explain plans for my update statements.Please correct if i am doing anything wrong.
    update test_load set partner_id = get_partner_id(SUBSTR(patient_nbr,1,9),type_x);
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 3793814442"
    "| Id  | Operation          | Name             | Rows  | Bytes | Cost (%CPU)| Time     |"
    "|   0 | UPDATE STATEMENT   |                  |   274K|  4552K|  1488   (1)| 00:00:18 |"
    "|   1 |  UPDATE            |        TEST_LOAD |       |       |            |          |"
    "|   2 |   TABLE ACCESS FULL|        TEST_LOAD |   274K|  4552K|  1488   (1)| 00:00:18 |"
    merge into test_load a
    using (select patient_nbr,type_x from test_load) b
    on (a.patient_nbr = b.patient_nbr)
    when matched
    then
    update
    set a.partner_id = get_partner_id(SUBSTR(b.patient_nbr,1,9),b.type_x);
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 1188928691"
    "| Id  | Operation            | Name             | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |"
    "|   0 | MERGE STATEMENT      |                  |   274K|  3213K|       |  6660   (1)| 00:01:20 |"
    "|   1 |  MERGE               |        TEST_LOAD |       |       |       |            |          |"
    "|   2 |   VIEW               |                  |       |       |       |            |          |"
    "|*  3 |    HASH JOIN         |                  |   274K|    43M|  7232K|  6660   (1)| 00:01:20 |"
    "|   4 |     TABLE ACCESS FULL|        TEST_LOAD |   274K|  4017K|       |  1482   (1)| 00:00:18 |"
    "|   5 |     TABLE ACCESS FULL|        TEST_LOAD |   274K|    40M|       |  1496   (2)| 00:00:18 |"
    "Predicate Information (identified by operation id):"
    "   3 - access("A"."patient_nbr"="patient_nbr")"Please give some suggestions..
    what's the best approach for doing the updates for huge tables?
    Thanks

  • Help with a CASE statement

    Please help me with a CASE Statement:
    - When ID = 15, 16, 17, 18 then "Bad"
    - when ID = 19, then "Average"
    - when ID = 21, then "Good"
    - else "Null"
    Thank you!!

    Well the 1st thing to do would be to correct my poor spelling... change    Delault : to Default :
    Don't know why you would get an error stating "The result of selection formula must be a boolean". It's working fine on my machine.
    If your ID field is numbers stored text you have a couple different options...
    1) Convert the ID to a number...
    Select  ToNumber({home.noone_ID})
    2) Wrap the ID values in double quotes...
       Case "15", "16", "17", "18" :
          "BAD"
    Even if this were your problem... the error should be something other than the boolean thing...
    Jason

  • Help with a return statement please!

    hey, just hoping somone can help me with this return statement
    i have to add a method called "specialReport" this method takes a year as it's parameter. if the parameter is not a year between 1930 and 1969 inclusive it displays an error message, "not a valid year"
    if the parameter is a valid year, then it compares the parameter with the year field. if they are the same, and is the movie has been rented at least five times, the method will display the message "a good year for movies" if the years are different or the movie has NOT been rented at least five times, the method displays the message "try a different year"
    btw, the Year field is : yearReleased
    all help is very much appreciated!

    public void specialReport(int year){
       //add functionality to process here
       return;
    }

  • Looking for some help with building insert statements...

    Hi, I am using some sql to build some insert statements for me to update a set of tables in our qa environments. The scripts that I have created were working great until someone added a column to some of the tables in the qa env which in turn makes my scripts break because I was simply building the statment to do someting like this...
    insert into dest_table (select * from source_table@dblink);
    But now when the coumns in the tables do not match it breaks...
    This is the dynamic create script I use, can anyone help or suggest a better way to be able to build update statements update to qa tables when the columns are mismatched?
    spool insert.sql
    select
    'insert into ' || table_name || ' (select * from ' || table_name || '@prod );' || chr(10) || ' commit;'
    from user_tables
    where table_name in
    (select * from refresh_tablesl)
    any help is greatly appreciated,
    Thanks.

    See my reply to your duplicate post
    looking for help building dynamic insert statements...

  • Help with multiple case statements

    Hello,
    I am new to BO.  I am on XI 3.0.  SQL 2005.  In Designer, I am trying to create a measure in a financial universe that would end up being multiple case statements within one select.  This is what I tried to do, but it doesn't work with the two case statements.  Can I use an ELSE leading into the second CASE WHEN somehow?  How can I accomplish this?  Sorry for my ignorance!
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 12 THEN dbo.ClientBudgetMonth.Stage1Sales END
    CASE WHEN  dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 11 THEN dbo.ClientBudgetMonth.Stage1Sales END
    Any Suggestions?
    Thanks,
    Holly

    Holly,
    I don't know enough about your data or requirement to provide a solution, however, the construct that you post will not work because it causes you to build an object with multiple case statements when only one case statement per object is permitted.  From what I see in your code I would be inclined to combine the two statements into one as such:
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month in (11,12) THEN dbo.ClientBudgetMonth.Stage1Sales else null END
    Thanks,
    John

  • Help with a select statement from a SQL Server within a DTS !!

    Hello Gurus!
    I help with the script bellow, when I run it within DTS (in SQL Sever 2000), I got the error Invalid number/or not a valid month.
    Please bellow with the WHERE CLASUE '08/01/2001' AND '03/09/2002'
    And in the other hand I change this forma to '01-AUG-01' AND
    '03-MAR-2002', the DTS start and run witha successful messages, but it does not returns row, which is wrong.
    Somebady please help!
    Thanks Gurus!
    GET Total ANIs with Trafic By Area Code
    select
         substr(b.ct_num, 0,3) as Area_Codes,
         COUNT(DISTINCT B.CT_NUM) AS ANIS
    from
         wasabi.v_trans A,
         wasabi.V_Sur_Universal B,
         wasabi.V_Sub C,
         wasabi.V_Trans_Typ D
    where
         D.Trans_typ = A.Trans_Typ AND
         A.Sur_ID = B.Sur_ID AND
         C.Sub_ID = A.Sub_ID AND
         a.trans_stat != 'X' AND     
         a.Trans_DTTM >= '08/01/2001'AND
         a.Trans_DTTM < '03/09/2002 AND
         B.AMA3 = 'PHONE1'
         AND C.SUB_ID not in (100117)
    GROUP BY
         substr(b.ct_num, 0,3)
    ORDER BY
         Area_Codes

    I think that you need a "to_date" function eg
    change '08/01/2001' to to_date('08/01/2001','dd/mm/yyyy')

  • Help with an If Statement for a Message Dialog

    Hello all! I need help yet once again! I would prefer hints and nudges rather then the answer please, as this is for a homework assignment. Okay I am supposed to write a program that has 3 text boxes to enter a number between 0 and 255 (for red green and blue) and then the user should push the show button and the background color should change, which I have all working! But I am supposed to have a " gracefully handle the situation where the user enters an invalid color value (any number less than zero or greater than 255)" and I have the if statement written, but for some reason, whenever I hit the show button it always pops up that window, no matter what the user types in. So I need help figuring out how to make it stop popping up all of the time! Here is the code: Any other ideas on how to make the code better would be much appreciated!!! Thanks in advance!
    import java.awt.GridLayout;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JTextField;
    import javax.swing.JPanel;
    import javax.swing.BorderFactory;
    public class ColorEditor extends JPanel {
         private JLabel labelRed;
         private JLabel labelGreen;
         private JLabel labelBlue;
         private JTextField textFieldRed;
         private JTextField textFieldGreen;
         private JTextField textFieldBlue;
         private JButton showButton;
         private JButton exitButton;
         private JOptionPane optionPane;
         public ColorEditor()
              super(new BorderLayout());
              labelRed = new JLabel("red: ");
              textFieldRed = new JTextField(5);
              labelGreen = new JLabel("green: ");
              textFieldGreen = new JTextField(5);
              labelBlue = new JLabel("blue: ");
              textFieldBlue = new JTextField(5);
              showButton = new JButton("show");
              exitButton = new JButton("exit");
              JPanel labelPane = new JPanel(new GridLayout(0,1));
              labelPane.add(labelRed);
              labelPane.add(labelGreen);
              labelPane.add(labelBlue);
              labelPane.add(showButton);
              JPanel fieldPane = new JPanel( new GridLayout(0,1));
              fieldPane.add(textFieldRed);
              fieldPane.add(textFieldGreen);
              fieldPane.add(textFieldBlue);
              fieldPane.add(exitButton);
              setBorder(BorderFactory.createEmptyBorder(40,40,40,40));
              add(labelPane, BorderLayout.LINE_START);
              add(fieldPane, BorderLayout.CENTER);
              TextFieldHandler handler = new TextFieldHandler();
              textFieldRed.addActionListener(handler);
              textFieldGreen.addActionListener(handler);
              textFieldBlue.addActionListener(handler);
              showButton.addActionListener(handler);
         private class TextFieldHandler implements ActionListener
              public void actionPerformed(ActionEvent event)
                   if (event.getSource() == showButton)
                        String textRed = textFieldRed.getText();
                        String textGreen = textFieldGreen.getText();
                        String textBlue = textFieldBlue.getText();
                        int a = Integer.parseInt(textRed);
                        int b = Integer.parseInt(textGreen);
                        int c = Integer.parseInt(textBlue);
                        if ((a < 0) || (a > 255)||(b<0)||(b>255)||(c<0)||(c>255));
                             optionPane.showMessageDialog(null, "Please enter a number between 0 and 255!");//HERE IS WHERE I NEED THE HELP!!
                        Color colorObject = new Color(a,b,c);
                        setBackground(colorObject);
         public static void main(String args[])
              JFrame frame = new JFrame("Color Editor");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
              frame.add(new ColorEditor());
              frame.pack();
              frame.setVisible(true);
    }

    Okay now Eclipse is giving me a really funky error that I cannot quite figure out (in the compiler) but my program is running fine.... Can you help me with this too?
    Here is what the compiler is giving me....
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Color parameter outside of expected range: Green
    +     at java.awt.Color.testColorValueRange(Unknown Source)+
    +     at java.awt.Color.<init>(Unknown Source)+
    +     at java.awt.Color.<init>(Unknown Source)+
    +     at ColorEditor$TextFieldHandler.actionPerformed(ColorEditor.java:80)+
    +     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)+
    +     at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)+
    +     at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)+
    +     at javax.swing.DefaultButtonModel.setPressed(Unknown Source)+
    +     at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)+
    +     at java.awt.Component.processMouseEvent(Unknown Source)+
    +     at javax.swing.JComponent.processMouseEvent(Unknown Source)+
    +     at java.awt.Component.processEvent(Unknown Source)+
    +     at java.awt.Container.processEvent(Unknown Source)+
    +     at java.awt.Component.dispatchEventImpl(Unknown Source)+
    +     at java.awt.Container.dispatchEventImpl(Unknown Source)+
    +     at java.awt.Component.dispatchEvent(Unknown Source)+
    +     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)+
    +     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)+
    +     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)+
    +     at java.awt.Container.dispatchEventImpl(Unknown Source)+
    +     at java.awt.Window.dispatchEventImpl(Unknown Source)+
    +     at java.awt.Component.dispatchEvent(Unknown Source)+
    +     at java.awt.EventQueue.dispatchEvent(Unknown Source)+
    +     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)+
    +     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)+
    +     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)+
    +     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)+
    +     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)+
    +     at java.awt.EventDispatchThread.run(Unknown Source)+

  • Help with Nesting DECODE statements

    Hello. I'm trying to write a sql script to generate data report for payments. I need to incorporate specific conditions to SUPPRESS BLANK ADDRESS field lines. I am pulling Address_Line1, Address_Line2, Address_Line3, plus CITY, STATE, ZIP as Address_Line4. If any fields are blank, I need to suppress the blank line and move the other lines up.
    Here are my IF, THEN, ELSE conditions. There are 9 possible scenarios that I have identified. Can you please help me write this in SQL with the DECODE function?
    IF CITY||STATE||ZIP IS NULL               
    THEN AD1='12115 Rainbow Road', AD2='Hartford Heights, MO 60226'               
    ELSE               
         IF ADDRESS_LINE1 IS NULL          
              IF ADDRESS_LINE2 IS NULL     
                   IF ADDRESS_LINE3 IS NULL
                   THEN USE HOME ADDRESS
                   ELSE vAD1=ADDRESS_LINE3, vAD2=CITY||STATE||ZIP
                   ENDIF
              ELSE     
                   IF ADDRESS_LINE3 IS NULL
                   THEN vAD1=ADDRESS_LINE2, vAD2 = CITY||STATE||ZIP
                   ELSE vAD1=ADDRESS_LINE2, vAD2=ADDRESS_LINE3, vAD3=CITY||STATE||ZIP
                   ENDIF
              ENDIF     
         ELSE          
              IF ADDRESS_LINE2 IS NULL     
                   IF ADDRESS_LINE3 IS NULL
                   THEN vAD1=ADDRESS_LINE1, vAD2=CITY||STATE||ZIP
                   ELSE vAD1=ADDRESS_LINE1, vAD2=ADDRESS_LINE3, vAD3=CITY||STATE||ZIP
                   ENDIF
              ELSE     
                   IF ADDRESS_LINE3 IS NULL
                   THEN vAD1=ADDRESS_LINE1, vAD2=ADDRESS_LINE2, vAD3=CITY||STATE||ZIP
                   ELSE vAD1=ADDRESS_LINE1, vAD2=ADDRESS_LINE2, vAD3=ADDRESS_LINE3, vAD4=CITY||STATE||ZIP
                   ENDIF
              ENDIF     
         ENDIF          
    ENDIF               
    This what I've got so far...
    DECLARE
      vADR1
      vADR2
      vADR3
      vADR4
    BEGIN
    SELECT
    DECODE(
    END;
    /

    Hi,
    Here is the code along with some sample data. I substitute the "+" symbol for "/" becuase some addresses where using "c/o" in the address line.
    The address fields are null, as shown by the query below (ref query results below):
    SQL> select address_line1
      2  from po.po_vendor_sites_all
      3  where address_line1='3457 SOLUTIONS CENTER'
      4  and address_line2 is null;
    ADDRESS_LINE1
    3457 SOLUTIONS CENTERHere is the script:
    WITH got_delimited_list AS
    SELECT address_line1 || ' +' ||
    address_line2 || ' +' ||
    address_line3 || ' +' ||
    city ||', ' || state ||'  ' || zip AS delimited_list
    FROM po.po_vendor_sites_all
    SELECT REGEXP_SUBSTR (delimited_list, '[^+]+', 1, 1) AS vad1
    , REGEXP_SUBSTR (delimited_list, '[^+]+', 1, 2) AS vad2
    , REGEXP_SUBSTR (delimited_list, '[^+]+', 1, 3) AS vad3
    , REGEXP_SUBSTR (delimited_list, '[^+]+', 1, 4) AS vad4
    FROM got_delimited_list;Sample of the data records returned:
    VAD1
    VAD2
    VAD3
    VAD4
    3457 SOLUTIONS CENTER
    CHICAGO, IL  60677-3004
    VAD1
    VAD2
    VAD3
    VAD4
    5172 EAGLE WAY
    CHICAGO, IL  60678-1517
    VAD1
    VAD2
    VAD3
    VAD4
    RETAILERS' OCCUPATION TAX
    SPRINGFIELD, IL  62796-0001
    VAD1
    VAD2
    VAD3
    VAD4
    DEPT. NUMBER 478150
    P.O. BOX 790100
    ST LOUIS, MO  63179-9933
    VAD1
    VAD2
    VAD3
    VAD4
    P.O. BOX 62251
    BALTIMORE, MD  21264-2251
    VAD1
    VAD2
    VAD3
    VAD4
    P.O. BOX 660481
    DALLAS, TX  75266-0481
    VAD1
    VAD2
    VAD3
    VAD4
    3525 PIEDMONT RD.
    BUILDING FIVE
    SUITE 300
    ATLANTA, GA  30305

  • Need help with **** Invalid Cursor State ****

    Hi,
    can someone tell me why am i getting this error....
    //******java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    Any help is greatly appreciated.....
    Thanks in advance.
    //***********this is the output on servlet side**************//
    Starting service Tomcat-Standalone
    Apache Tomcat/4.0.3
    Starting service Tomcat-Apache
    Apache Tomcat/4.0.3
    init
    DBServlet init: Start
    DataAccessor init: Start
    Accessor init: Loading Database Driver: sun.jdbc.odbc.JdbcOdbcDriver
    DataAccessor init: Getting a connection to - jdbc:odbc:SCANODBC
    username SYSDBA
    password masterkey
    DataAccessor init: Preparing searchPolicy
    DataAccessor init: Prepared policySearch
    DataAccessor init: Prepared ssnSearch
    DataAccessor init: End
    After the myDataAccessor
    Database Connection...
    in doGet(...)
    SSSSSSSGetpolicynumber
    In GetPolicyInformation
    b05015195
    Getting Policy Informaton for = b05015195
    okay, building vector for policy
    in GetPolicyInformation for = b05015195
    starting query... policy Information
    finishing query... Policy Information
    Inside the while(next) loop
    sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
    sun.jdbc.odbc.JdbcOdbcResultSet@4db06e
    b05015195
    policy information constructor with resultset
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
    at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3266)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:
    5398)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:326)
    at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:383)
    at viewscreenappletservlet.policyinformation.<init>(policyinformation.ja
    va:56)
    at viewscreenappletservlet.DatabaseAccessor.getPolicyInformation(Databas
    eAccessor.java:145)
    at viewscreenappletservlet.Servlet.policyDisplay(Servlet.java:108)
    at viewscreenappletservlet.Servlet.doGet(Servlet.java:91)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
    et.java:446)
    at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java
    :180)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
    torBase.java:475)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
    r.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
    va:1107)
    at java.lang.Thread.run(Thread.java:484)
    result set closed
    1
    sending response
    Sending policy vector to applet...
    Data transmission complete.

    1) JDBC-ODBC driver is buggy
    2) Some drivers (truly speaking most of them) doesn't
    support cursors or supports them in a wrong way
    Paul

  • Help with nested if statements

    Can anyone see what is wrong with this?  The parameter value is 3.  I commented out 4-12 to narrow down the issue.  If I run it like this, I get 0.  However if I comment out 1 and 2 and just leave the logic for 3, I get the actual numbers.  Where is it getting stuck?
    Crystal Reports 11
    if {?Period} = 1 then
    if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1 then
    if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    else
    if {?Period} = 2 then
    if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 2  then
    if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    else
    if {?Period} = 3 then
    if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 3  then
    if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 4 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 4  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 5 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 5  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 6 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 6  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 7 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 7  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 8 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 8  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 9 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 9  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 10 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 10  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} =11 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 11  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    //else
    //if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate) then
    //if {?Period} = 12 then
    //if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 12  then
    //If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
    //then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
    else 0

    Kim,
    You never get there. Parenthesis will help you what is happening.
    if {?Period} = 1 then
    (  if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1
        then
        (  if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
           then
           (  If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
              then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
              else
              if {?Period} = 2
              then
              (  if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 2
                then
                (  if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
                   then
                    (   If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
                        then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
                        else
                        if {?Period} = 3
                        then
                        (  if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} <= 3
                           then
                           (  if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
                              then
                              (  If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
                                 then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
                                 else...
    All your statements are looking for true values. You need an else statement for each failed if-then test.
    if {?Period} = 1
    then
    (   // 1
       if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} = 1
       then
      (   // 2
         if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} = year(currentdate)
         then
         (    // 3
             If {FC_COST_AREA_ACT_BUD_UNION.TYPE} = "ACT"
             then {FC_COST_AREA_ACT_BUD_UNION.OTHER_SUPPLIES_AND_MAINTENANCE}
             else  
             //what happens if it {FC_COST_AREA_ACT_BUD_UNION.TYPE} not ="ACT"
         )   // 3
         else 
         //what happens if {FC_COST_AREA_ACT_BUD_UNION.FISCAL_YEAR} not= year(currentdate)
      )   // 2
      else
      //what happens if {FC_COST_AREA_ACT_BUD_UNION.PERIOD_NUMBER} not=1
    )   //1
    // the next else is for the first failed if-then test
    else 
    if {?Period} = 2 then...   
    Debi
    The numbers next to the parenthesis are to help you follow them
    Edited by: Debi Herbert on Apr 13, 2011 4:40 PM

  • Need some help with a case statement implementation

    I am having trouble using a CASE statement to compare values and then display the results. The other issue is that i want to put these results in a separate column somehow.
    Heres how the code would look:
    SELECT "Task"."Code",
    "Stat" = CASE WHEN "Task.Code" = 1 THEN string
    ....and so on
    I wanted to make "Stat" the new column for the results, and string represents the string to be assigned if 1 was the value for code. I keep getting syntax error, any help would be nice.

    This is a lot easier than you might think.
    1) First, move another column of "Code" to your workspace.
    2) Click on the fx button and then on the BINS tab.
    3) Click on "Add BIN" and with the operand on "is equal to/is in," input 1 and then click "OK."
    4) Name this what you had for "string."
    Repeat for all the different values you want to rename as another "string" value.
    5) Finally, check the "custom heading" checkbox, and rename this column "Stat" as you indicated.
    That's it.

  • Need help with Order by statement

    I have a report which has an order by statement to order a varchar2 field in ascending order.
    The report sorts the records correctly but if I rerun the report, the records with the same values in the column that I order by, do not maintain the same order as was in the report's 1st run.
    The records will still be sorted in ascending order but those records that have the same values interchange positions each time I run the report.
    Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.

    user8655468 wrote:
    but those records that have the same values interchange positions each time I run the report.
    Is this ok or is there a way of making records with same values maintain the same order in all the report runs? Please assist. Thanks.Hello,
    It's normal those are same values may interchange at each run. you can add another column in order by clause. That
    Order by column1,column2 may add another column3 -- this will maintain always same but column 1,2,3 have same value , it will may interchange.
    Hope this helps
    Hamid

  • Help with simple INSERT statement?

    How can I do an insert into Oracle without having to
    specify EVERY field name in the table? This isn't necessary
    with Access or
    SQL Server, which will insert null's in the non-specified
    fields, the Oracle SQL
    tool tells me that there aren't enough field values when I run
    this SQL Statement:
    INSERT INTO TABLE_NAME VALUES (1234, 'test', 'test')
    There are over 10 different fields, but I get the error message:
    Native Error Code 947, Not enough values.
    TIA
    Kris
    null

    Kristofer Goss (guest) wrote:
    : How can I do an insert into Oracle without having to
    : specify EVERY field name in the table? This isn't necessary
    : with Access or
    : SQL Server, which will insert null's in the non-specified
    : fields, the Oracle SQL
    : tool tells me that there aren't enough field values when I run
    : this SQL Statement:
    : INSERT INTO TABLE_NAME VALUES (1234, 'test', 'test')
    : There are over 10 different fields, but I get the error
    message:
    : Native Error Code 947, Not enough values.
    : TIA
    : Kris
    You may omit the columns list, but if you do then the VALUES
    clause must provide values for every column in the table.
    FOR EXAMPLE: if your table were created as follows:
    COLUMN_1 NOT NULL, VARCHAR2(4)
    COLUMN_2 NUMBER(6)
    COLUMN_3 DATE
    COLUMN_4 VARCHAR2(4)
    You could submit a statement like:
    insert into my_table VALUES ('ALLA', , , 'XYZ');
    You could also submit a statement like:
    insert into my_table (column_1, column_4) VALUES ('ALLA', 'XYZ');
    If you do not want to store any value in a particular column,
    then that column must be allowed to accept NULLs.
    Hope this helps.
    null

  • Simple help with a delete statement

    hello guys
    i have a table like such
    CREATE TABLE FWENCUM
        "FWENCUM_FUND"            VARCHAR2(6 BYTE),
        "FWENCUM_GRNT"            VARCHAR2(9 BYTE),
        "FWENCUM_ORG"             VARCHAR2(6 BYTE),
        "FWENCUM_PROG"            VARCHAR2(6 BYTE),
        "FWENCUM_ACCT"            VARCHAR2(6 BYTE),
        "FWENCUM_ACTV"            VARCHAR2(6 BYTE),
        "FWENCUM_LOCN"            VARCHAR2(6 BYTE),
        "FWENCUM_INDCOST_BUDGET"  NUMBER(17,2),
        "FWENCUM_GRANT_TOTAL"     NUMBER(17,2),
        "FWENCUM_FUND_TOTAL"      NUMBER(17,2),
        "FWENCUM_BUDGET_FUND"     NUMBER(17,2),
        "FWENCUM_YTD_FUND"        NUMBER(17,2),
        "FWENCUM_INDCOST_YTD"     NUMBER(17,2),
        "FWENCUM_INDCOST_COMM"    NUMBER(17,2),
        "FWENCUM_ERROR"           VARCHAR2(2 BYTE),
        "FWENCUM_AMOUNT_ENCUMBER" NUMBER(17,2)
      )with these values
    REM INSERTING into FWENCUM
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('240051','240051','07171','01','7623',' ',' ',131635,34865.08,96873.92,-104,null,null,null,null,-104);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420461','420420','04720','02','7623',' ',' ',15600,12287.6,0,124783.52,null,null,null,null,3312.4);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420462','420420','04330','02','7623',' ',' ',15600,7372.56,0,124783.52,null,null,null,null,8227.44);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420456','420420','23040','02','7623',' ',' ',26000,5810.01,0,124783.52,null,null,null,null,20189.99);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420421','420420','04100','02','7623',' ',' ',15600,12287.6,0,124783.52,null,null,null,null,3312.4);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420422','420420','06370','02','7623',' ',' ',31200,27066.52,0,124783.52,null,null,null,null,4133.48);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420423','420420','23050','02','7623',' ',' ',15600,10171.91,0,124783.52,null,null,null,null,5428.09);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420424','420420','04340','02','7623',' ',' ',15600,0,0,124783.52,null,null,null,null,15600);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420451','420420','23050','02','7623',' ',' ',26000,24078.7,0,124783.52,null,null,null,null,1921.3);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420452','420420','22070','02','7623',' ',' ',26000,4050.97,0,124783.52,null,null,null,null,21949.03);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420453','420420','18350','02','7623',' ',' ',26000,9502.1,0,124783.52,null,null,null,null,16497.9);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420454','420420','04340','02','7623',' ',' ',26000,426.38,0,124783.52,null,null,null,null,25573.62);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420455','420420','09060','02','7623',' ',' ',26000,1561.25,0,124783.52,null,null,null,null,24438.75);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420460','420420','04310','02','7623',' ',' ',15600,12287.6,0,124783.52,null,null,null,null,3312.4);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420458','420420','05690','02','7623',' ',' ',26000,0,0,124783.52,null,null,null,null,26000);
    Insert into FWENCUM (FWENCUM_FUND,FWENCUM_GRNT,FWENCUM_ORG,FWENCUM_PROG,FWENCUM_ACCT,FWENCUM_ACTV,FWENCUM_LOCN,FWENCUM_INDCOST_BUDGET,FWENCUM_INDCOST_YTD,FWENCUM_INDCOST_COMM,FWENCUM_GRANT_TOTAL,FWENCUM_FUND_TOTAL,FWENCUM_BUDGET_FUND,FWENCUM_YTD_FUND,FWENCUM_ERROR,FWENCUM_AMOUNT_ENCUMBER) values ('420457','420420','18110','02','7623',' ',' ',26000,3543.58,0,124783.52,null,null,null,null,22456.42);i basically want to delete all the rows where the sum of fwencum_amount_ecumber greater then the single value under fwencum_grant_total for that grant by grant code in other words the expected output should be to delete 15 rows.
    because the sum of fwencum_Amount_encumber for grant 420420 would be greater then the 124,783.52 under the fwencum_grant_Total
    i have tried doing this but i keep getting errors can i get a little advise.
    here is my poor attempt
    DELETE  fwencum
      WHERE  (select sum(f.fwencum_amount_encumber) from fwencum f) > (SELECT DISTINCT
                                                                        FWENCUM_GRANT_TOTAL
                                                                        FROM fwencum F, FWENCUM F2
                                                                        WHERE F.fwencum_grnt=F2.FWENCUM_GRNT);Edited by: mlov83 on Sep 22, 2011 7:24 PM

    Hi,
    Thanks for posting the CREATE TABLE and INSERT statemnts; that's very helpful.
    It looks like only 3 columns play any role in this problem. If so, why are you posting 16 colummns?
    One way to do what you want (as I understand the problem) is to do a Correlated Sub-Query , where the sub-query references something in the main statement, and therefore (potentially) does something different for each row in the main statement, like this:
    DELETE     fwencum       m     -- m is for main
    WHERE     fwencum_grant_total < (
                        SELECT  SUM (fwencum_amount_encumber)
                        FROM     fwencum
                        WHERE     fwencum_grnt     = m.fwencum_grnt
    ;

Maybe you are looking for

  • Erro no SCAN

    Boa noite a todos, Estou efetuando testes do SCAN em nosso ambiente e temos o seguinte cenário de erro: tiramos a url da Sefaz do ar e ativamos o SCAN, faturamos o documento e, no monitor J1BNFE o documento fica no status de aguardando o retorno da S

  • PC Card not recognized - hardware or software issue?

    Hello All, this is my first post to this forum. I own a PowerBook G4 (late 2005) since February 2006, but still do consider myself being new to the world of Mac. Most questions in this forum get good and detailed answers. That's why I hope someone he

  • Problem With Brushes Pressure CS5

    Hello all. I'm using a Photoshop Cs5 with a Wacom Cintiq 12wx Tablet (I'm using PC with WinXP). I'm having some problems withe the pressure, it doesn't work on Photoshop, (I tried it on CS3 & CS5), and I did clicked on the Tablet options in PS. The p

  • Having Sync Issues with new Apple ID

    I was on an apple account with my wife.  We're splitting up so I made myself a new Apple ID, installed iTunes on my home computer and logged into it with my new ID and that looks good. My phone is full of stuff from her account.  When I first plugged

  • Dispute Case - Write-off entry

    Dear Experts, When we write off any invoice through UDM_AUTOWRITEOFF in FSCM, system Debits the Bad debts write off (P&L) A/c and Credits the Customer A/c. However, we want system to segregate VAT, Tax and Freight amount from Bad debts write off A/c.