How to highlight result set data on world map

Hi,
I want to show the graphical representation of world map to highlight the countries which having the maximum booking of hotels of our client xyz.
All the values are coming from the mysql db .
I want the library which will draw the world map on the Jpanel for the respective result set
Plz help me for this .
I generally use the JFreeChart for drawing the other graphs but the Jfreechart don't have the library for the World Map or Destination Graph etc.
Hint: ( Google Analytic's map is the best example )
Thanks In Advanced
Mahesh

This isn't what you want, but it will get you on the right track. I chose the most complex image I could find so give it a few seconds to read the image and build the paths. The parser is catered to the image I chose, but in general you can probably expect the "path" element to delineate the boundaries for any map svg. The particular image I chose grouped the paths with country ID so I added a little mouse interaction to the GUI. Forgive me for any dumbly coded stuff. I didn't put much effort into streamlining it.
import org.xml.sax.*;
import java.awt.*;
import javax.swing.*;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.helpers.DefaultHandler;
import java.awt.geom.Path2D;
import java.util.StringTokenizer;
import java.net.URL;
public class WorldMapTest {
    public static void main(String[] args) throws Exception {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser saxParser = factory.newSAXParser();
        SimpletonPathExtractor handler = new SimpletonPathExtractor();
        saxParser.parse(new URL("http://upload.wikimedia.org/wikipedia/commons/b/b7/World98.svg").openStream(), handler);
        createAndShowGUI(handler.locations);
    public static void createAndShowGUI(final java.util.List<Location> locations) {
        JFrame frame = new JFrame();
        JPanel p = new JPanel() {
            @Override
            public Color getBackground() {
                return Color.white;
            public void paintComponent(java.awt.Graphics g) {
                super.paintComponent(g);
                Graphics2D g2 = (Graphics2D) g;
                g2.scale(getWidth() / 8000.0, getHeight() / 3859.0);
                g2.setColor(Color.black);
                Point p = getMousePosition();
                if(p != null) {
                    p.x = (int) (p.x * 8000/getWidth());
                    p.y = (int) (p.y * 3859/getHeight());
                String placeID = null;
                for (Location loc : locations) {
                    if(p != null && placeID == null && loc.boundry.contains(p)){
                        g2.setColor(Color.LIGHT_GRAY);
                        g2.fill(loc.boundry);
                        placeID = loc.id == null?"Unkown":loc.id;
                        g2.setColor(Color.black);
                    g2.draw(loc.boundry);
                if (placeID != null) {
                    g2.setColor(Color.green.darker());
                    Font f = g2.getFont();
                    f = f.deriveFont(Font.BOLD,(f.getSize() * 8000f / getWidth()));
                    g2.setFont(f);
                    g2.drawString(placeID, p.x, p.y);
            public java.awt.Dimension getPreferredSize() {
                return new Dimension(1000,482);
        p.addMouseMotionListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mouseMoved(java.awt.event.MouseEvent e) {
                ((JComponent) e.getSource()).repaint();
        frame.setContentPane(new JScrollPane(p));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    public static class SimpletonPathExtractor extends DefaultHandler {
        java.util.List<Location> locations = new java.util.ArrayList<>();
        String recentID;
        @Override
        public void startElement(String uri, String localName, String qName, Attributes attr) throws SAXException {
            if("g".equals(qName)) {
                recentID = attr.getValue("id");
            if ("path".equals(qName)) {
                int length = attr.getLength();
                for (int i = 0; i < length; i++) {
                    String attrN = attr.getQName(i);
                    String val = attr.getValue(attrN);
                    if ("d".equals(attrN)) { //path data
                        Path2D path = new Path2D.Double();
                        //assume simple polygonal path
                        StringTokenizer tk = new StringTokenizer(val, "MLzZ ");
                        try {
                            path.moveTo(Double.parseDouble(tk.nextToken()),
                                        Double.parseDouble(tk.nextToken()));
                            while (tk.hasMoreTokens()) {
                                path.lineTo(Double.parseDouble(tk.nextToken()),
                                            Double.parseDouble(tk.nextToken()));
                            path.closePath();
                        } catch (Exception e) {
                            throw new Error("I'm a simple parser. I can only do "
                                    + "'LineTo' paths!", e);
                        locations.add(new Location(path,recentID));;
        public void endElement(String uri, String localName, String qName) throws SAXException {
            if("g".equals(qName)) {
                recentID = null;
    public static class Location {
        Path2D boundry;
        String id;
        public Location(Path2D boundry, String id) {
            this.boundry = boundry; this.id = id;
}

Similar Messages

  • Can we Save BQY without result set/data through dashboard script

    Hi All,
    Can we save a BQY without result set/data through dashboard script?
    Thanks,
    Soumitra

    Hi Soumitra,
    Its happy that you resolved it by yourself. But if you post your solution here then it will be helpful for everyone else looking for the same solution.
    Thanks,
    karthick

  • How to copy FDM setting (import format, dimension mapping, control table)

    Dear All,
    How to copy FDM setting (import format, dimension mapping, control table) from application to another application.
    I found that only dimension mapping can be imported. Is there any way to copy FDM application quickly?
    Thanks your help

    If you get a chance try the following script, it's so simple and easy to extract all the map data to XML and will help in to import back through Import script.
    Sub MapExtractor()
    'UpStream WebLink Custom Script:
    'Created By:      SatyaK
    'Date Created:      12/08/09
    'Purpose: This Script will produce a Account Map File for
    '                         the current location.
    'Execute the export
    strFilePath = API.IntBlockMgr.InterfaceMgr.fExportMapToXML("File Path", PPOVPeriod)
    End Sub
    -------------

  • How to group result set to count values in several (2) attributes?

    Hi there,
    the (simplified) query at the bottom returns the following result set:
    OBJ_ID Attr 1 Attr2
    22674886 HAK44221 GEB132542
    22674886 HAK44221 GEB92751
    22674886     HAK44222 GEB92744
    22674886     HAK17113 null
    However, we need the number of different Attr 1 and Attr2 counted, which should result in the this:
    OBJ_ID Attr 1 Attr2
    22674886 3 3
    We trried using "group by grouping sets", "group by" and also took a glance at "cube" but didn't manage to get the desired result, mainly due to the fact, that Attr2 may contain null values.
    We managed to find a solution using a GTT or a view. Can anybody give a hint how to solve that without using temporary tables?
    Best regards
    Pat
    SELECT
    o.obj_id,
    o2.obj_name as Attr1,
    g.ckw_nis_nummer as Attr2
    FROM objekte o
    JOIN eigenschaftsdaten d0
    ON (o.obj_id = d0.obj_id AND d0.eig_id = 2525755)
    LEFT JOIN eigenschaftsdaten d8
    ON (d0.egd_wert=substr(d8.egd_wert,1,instr(d8.egd_wert, ' ')-1) and d8.eig_id=2525976)
    LEFT JOIN objekte o2
    ON o2.obj_id=d8.obj_id
    LEFT join gebaeude g
    ON o2.obj_id=g.parent_house_service

    Hi,
    That looks like COUNT (DISTINCT ...):
    SELECT       o.obj_id
    ,       COUNT (DISTINCT o.obj_name)          AS attr1
    ,       COUNT (DISTINCT g.ckw_nis_nummer)     AS attr2
    FROM        objekte o
    JOIN        eigenschaftsdaten     d0     ON   o.obj_id      = d0.obj_id
                               AND  d0.eig_id       = 2525755
    LEFT JOIN eigenschaftsdaten      d8     ON   d0.egd_wert = SUBSTR ( d8.egd_wert
                                                             , 1
                                              , INSTR (d8.egd_wert, ' ') - 1
                             and d8.eig_id=2525976)
    LEFT JOIN objekte          o2     ON  o2.obj_id      = d8.obj_id
    LEFT JOIN gebaeude           g     ON  o2.obj_id      = g.parent_house_service
    Depending on your data and your requirements, you may need to join some of the tables separatemly, do a GROUP BY to get attr2, and then join those results to the other tables.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data. WSimplify the problem as much as possible. For exam[ple, if your real problem involves 5 tables, but the part you don't understand can be shown with only 1 or 2 tables, then post sample data and results for those 1 or 2 tables only.
    Point out where the query above is getting the wrong results, and explain, using specific examples, how you get those results from the sample data in those places.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • JDBC- RFC - JDBC    How to send result set to rfc  ?

    Hi Friends ,
                        I am working on scenario like .
              <b>          I have to read  data from a sql server using select statement and send same   data  to r3 ( using RFC  we are inserting the same as  a copy ) .
                        Then i have have get confirmation from R3 as data inserted succesfully  - Flag  .Then we have to come back to same table and update one field  flag as 'U'.</b>
                      For this I am using JDBC Sender Adapter and RFC Receiver Adapter .Will i use  as Synchronous  Interface ?
                      I think i have to use JDBC  Receiver Adapter    also to Complete the cycle .
                      Can you please clarify  the following....
                       1. how is that whole selected data will send to R3 . If i use Select statement in JDBC Sender Adapter  it will as resultset  .It will contain Multiple Rows right ?  Our RFC Will accept the parameter as string .
                        2. If we use the synchronous Interface will it send row by row from the result send Then  get back the result from R3 and come back again to JDBC ( Database ) and  update the required field ?
                        3. In JDBC Sender Adapter , the Update Parameter doing the Updation  Part  prior to get the status from R3. How to handle this ?
                       4. Do i need to configur teh separate JDBC Receiver adpater for this updation part ? Then We cann't use Synchronous Interface right ?
                     5 . Will JDCB Sender  Adapter get the result set (by select statement )  and send to r3 as row by row and get the confirmation message as inserted  ?
    Best Regards .,
    V.Rangarajan

    Hi Udo ,
                   Thanks for your reply . If i have used the synchronnous RFC Calls  , that RFC will return the flag as 'Y' or 'N'  , for  Either succesfully inserted or Not successful .
                      In this synchronous  how can i use the JDBC Receiver adapter ?
                     If 'Y'  or 'N' I have to update the<b> same table ,same row</b> which have sent to RFC .  My doubt , we are  wrirtng the  SQL  select query as  "  <b>select * from table  name where UpdateStatus is null</b> " .
                     So it will return multiple rows right ?   I have to uses the synchronous response form RFC to update the row of the  same table using JDBC Adapter right ?
                   Can you please explain me little bit more ? I am new to xi .
    Best Regards .,
    V.Rangarajan

  • How to display result set boolean value as a check box

    Hi guys,
    I am getting the data which include boolean from the database, i need to display the boolean values as check box, see my code, its displaying the data into the table with the boolean values as true and false, how to make it in check boxes
    package swing2.org;
    import java.awt.GridBagLayout;
    import javax.swing.JPanel;
    import java.awt.Color;
    import javax.swing.BorderFactory;
    import javax.swing.border.BevelBorder;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import java.awt.Container;
    import java.awt.GridBagConstraints;
    import java.awt.ComponentOrientation;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    public class Panel2 extends JPanel {
         private static final long serialVersionUID = 1L;
         private JScrollPane jScrollPane = null;
         private JTable jTable = null;
          * This is the default constructor
         public Panel2() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
         //     Panel2.ResultSetFrame();
              GridBagConstraints gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.fill = GridBagConstraints.BOTH;
              gridBagConstraints.gridy = 0;
              gridBagConstraints.weightx = 1.0;
              gridBagConstraints.weighty = 1.0;
              gridBagConstraints.gridx = 0;
              this.setSize(340, 200);
              this.setLayout(new GridBagLayout());
              this.setBackground(new Color(171, 211, 224));
              this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED), null));
              this.add(getJScrollPane(), gridBagConstraints);
          * This method initializes jScrollPane     
          * @return javax.swing.JScrollPane     
         private JScrollPane getJScrollPane() {
              if (jScrollPane == null) {
                   jScrollPane = new JScrollPane();
                   jScrollPane.setViewportView(getJTable());
              return jScrollPane;
          String[] columnNames = {"Task Description",
                 "Time ",
                 "Pop-up",
                 "Sound",
                 "Delete"};
          * This method initializes jTable     
          * @return javax.swing.JTable     
         private JTable getJTable() {
                      ResultSetFrame oo = new ResultSetFrame();
                      JTable table = new JTable(oo.model);
                      table.setBackground(new Color(195, 217, 230));
                      table.setComponentOrientation(ComponentOrientation.UNKNOWN);
                      table.setShowGrid(true);
                      table.setShowVerticalLines(true);
                      table.setRowHeight(17);
                      table.setShowHorizontalLines(true);
                      return table;
    abstract class ResultSetTableModel extends AbstractTableModel
         public ResultSetTableModel(ResultSet aResultSet)
              rs = aResultSet;
          try
               rsmd = rs.getMetaData();     
          catch(SQLException e)
               System.out.println("Error " + e);
       public String getColumnName(int c)
       {  try
          {  return rsmd.getColumnName(c + 1);
          catch(SQLException e)
          {  System.out.println("Error " + e);
             return "";
       public int getColumnCount()
       {  try
          {  return rsmd.getColumnCount();
          catch(SQLException e)
          {  System.out.println("Error " + e);
             return 0;
       protected ResultSet getResultSet()
       {  return rs;
       private ResultSet rs;
       private ResultSetMetaData rsmd;
    class CachingResultSetTableModel extends ResultSetTableModel
    {  public CachingResultSetTableModel(ResultSet aResultSet)
       {  super(aResultSet);
          try
          {  cache = new ArrayList();
             int cols = getColumnCount();
             ResultSet rs = getResultSet();
             /* place all data in an array list of Object[] arrays
                We don't use an Object[][] because we don't know
                how many rows are in the result set
             while (rs.next())
             {  Object[] row = new Object[cols];
                for (int j = 0; j < row.length; j++)
                   row[j] = rs.getObject(j + 1);
                cache.add(row);
          catch(SQLException e)
          {  System.out.println("Error " + e);
       public Object getValueAt(int r, int c)
       {  if (r < cache.size())
             return ((Object[])cache.get(r))[c];
          else
             return null;
       public int getRowCount()
       {  return cache.size();
       private ArrayList cache;
    class ResultSetFrame 
    {  public ResultSetFrame()
          /* find all tables in the database and add them to
             a combo box
          try
          {  Class.forName("com.mysql.jdbc.Driver");
             con = DriverManager.getConnection("jdbc:mysql://localhost:3306/task","root","nbuser");
                stmt = con.prepareStatement("SELECT * FROM tasky");
                   try
                    String query = "SELECT * FROM tasky";
                    rs = stmt.executeQuery(query);
                    model = new CachingResultSetTableModel(rs);
                    JTable table = new JTable(model);
                    scrollPane = new JScrollPane(table);
                catch(SQLException e)
                     System.out.println("Error " + e);
          catch(ClassNotFoundException e)
          {  System.out.println("Error " + e);
          catch(SQLException e)
          {  System.out.println("Error " + e);
       private JScrollPane scrollPane;
       public ResultSetTableModel model;
       private ResultSet rs;
       private Connection con;
       private Statement stmt;
    }

    add a
    public Class getColumnClass(int col) {
         return getValueAt(0, col).getClass();
    }in your ResultSetTableModel which extends AbstractTableModel.
    A simple example
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.table.AbstractTableModel;
    public class SimpleDemo extends JFrame {
        public SimpleDemo() {
            createAndShowUI();
        private void createAndShowUI(){
            String[] columnName = {"CheckBox Column", "Data Column"};
            Object[][] data = {{new Boolean(true), "Data 1"},
            {new Boolean(false), "Data 2"}, {new Boolean(true), "Data 3"}};
            MyModel model = new MyModel();
            model.setData(columnName, data);
            JTable myTable = new JTable(model);
            JScrollPane scrollPane = new JScrollPane(myTable);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            getContentPane().add(scrollPane);
            pack();
            setLocationRelativeTo(null);
        class MyModel extends AbstractTableModel {
            String[] columnName;
            Object[][] data;
            public void setData(String[] colName, Object[][] theData) {
                this.columnName = colName;
                this.data = theData;
                fireTableStructureChanged();
            public String getColumnName(int column) {
                return columnName[column];
            public Object getValueAt(int rowIndex, int columnIndex) {
                return data[rowIndex][columnIndex];
            public int getRowCount() {
                return data.length;
            public int getColumnCount() {
                return columnName.length;
            public Class getColumnClass(int c) {
                return getValueAt(0, c).getClass();
        public static void main(String[] args){
            Runnable run = new Runnable(){
                public void run(){
                    new SimpleDemo().setVisible(true);
            SwingUtilities.invokeLater(run);
    }

  • How to display results set of multiple reports into a single report table

    Our goal is to create a single report (or dashboard) that shows the "funnel" of object creations related to each campaign. The flow goes from Activity to Lead to Opportunity as well as multiple steps within each (ie. Unqualified Lead -> Qualified Lead, etc).
    We currently have 3 separate reports in three different subject areas, each reporting the different metrics and we would like to combine the output into a single Unified report.
    For example what we currently have is:
    Activities:
    Campaign Name # of Activities
    Campaign A 12
    Campaign B 26
    Leads:
    Campaign Name # of Leads # of Qualified Leads
    Campaign A 10 4
    Campaign B 20 18
    Opportunities:
    Campaign Name # of Opportunities # of Opps per Sales Stage ... # of Wins Closed Revenue
    Campaign A 3 2 1 $1,000.00
    Campaign B 10 8 3 $2,800.00
    What we want to see is:
    Combined:
    Campaign Name - Campaign Cost - # of Activities - # of Leads - # of Qualified Leads - # of Opportunities - # of Opps per Sales Stage - # of Wins - Closed Revenue
    Campaign A - $423.00 - 12 - 10 - 4 - 3 - 2 - 1 - $1,000.00
    Campaign B - $ 1,000.00 - 26 - 20 - 18 - 10 - 8 - 3 - $2,800.00
    We have tried using the "Combine with similar analysis" but the number of columns for each subject area differ. We also tried creating multiple UNION criteria (one for each column), but in the case of # of Opps per Sales Stage and Closed Revenue, those are not "Metrics" fields, so they won't combine.

    Hi, You may have to create some dummy fields to equate the no. of field in each of the report matching the data type too and get a one single report using combined analytics and then using the resultant data you can create a simple pivot like below. Haven't tried it before
    -- Venky CRMIT
    Hi Venky,
    I am facing the same problem. Can you please say Steps how to create resultant data and Combine in pivot Table .
    Please Help me .
    Thanks in Advance .
    My mail id is :
    [email protected]

  • How to highlight break column data in an interactive report?

    Relates to an interactive reports V4.x :
    In the break column area in an IR report, the labels and data seem to be very vanilla and hard to distinguish particularly if you break on more than one column. When I move a non-break column with a highlight defined (set on cell) into the break position, the highlighting disappears.
    Is it possible to somehow retain the highlight colour on break column data?
    Any hints?
    thanks in advance
    Paul P

    bump!

  • How to determine how many times result set columns have same value

    Hi -
    I'm doing a report which will be used for payment trend analyses.
    My initial result set looks like this:
    HOUSEHOLD_ID     JAN_PMT     FEB_PMT     MAR_PMT     APR_PMT     MAY_PMT     JUN_PMT     JUL_PMT     AUG_PMT     SEP_PMT     OCT_PMT     NOV_PMT     DEC_PMT
    90026845409     1     1     1     1     2     1     1     1     1     0     1     0(many rows, of course; result set pivoted)
    I need to determine the households that have a > 0 value in three or more consecutive months.
    I'm hoping someone will have some suggestions because the only solutions I'm coming up with right now would be a coding nightmare (lots of "OR's"), and I'm assuming (hoping) there's a better solution out there.
    Thanks!
    Christine

    Hi Frank,
    I'm not sure I'm understanding how I would use those analytic functions. Here is my select statement:
    SELECT HOUSEHOLD_ID,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JAN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS FEB_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS APR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAY_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUL_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS AUG_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS SEP_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS OCT_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS NOV_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS DEC_PMT
      FROM MONETARY_TRANS
    WHERE MONETARY_TRANS_TYPE_ID    = 1                             --payment
    --TESTING
    AND HOUSEHOLD_ID = 90026845409
       AND RESPONSIBLE_PARTY_TYPE_ID = 1                             --household
       AND RECEIVED_DATE > '01-JAN-2008'
       AND ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6
        OR   TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 )
       AND PREMIUM_AMOUNT            > 0
       AND BILLING_TRANS_TYPE_ID     = 6
       AND MONETARY_TRANS_TYPE_ID    = 1
       AND RESPONSIBLE_PARTY_TYPE_ID = 1
    GROUP BY HOUSEHOLD_IDAnd from this I get the results originally posted. From there I need to figure out the households that have values greater than 0 for three or more consecutive months.
    Thanks for your help........
    -Christine

  • JdbcodbcDriver uses the wrong charSet for interpreting the result set data

    Hi everyone,
    I?m having trouble getting results from a MS Access database which uses Greek characters. All the characters in the range 0-127 are returned good but I get ??? for all above 127.
    Here is some more details:
    OS: win2k
    Local setting for current user: Greek (not that it makes a difference)
    Default Language setting for the System: English (Astralia). This uses charSet Cp1252 or ISO 8859-1 encoding.
    Environment: JBuilder 7.0
    JDK: 1.4.1
    DB: MS Access
    DB charSet: Cp1253 (Greek encoding or ISO 8859-7)
    Connection method:
         java.util.Properties prop = new java.util.Properties();
         prop.put("user" , userName);
         prop.put("password" , password);
         //driver is "sun.jdbc.odbc.JdbcOdbcDriver";     
         //none of these work
         //prop.put("charSet", "UTF-8");
         //prop.put("charSet", "Greek");
         prop.put("charSet", "Cp1253");
         connection = DriverManager.getConnection(MY_ACCESS_DB,prop);
    DataSet Access method:
         // run query and get resultSet rs here
         char[] cBuff= new char[1000];
         // I have tried getString(), getBytes(), getBinaryStream also
         Reader rReader = rs.getCharacterStream(3);
         BufferedReader fIn = new BufferedReader(rReader);
         int res = fIn.read(cBuff, 0, 999);
         // contents of cBuff is incorrect here
    I have also used -Dfile.encoding=Cp1253 in command line which seems to change the default charSet of the JVM. Tested
         String en = new InputStreamReader(System.in).getEncoding();
         System.out.println("Default encoding: " + en);
    By enabling trace and looking at the content of the resultSet object it shows that
    rs.OdbcApi.charSet = "Cp1253"
    So I'm absolutely stumped. The only possible problems I can think of is either a bug in the jdbcodbcDriver or in my native ODBC driver. The latter is less likely since I connected to the same datasouce using a different application and get the right result.
    One more thing that may be helpful, if I set up the default charSet under Win2K to "Greek" (that is setting default language setting in Regional Options under Control Panel)
    Everything works fine.
    Is there anyone out there with answer to my problem?
    Thanks in advance.

    Tried your program and it does exactly as I expected. I get a whole lot of '?'s with my OS default language setting on English but it works fine as soon as I set it to Greek. It does not make a difference if I change the "input language" on the language bar (shift+ctrl) to Greek or not. Or if I change the charSet in your program to something else. Which bring up the question what do you use the charSet setting on your program for? If it is for byte conversion, I don't think you need it since the OS default charset is used by ResultSet.GetString and that needs to be set anyway.
    Anyhow your program basically behaves exactly the same way as mine does. I am almost 100% sure that the problem is with the properties used (or not used) when creating the connections. There has got to be a (provider) property like "useUnicode" or "charSet" or something that is passed through jdbcodbc bridge to ODBC to MS Access to force it to return the result set in UTF-8 format. I confirmed this by using Visual C++ data access program that i wrote (which has the same sort of problem). All other MS Office products know about this property that why they work when i imort data from them.
    This means I don't have a jdbc or even a java problem but my problem is MS Access related. So I�m going to post a question on an MS Access user group (if I find one) and see what I get). Thanks for your help with this.
    By the way AOKabc crashed once and froze another time. I think it had more to do with the libraries you are using rather than your code. I have a trace log if you are interested.
    Soheil

  • How to export result set from mysql query browser to .sql in oracle

    Hi folks:
    I was trying to export result set from MySql query browser to Oracle. I could able to do
    File->Export Result Set-> Excel format...
    What I am trying to get is .sql file so that I can run it as a script in my oracle db. Is there any way we can get .sql file with inserts and delimeters ....?
    Did you guys get my question.?
    Please throw some light on this....
    Could be very appreciable ....
    Thanks
    Sudhir Naidu

    Hi
    Create a sql statement which generates the insert statements.
    Something like this:
    select 'insert into table1 (column1, column2, column3) values (' ||
    column1 || ', ' || column2 || ', ' || column3 || ');' from table 1;
    The || sign is the string concatenation sign in Oracle, replace it the appropriate sign in MySql. Export the result set of this query into a file, and you can run it in a SqlPlus.
    Ott Karesz
    http://www.trendo-kft.hu

  • How dynamically genrate result set in OBIEE 11.

    I have variable in OBIEE 11 dashboard report that contains a comma separated string
    represented by Fact table columns as below are 3 columns of Fact table Unique Clicks, No of Prospects,
    and Email Sent Count
    Var = “Fact”.”Unique Clicks”,”Fact”.”No of Prospects”,”Fact”.”Email Sent Count”
    Now I want to separate these columns and generate columns of result set in OBIEE 11 dashboard report
    In other word dynamically generate result set columns.
    Can I do through java script, changes in analysis XML shown in Advanced tab etc any syggestion.

    Hi Radha,
    If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
    If you want to use caching, you should enable caching in the nqsconfig.ini file.
    Cheers,
    Daan Bakboord

  • How do I get routing data from the Map App (powered by TomTom) so I can display the point-to-point annotations (turn-by-turn navigation) without leaving my own application.

    I have a tableView displaying a list of contacts from a Cloud Database.  After selecting a contact, I push to a programmatically created MKMapView.  Then I display the initial region (the view) that includes the users current location (starting point) and their selected destination (end point).
    Now I want to display annotations (as described in the Location Awareness Programming Guide) that displays polylines which will represent the turn-by-turn navigation IN MY OWN APPLICATION, and not in the Map App currently used in IOS6. 
    Due to licensing and its becoming depricated in IOS 6, I do not want to get routing data from the Google Maps API.  How do I get routing data from the IOS 6 Map App (powered by TomTom) so I can display the point-to-point annotations (turn-by-turn navigation) without leaving my own application?
    I checked out Stack Overflow and other forums which basically left me with the impression that this is not possible. I also checked out the TomTom iPhone Mobile SDK User Guide from the TomTom Developer Portal and am still confused.  It must be possible to retrieve routes, since the Map App can display turn-by-turn directions.  How can I retrieve turn-by-turn data that I may display as a route within my own application?

    Thanks Michael. Apologies for the slow reply I was away for a bit (holiday blitz at work and visiting family madness etc.etc.) back now, I set both options you requested to "never " and retried the CMS software with no change. 
    I do have progress of a sort though, as a test I took a separate test PC and put a clean install of Win7 on and loaded up the CMS software (it worked perfectly) and then took the version of ole32.dll off that machine and put it onto the computer I had built
    for her (using Linux) and...
    got a new error code. Darn I was so sure I had found a clever solution this time lol.
    Anyway now when the CMS fails it gives me a similar error but the offending module is "ntdll.dll" sooo... I tried taking the "working" version of ntdll.dll from the test box and moving it over (making sure to back up the existing ones
    first so I could put them back if needed) to her new PC and the PC would not boot. 
    It seems to want the original versions of a few Dynamic Link Libraries and if I could somehow give it those while not breaking Win7 it should theoretically work seeing as it no longer errors with ole32.dll. 
    ntdll.dll however seems necessary for Win7 to boot.
    So what I am wondering now is:
    Is there some way to have both versions of the DLL file in the system32 folder (bypassing the "cannot have two files with the exact same name in the same folder" thing) or rename the original DLL's something else and somehow make the CMS look for
    the new named versions so the system has the updated DLL's it needs to boot/run and the CMS has the old ones it wants to run or is there someway to have a self contained install of the CMS, say on a USB flash drive and give it it's own E:/windows/system32/needed
    dll's  path to the files it needs? 
    Willing to try any other options or settings you may have come up with as well.
    Thanks again for your reply and my apologies for not answering sooner.

  • How we can view convert data after XSLT mapping & before Graphical mapp

    Hello Friends,
    Currently i am working on XI standard content. In this client need some customization.
    In interface mapping, XSLT mapping on 1st position & Graphical mapping on 2nd position.
    As per my understanding 1st XSLT mapping will be exected then Graphical mapping.
    Can I see or check convert data from XSLT mapping.
    I want to check data between XSLT mapping & Graphical mapping.
    Kindly help me out.
    Regards,
    Narendra

    >
    Narendra GSTIT wrote:
    > I dont want to test standalone XSL Code.
    >
    > The data which I get from Source interface and after XSLT mapping I want to check this that my XSLT code is going well or not.
    >
    > i.e. check for proper input & get proper output.
    You have ro do standalone testing of the XSLT mapping.....Interface Mapping or Interface Determination will give you output message which will be that of message mapping (the last mapping)
    What is the issue in testing the XSLT mapping alone?...may be in Stylus Studio.
    Just ensure that XSLT mapping produces proper output and then this output message of XSLT is the input to your Message Mapping.....once the entire Interface mapping gets executed then it would mean that all the included mapping programs work fine.
    Regards,
    Abhishek.

  • Managing Result Set Data

    I am trying to display a large amount of data on a web page - enough data that I need to partition it into smaller sets of data to show on each page. It is also too much data to cache all of it.
    The first idea I had was to use the rownum in the sql statement. For example for page 3:
    SELECT * from table_name where rownum between 200 and 300
    However I found this is not an appropriate use of rownum.
    The only other idea I have is something like the following, where I return all the data and sort out what I want. But I know this is a common issue, and there has to be a better way to return blocks of data. Anyone have a suggestion?
    int pageCount = 100;
    int rowNumber = 0;
    while(rs.next())
    if( rowNumber < storedRowNum ) //row is less than specified range - do nothing
    else if( rowNumber > storedRowNum + pageCount ) //row is greater than specified range - exit loop
    else //this is the data range I want for this page - store in a Collection to display
    }

    But I know this is a common issue, and there has to be a better way to return blocks of data.
    Anyone have a suggestion?You're right, this is a common issue; search the forums for various solutions.

Maybe you are looking for

  • Issue in ESS

    Hi All, When we login into ESS and navigate to leave ---> cashout ann lve /lsl/bel then we are getting the below error. com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Conversion error between two character sets. 500   Internal Server E

  • Contract Billing Plan

    Using VA42, I have to create the Billing Plan for contract line items. I find many Function Modules and BAPIs to update the existing Billing Plan for the contract line. Any idea about how to create one? Any BAPI/FM? Pranu

  • Automatic invoice settlement

    Hi. Recently we have started issuing PO & invoices in foreign currencies. Payments are sent in the respective currencies as well. Whenever we do all of the aforementioned in the local currency, after running F110 automatic postings and invoice cleari

  • Apps tab in Creative Cloud manager is blank

    I'm trying to download a free trial of After Effects. I have downloaded the Creative Cloud manager for my desktop, but the Apps tab remains blank with a spinning wheel. The other tabs all show their appropriate options, but the Apps tab shows nothing

  • Custom Notification Mailer

    Hi, Custom Notification mailer was defined and so far its running well. Just compared with the other instance...in other instance were 'Workflow Notification Mailer' is running it sends notification when ever a indent is raised. But in the instance w