Problem in writing a Read Statement

Hi,
In my Table control I have a POSITION button which is used to find the record in the table.
I have written the following code.
  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
*   NO_VALUE_CHECK        = ' '
      popup_title           = 'Find the record'
*   START_COLUMN          = '5'
*   START_ROW             = '5'
* IMPORTING
*   RETURNCODE            =
    TABLES
      fields                = lt_tab
EXCEPTIONS
   error_in_fields       = 1
   OTHERS                = 2
I have five primary keys in my table, so that in the pop up I am getting all the five fields.
The user will enter any of the five fields , I want to write a read statement based on the fields entered by the user.
Could anybody help in writing the Read  statement.
Or could any one help me in writing out the FIND functionality for a table control
Regards
Edited by: SAP LEARNER on Jun 15, 2010 1:40 PM

Hi,
I do not know what fields will be filled up.
as there are 5 PK fields so 5! chances will be there for the where condition in the READ statement.
How can I do it.
I tried in the following way.
I created a structure with the primary key fields and I filled the structure with the user filled values.
Then I used it in the read statement as below, but it did not work.
    LOOP AT lt_tab .
      IF lt_tab-fieldname = 'SOCIEDAD'.
        lw_pk-sociedad = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'NATURAL_YEAR'.
        lw_pk-natural_year = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'CICLO_DE_VENTAS'.
        lw_pk-ciclo_de_ventas = lt_tab-value.
      ENDIF.
      IF lt_tab-fieldname = 'MODEL_VERSION'.
        lw_pk-model_version = lt_tab-value.
      ENDIF.
    ENDLOOP.
    DATA:lw_yrwbw010 TYPE ty_yrwbw010.
    READ TABLE t_yrwbw010 INTO lw_yrwbw010 WITH KEY lw_pk.
     IF sy-subrc = 0.
      table-top_line = sy-tabix.
     ENDIF.
  ENDIF.
@Rob Burbank
Could you please help me !! I could not find that in F1 help.
@ Keshav.T         
Could you please elaborate it please

Similar Messages

  • Problem with writing and reading using serialization

    I am having a problem with writing and reading an object that has another object in it. The purpose of the class is to write a order that has multiple items in it. And there will be several orders. This is for an IB project, where one of the requirements is to utilize a hierarchical composite data structure. That is, it is "one that contains more than one element and at least one of the elements is a composite data structure. Examples are, an array or linked list of records, a record that has one field that is another record, or an array". The code is shown below:
    The error produced is
    java.lang.NullPointerException
         at SamsonRubberIndustries.CustomerOrderDetails.createCustOrdDetailsScreen(CustomerOrderDetails.java:150)
         at SamsonRubberIndustries.CustomerOrderDetails$1.run(CustomerOrderDetails.java:78)
         at java.awt.event.InvocationEvent.dispatch(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)
    public class CustOrdObject implements Serializable {
         public int CustID;
         public int CustOrderID;
         public Object OrderDate;
         public InnerCustOrdObject[] innerCustOrdObj;
         public float GrandTotal;
         public int MaxItems;
         public CustOrdObject() {}
         public CustOrdObject(InnerCustOrdObject[] innerCustOrdObj,
    int CustID, int CustOrderID, Object OrderDate,
    float GrandTotal, int innerarrlength, int innerarrpos, int MaxItems) {
              this.CustID = CustID;
              this.CustOrderID = CustOrderID;
              this.OrderDate = OrderDate;
              this.GrandTotal = GrandTotal;          
              this.MaxItems = MaxItems;
              this.innerCustOrdObj = new InnerCustOrdObject[MaxItems];
         public InnerCustOrdObject[] getInnerCustOrdObj() {
              return innerCustOrdObj;
         public void setInnerCustOrdObj(InnerCustOrdObject[] innerCustOrdObj) {
              this.innerCustOrdObj = innerCustOrdObj;
         public int getCustID() {
              return CustID;
         public void setCustID(int custID) {
              CustID = custID;
         public int getCustOrderID() {
              return CustOrderID;
         public void setCustOrderID(int custOrderID) {
              CustOrderID = custOrderID;
         public Object getOrderDate() {
              return OrderDate;
         public void setOrderDate(Object orderDate) {
              OrderDate = orderDate;
         public void setGrandTotal(float grandTotal) {
              GrandTotal = grandTotal;
         public float getGrandTotal() {
              return GrandTotal;
         public int getMaxItems() {
              return MaxItems;
         public void setMaxItems(int maxItems) {
              MaxItems = maxItems;
    public class InnerCustOrdObject implements Serializable{
         public int ItemNumber;
         public float UnitPrice;
         public int QuantityRequired;
         public float TotalPrice;
         public InnerCustOrdObject() {}
         public InnerCustOrdObject(int ItemNumber, float
    UnitPrice, int QuantityRequired, float TotalPrice){
              this.ItemNumber = ItemNumber;
              this.UnitPrice = UnitPrice;
              this.QuantityRequired = QuantityRequired;
              this.TotalPrice = TotalPrice;
         public int getItemNumber() {
              return ItemNumber;
         public void setItemNumber(int itemNumber) {
              ItemNumber = itemNumber;
         public int getQuantityRequired() {
              return QuantityRequired;
         public void setQuantityRequired(int quantityRequired) {
              QuantityRequired = quantityRequired;
         public float getTotalPrice() {
              return TotalPrice;
         public void setTotalPrice(float totalPrice) {
              TotalPrice = totalPrice;
         public float getUnitPrice() {
              return UnitPrice;
         public void setUnitPrice(float unitPrice) {
              UnitPrice = unitPrice;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.swing.*;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.table.DefaultTableModel;
    public class CustomerOrderDetails extends CommonFeatures{
         //TODO
         private static int MAX_ORDERS = 200;
         private static int MAX_ORDERITEMS = 100;
         private static int MaxRecord;
         private static int CurrentRecord = 1;
         private static int currentItem;
         private static int MaxItems;
         private static boolean FileExists, recFileExists;
         private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
         private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];     
         private static File OrderDetailsFile = new File("CustOrdDetails.dat");
         private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
         private static PrintWriter writeFile;
         private static BufferedReader readFile;
         private static ObjectOutputStream objOut;
         private static ObjectInputStream objIn;
         //Set format for date
         SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
         //--<BEGINNING>--Declaring Interface Variables------------------------------------------//
         private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
         private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
         private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
         private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
         //--<END>--Declaring Interface Variables------------------------------------------------//
         public static void main(String[] args) {
              final CustomerOrderDetails COD = new CustomerOrderDetails();
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        try {
                             UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                             COD.createCustOrdDetailsScreen();
                        } catch (Exception eb) {
                             eb.printStackTrace();
         //--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
         public JFrame createCustOrdDetailsScreen() {
              createDefaultFrame();
              mainframe.setSize(800,500);
              createContainerPanel();
              containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
              containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
              //containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
              //containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
              containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
              mainframe.setContentPane(containerpanel);
              mainframe.setLocationRelativeTo(null);
              mainframe.setVisible(true);
              //--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
              if (OrdRecordNumStore.exists() == true) {
                   recFileExists = true;
              }else {
                   recFileExists = false;
              if (recFileExists == true) {
                   MaxRecord = readRecordNumber();
                   CurrentRecord = MaxRecord;
                   //readOrder();
                   //readInnerOrderRecord(CurrentRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              }else{
                   MaxRecord = 1;
                   writeRecordNumber(MaxRecord);
                   CustOrderIDTxt.setText(""+MaxRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              //--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
              if(readOrder() != null){
                   orderDetails = (CustOrdObject[]) readOrder();
                 innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
                   MaxItems = orderDetails[CurrentRecord].getMaxItems();
                   if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
                        externalnextbtn.setEnabled(true);
                        externalprevbtn.setEnabled(true);
                   if(CurrentRecord >= MaxRecord){
                        externalnextbtn.setEnabled(false);
                   getFieldText(CurrentRecord-1);
              }else{
                   orderDetails[CurrentRecord] = new CustOrdObject();
                   currentItem = 1;
              return mainframe;
         //--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
         public JPanel createCustOrdDetailsTitle(){
              createTitlePanel();
              titlepanel.setBackground(TxtfontColor);
              label.setText("- Customer Order Details -");
              labelpanel.setBackground(TxtfontColor);
              label.setForeground(Color.white);
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor) ;
              buttonpanel.add(createReturnToMainMenuButton());
              titlepanel.add(labelpanel, BorderLayout.WEST);
              titlepanel.add(buttonpanel, BorderLayout.EAST);
              return titlepanel;
         public JPanel createCustOrdDetailsMainPanel(){
              createmainpanel();
              mainpanel.setBackground(TxtfontColor);
              mainpanel.setLayout(new BorderLayout());          
              mainpanel.setBorder(BorderFactory.createTitledBorder(""));
              mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
              mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
              mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
              mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
              mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
              return mainpanel;
         public JPanel createInnerTopPanel(){
              innertoppanel = new JPanel(new GridBagLayout());
              innertoppanel.setBackground(TxtfontColor);
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              CustIDLbl = new JLabel("Customer ID");
              CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustIDLbl.setFont(font);
              CustIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innertoppanel.add(CustIDLbl, GBC);     
              CustIDTxt = new JTextField(20);
              CustIDTxt.setEditable(true);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innertoppanel.add(CustIDTxt, GBC);
              GBC.gridx = 3;
              GBC.gridy = 1;
              innertoppanel.add(Box.createHorizontalStrut(220), GBC);
              OrderedDateLbl = new JLabel("Order Date");
              OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              OrderedDateLbl.setFont(font);
              OrderedDateLbl.setForeground(LblfontColor);
              GBC.gridx = 4;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateLbl, GBC);     
              //Get today's date
              Date todaydate = new Date();
              OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
              OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
              OrderedDateTxt.setEditable(false);
              GBC.gridx = 5;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateTxt, GBC);
              CustOrderIDLbl = new JLabel("Customer Order ID");
              CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustOrderIDLbl.setFont(font);
              CustOrderIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDLbl, GBC);
              CustOrderIDTxt = new JTextField(20);
              CustOrderIDTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDTxt, GBC);
              return innertoppanel;
         public JPanel createInnerCenterPanel(){
              innercenterpanel = new JPanel(new GridBagLayout());
              innercenterpanel.setBackground(TxtfontColor);
              innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              ItemNumberLbl = new JLabel("Item Number");
              ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              ItemNumberLbl.setFont(font);
              ItemNumberLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberLbl, GBC);     
              ItemNumberTxt = new JTextField(20);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberTxt, GBC);
              UnitPriceLbl = new JLabel("Unit Price");
              UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              UnitPriceLbl.setFont(font);
              UnitPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceLbl, GBC);     
              UnitPriceTxt = new JTextField(20);
              //UnitPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceTxt, GBC);
              QuantityReqLbl = new JLabel("Quantity Required");
              QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              QuantityReqLbl.setFont(font);
              QuantityReqLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqLbl, GBC);     
              QuantityReqTxt = new JTextField(20);
              //QuantityReqTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqTxt, GBC);
              TotPriceLbl = new JLabel("Total Price");
              TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              TotPriceLbl.setFont(font);
              TotPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceLbl, GBC);     
              TotPriceTxt = new JTextField(20);
              //TotPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceTxt, GBC);
              return innercenterpanel;
         public JPanel createInnerBottomPanel(){
              innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              innerbottompanel.setBackground(TxtfontColor);
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              GrandTotLbl = new JLabel("Grand Total");
              GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              GrandTotLbl.setFont(font);
              GrandTotLbl.setForeground(LblfontColor);
              innerbottompanel.add(GrandTotLbl);
              innerbottompanel.add(Box.createHorizontalStrut(30));
              GrandTotTxt = new JTextField(20);
              innerbottompanel.add(GrandTotTxt);
              return innerbottompanel;
         public JPanel createInnerRightPanel(){
              innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerrightpanel.setBackground(TxtfontColor);
              innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
              innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerrightpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalnextbtn = new JButton(createNextButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        //getInnerFieldText(currentItem);
                        internalprevbtn.setEnabled(true);
                        if(currentItem < MaxItems){
                             ++CurrentRecord;
                             //readOrder();
                             //readInnerOrderRecord(CurrentRecord);
                             setInnerFieldText(currentItem);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(currentItem == MaxItems){
                             internalnextbtn.setEnabled(false);
              innerrightpanel.add(internalnextbtn, GBC);
              return innerrightpanel;
         public JPanel createInnerLeftPanel(){
              innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerleftpanel.setBackground(TxtfontColor);
              innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerleftpanel.setForeground(Color.BLACK);
              innerleftpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalprevbtn = new JButton(createPreviousButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        //getInnerFieldText(currentItem);
                        internalnextbtn.setEnabled(true);
                        if(currentItem == 1){
                             internalprevbtn.setEnabled(false);
                        if(currentItem > 0){
                             --currentItem;
                             //readOrder();
                             setInnerFieldText(currentItem);
              innerleftpanel.add(internalprevbtn, GBC);
              return innerleftpanel;
         public JPanel createCustOrdDetailsButtons(){
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor);
              externalprevbtn = new JButton(createPreviousButtonIcon());
              externalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalnextbtn.setEnabled(true);
                        if(CurrentRecord == 1){
                             externalprevbtn.setEnabled(false);
                        if(CurrentRecord > 0){
                             --CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
              buttonpanel.add(externalprevbtn);
              addrecordbtn = new JButton("Add Record", createAddButtonIcon());
              addrecordbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             MaxRecord = readRecordNumber();
                             MaxRecord++;
                             writeRecordNumber(MaxRecord);
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             CustIDTxt.setText("");
                             CustOrderIDTxt.setText(""+MaxRecord);
                             //Get today's date
                             Date todaydate = new Date();
                             OrderedDateTxt.setText(""+simpleDF.format(todaydate));
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             GrandTotTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             externalnextbtn.setEnabled(false);
                             externalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(addrecordbtn);
              savebtn = new JButton("Save Data", createSaveButtonIcon());
              savebtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        setFieldText(CurrentRecord);
                        writeOrder();
                        writeRecordNumber(MaxRecord);
                        System.out.println(CurrentRecord);
                        System.out.println(MaxRecord);
              buttonpanel.add(savebtn);
              java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
              ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
              additemreqbtn = new JButton("Add Item", AddRowIcon);
              additemreqbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             //CurrentRecord = MaxRecord;
                             currentItem++;
                             setInnerFieldText(currentItem);
                             internalnextbtn.setEnabled(false);
                             internalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(additemreqbtn);
              externalnextbtn = new JButton(createNextButtonIcon());
              externalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalprevbtn.setEnabled(true);
                        if(CurrentRecord < MaxRecord){
                             ++CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(CurrentRecord == MaxRecord){
                             externalnextbtn.setEnabled(false);
              buttonpanel.add(externalnextbtn);
              return buttonpanel;
         //TODO
         public void setFieldText(int orderID){//TODO
              orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
              orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
              orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
              orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
              orderDetails[orderID].setMaxItems(MaxItems);
              setInnerFieldText(currentItem);
              orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
         public void setInnerFieldText(int currentItem){//TODO
              innerCustOrdObj[currentItem] = new InnerCustOrdObject();
              innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
              innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
              innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
              innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
         public void getFieldText(int orderID){
              CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
              CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
              OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());          
              currentItem = orderDetails[orderID].getMaxItems();
              System.err.println("currentItem" + currentItem);
              getInnerFieldText(currentItem);
              GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
         public void getInnerFieldText(int currentItem){
              ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
              UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
              QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
              TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
         public void writeOrder(){//TODO
              try {
                   objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
                   objOut.writeObject(orderDetails);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              } catch (IOException e) {
                   e.printStackTrace();
         public Object readOrder(){
              Object temporaryObj;
              try{
                   objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
                   temporaryObj = objIn.readObject();               
                   CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
                   System.out.println("Outer: "+blah[1].getCustID());
                   InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
                   System.out.println("Inner: "+whee[1].getItemNumber());
                   objIn.close();
                   System.out.println("Read Worky!");
                   return temporaryObj;
              }catch(Exception e){
                   e.printStackTrace();
                   System.out.println("Read No Worky!");
                   return null;
         public void writeRecordNumber(int MaxRecord){
              try{
                   objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
                   objOut.writeObject(MaxRecord);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              }catch(Exception e){e.printStackTrace();}
         public int readRecordNumber() {
              try {
                   objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
                   int temporaryObj = Integer.parseInt(objIn.readObject().toString());
                   objIn.close();
                   System.out.println("Read Number Worky!");
                   return temporaryObj;
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Read Number No Worky!");
                   return -1;
    }Message was edited by:
    Kilik07
    Message was edited by:
    Kilik07

    ok i got reading to work to a certain extent... but the prob is i cnt seem to save my innerCustOrdObj proprly...when ever i look for a record using the gotorecordbtn, the outerobject, which is the orderDetails, seems to change but the innerCustOrdObj remains the same... heres the new code..
    public class CustomerOrderDetails extends CommonFeatures{
         //TODO
         private static int MAX_ORDERS = 200;
         private static int MAX_ORDERITEMS = 100;
         private static int MaxRecord;
         private static int CurrentRecord = 1;
         private static int currentItem;
         private static int MaxItems = 1;
         private static boolean FileExists, recFileExists;
         private static boolean RecordExists;
         private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
         private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];     
         private static File OrderDetailsFile = new File("CustOrdDetails.ser");
         private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
         private static PrintWriter writeFile;
         private static BufferedReader readFile;
         private static ObjectOutputStream objOut;
         private static ObjectInputStream objIn;
         //Set format for date
         SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
         //--<BEGINNING>--Declaring Interface Variables------------------------------------------//
         private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
         private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
         private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
         private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
         //--<END>--Declaring Interface Variables------------------------------------------------//
         public static void main(String[] args) {
              final CustomerOrderDetails COD = new CustomerOrderDetails();
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        try {
                             UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
                             COD.createCustOrdDetailsScreen();
                        } catch (Exception eb) {
                             eb.printStackTrace();
         //--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
         public JFrame createCustOrdDetailsScreen() {
              createDefaultFrame();
              mainframe.setSize(800,500);
              createContainerPanel();
              containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
              containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
              //containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
              //containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
              containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
              mainframe.setContentPane(containerpanel);
              mainframe.setLocationRelativeTo(null);
              mainframe.setVisible(true);
              //--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
              if (OrdRecordNumStore.exists() == true) {
                   recFileExists = true;
              }else {
                   recFileExists = false;
              if (recFileExists == true) {
                   MaxRecord = readRecordNumber();
                   CurrentRecord = MaxRecord;
                   //readOrder();
                   //readInnerOrderRecord(CurrentRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              }else{
                   MaxRecord = 1;
                   writeRecordNumber(MaxRecord);
                   CustOrderIDTxt.setText(""+MaxRecord);
                   System.out.println("Current Record " +CurrentRecord);
                   System.out.println("Max Record " +MaxRecord);
              //--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
              if(readOrder() != null){
                   orderDetails = (CustOrdObject[]) readOrder();
                   //CurrentRecord--;
                   //System.out.println("Current Rec Here"+CurrentRecord);
                   if(orderDetails[CurrentRecord] == null){
                        System.err.println("CustomerOrderObj 1 is null !!");
                   }else{
                        System.err.println("CustomerOrderObj 1 is  not null !!");
                   if(orderDetails[CurrentRecord].getInnerCustOrdObj() == null){
                        System.err.println("InnerCustomerOrderObj is null !!");
                   }else{
                        System.err.println("InnerCustomerOrderObj is  not null !!");
                   innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
                   MaxItems = orderDetails[CurrentRecord].getMaxItems();
                   if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
                        externalnextbtn.setEnabled(true);
                        externalprevbtn.setEnabled(true);
                   if(CurrentRecord >= MaxRecord){
                        externalnextbtn.setEnabled(false);
                   getFieldText(CurrentRecord);
                   getInnerFieldText(MaxItems);
              }else{
                   orderDetails[CurrentRecord] = new CustOrdObject();
                   currentItem = 1;
              return mainframe;
         //--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
         public JPanel createCustOrdDetailsTitle(){
              createTitlePanel();
              titlepanel.setBackground(TxtfontColor);
              label.setText("- Customer Order Details -");
              labelpanel.setBackground(TxtfontColor);
              label.setForeground(Color.white);
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor) ;
              buttonpanel.add(createReturnToMainMenuButton());
              titlepanel.add(labelpanel, BorderLayout.WEST);
              titlepanel.add(buttonpanel, BorderLayout.EAST);
              return titlepanel;
         public JPanel createCustOrdDetailsMainPanel(){
              createmainpanel();
              mainpanel.setBackground(TxtfontColor);
              mainpanel.setLayout(new BorderLayout());          
              mainpanel.setBorder(BorderFactory.createTitledBorder(""));
              mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
              mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
              mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
              mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
              mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
              return mainpanel;
         public JPanel createInnerTopPanel(){
              innertoppanel = new JPanel(new GridBagLayout());
              innertoppanel.setBackground(TxtfontColor);
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              CustIDLbl = new JLabel("Customer ID");
              CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustIDLbl.setFont(font);
              CustIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innertoppanel.add(CustIDLbl, GBC);     
              CustIDTxt = new JTextField(20);
              CustIDTxt.setEditable(true);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innertoppanel.add(CustIDTxt, GBC);
              GBC.gridx = 3;
              GBC.gridy = 1;
              innertoppanel.add(Box.createHorizontalStrut(220), GBC);
              OrderedDateLbl = new JLabel("Order Date");
              OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              OrderedDateLbl.setFont(font);
              OrderedDateLbl.setForeground(LblfontColor);
              GBC.gridx = 4;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateLbl, GBC);     
              //Get today's date
              Date todaydate = new Date();
              OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
              OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
              OrderedDateTxt.setEditable(false);
              GBC.gridx = 5;
              GBC.gridy = 1;
              innertoppanel.add(OrderedDateTxt, GBC);
              CustOrderIDLbl = new JLabel("Customer Order ID");
              CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              CustOrderIDLbl.setFont(font);
              CustOrderIDLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDLbl, GBC);
              CustOrderIDTxt = new JTextField(20);
              //CustOrderIDTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innertoppanel.add(CustOrderIDTxt, GBC);
              return innertoppanel;
         public JPanel createInnerCenterPanel(){
              innercenterpanel = new JPanel(new GridBagLayout());
              innercenterpanel.setBackground(TxtfontColor);
              innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              ItemNumberLbl = new JLabel("Item Number");
              ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              ItemNumberLbl.setFont(font);
              ItemNumberLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberLbl, GBC);     
              ItemNumberTxt = new JTextField(20);
              GBC.gridx = 2;
              GBC.gridy = 1;
              innercenterpanel.add(ItemNumberTxt, GBC);
              UnitPriceLbl = new JLabel("Unit Price");
              UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              UnitPriceLbl.setFont(font);
              UnitPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceLbl, GBC);     
              UnitPriceTxt = new JTextField(20);
              //UnitPriceTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 2;
              innercenterpanel.add(UnitPriceTxt, GBC);
              QuantityReqLbl = new JLabel("Quantity Required");
              QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              QuantityReqLbl.setFont(font);
              QuantityReqLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqLbl, GBC);     
              QuantityReqTxt = new JTextField(20);
              //QuantityReqTxt.setEditable(false);
              GBC.gridx = 2;
              GBC.gridy = 3;
              innercenterpanel.add(QuantityReqTxt, GBC);
              TotPriceLbl = new JLabel("Total Price");
              TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              TotPriceLbl.setFont(font);
              TotPriceLbl.setForeground(LblfontColor);
              GBC.gridx = 1;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceLbl, GBC);     
              TotPriceTxt = new JTextField(20);
              TotPriceTxt.setEditable(false);
              TotPriceTxt.addFocusListener(new FocusAdapter(){
                   public void focusGained(FocusEvent evt){
                        TotPriceTxt.setText(""+Integer.parseInt(UnitPriceTxt.getText())*Integer.parseInt(QuantityReqTxt.getText()));
              GBC.gridx = 2;
              GBC.gridy = 4;
              innercenterpanel.add(TotPriceTxt, GBC);
              return innercenterpanel;
         public JPanel createInnerBottomPanel(){
              innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
              innerbottompanel.setBackground(TxtfontColor);
              //Setting Font Type and Size
              Font font = new Font("Arial", Font.BOLD, 11);
              GrandTotLbl = new JLabel("Grand Total");
              GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
              GrandTotLbl.setFont(font);
              GrandTotLbl.setForeground(LblfontColor);
              innerbottompanel.add(GrandTotLbl);
              innerbottompanel.add(Box.createHorizontalStrut(30));
              GrandTotTxt = new JTextField(20);
              innerbottompanel.add(GrandTotTxt);
              return innerbottompanel;
         public JPanel createInnerRightPanel(){
              innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerrightpanel.setBackground(TxtfontColor);
              innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
              innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerrightpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalnextbtn = new JButton(createNextButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getInnerFieldText(currentItem);
                        internalprevbtn.setEnabled(true);
                        if(currentItem < MaxItems){
                             ++currentItem;
                             orderDetails[CurrentRecord].getInnerCustOrdObj();
                             setInnerFieldText(currentItem);
                             System.out.println("Current Item" + currentItem);
                        if(currentItem == MaxItems){
                             internalnextbtn.setEnabled(false);
              innerrightpanel.add(internalnextbtn, GBC);
              return innerrightpanel;
         public JPanel createInnerLeftPanel(){
              innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              innerleftpanel.setBackground(TxtfontColor);
              innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
              innerleftpanel.setForeground(Color.BLACK);
              innerleftpanel.setLayout(new GridBagLayout());          
              GridBagConstraints GBC = new GridBagConstraints();
              GBC.fill = GridBagConstraints.HORIZONTAL;
              internalprevbtn = new JButton(createPreviousButtonIcon());
              GBC.gridx = 1;
              GBC.gridy = 1;
              internalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getInnerFieldText(currentItem);
                        internalnextbtn.setEnabled(true);
                        if(currentItem == 1){
                             internalprevbtn.setEnabled(false);
                        if(currentItem > 0){
                             --currentItem;
                             orderDetails[CurrentRecord].getInnerCustOrdObj();
                             setInnerFieldText(currentItem);
                             System.out.println("Current Item" + currentItem);
              innerleftpanel.add(internalprevbtn, GBC);
              return innerleftpanel;
         public JPanel createCustOrdDetailsButtons(){
              createbuttonpanel();
              buttonpanel.setBackground(TxtfontColor);
              externalprevbtn = new JButton(createPreviousButtonIcon());
              externalprevbtn.addActionListener(new ActionListener(){
                   public void  actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalnextbtn.setEnabled(true);
                        if(CurrentRecord == 1){
                             externalprevbtn.setEnabled(false);
                        if(CurrentRecord > 0){
                             --CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println("Current Record " + CurrentRecord);//Checking RECORD_NUM
              buttonpanel.add(externalprevbtn);
              addrecordbtn = new JButton("Add Record", createAddButtonIcon());
              addrecordbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             MaxRecord = readRecordNumber();
                             MaxRecord++;
                             CurrentRecord = MaxRecord;
                             orderDetails[CurrentRecord] = new CustOrdObject();
                             writeRecordNumber(MaxRecord);
                             MaxItems = 1;
                             innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             CustIDTxt.setText("");
                             CustOrderIDTxt.setText(""+MaxRecord);
                             //Get today's date
                             Date todaydate = new Date();
                             OrderedDateTxt.setText(""+simpleDF.format(todaydate));
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             GrandTotTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             externalnextbtn.setEnabled(false);
                             externalprevbtn.setEnabled(true);
                             System.out.println(MaxRecord);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(addrecordbtn);
              savebtn = new JButton("Save Data", createSaveButtonIcon());
              savebtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        setFieldText(CurrentRecord);
                        setInnerFieldText(MaxItems);
                        writeOrder();
                        writeRecordNumber(MaxRecord);
                        System.out.println(CurrentRecord);
                        System.out.println(MaxRecord);
              buttonpanel.add(savebtn);
              java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
              ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
              additemreqbtn = new JButton("Add Item", AddRowIcon);
              additemreqbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        try{
                             //--<BEGINNING>--Clear Fields-------------------------------------------------------//
                             ItemNumberTxt.setText("");
                             UnitPriceTxt.setText("");
                             QuantityReqTxt.setText("");
                             TotPriceTxt.setText("");
                             //--<END>--Clear Fields-------------------------------------------------------------//
                             //CurrentRecord = MaxRecord;
                             MaxItems++;
                             innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
                             System.out.println("Max Items "+MaxItems);
                             currentItem = MaxItems;
                             orderDetails[CurrentRecord].setMaxItems(MaxItems);
                             ///setInnerFieldText(currentItem);
                             internalnextbtn.setEnabled(false);
                             internalprevbtn.setEnabled(true);
                        } catch(Exception ec){ec.printStackTrace();}
              buttonpanel.add(additemreqbtn);
              externalnextbtn = new JButton(createNextButtonIcon());
              externalnextbtn.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        getFieldText(CurrentRecord);
                        externalprevbtn.setEnabled(true);
                        if(CurrentRecord < MaxRecord){
                             ++CurrentRecord;
                             setFieldText(CurrentRecord);
                             System.out.println(CurrentRecord);//Checking RECORD_NUM
                        if(CurrentRecord == MaxRecord){
                             externalnextbtn.setEnabled(false);
              buttonpanel.add(externalnextbtn);
              gotorecordbtn = new JButton("Go To Record", createGotoButtonIcon());
              gotorecordbtn.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt){
                         * The text from the GotorecordTxt textfield will be taken and assigned
                         * to a temporary integer variable called Find. 
                        int Find = Integer.parseInt(CustOrderIDTxt.getText());
                        for(int j=1; j <= MaxRecord; j++){
                              * Using a for loop, each record can be read using the readCustRecord
                              * method.
                             getFieldText(j);
                              * An if condition is utilized to check whether the temporary stored variable, Find,
                              * matches a field in a record. If this record is found, then using the RecordExists
                              * which was declared at the top, either a true or false statement can be assigned
                              * If the record exists, then a true statement will be assigned, if not a false
                              * statement will be assigned.
                             if(orderDetails[j].getCustOrderID() == Find){
                                  RecordExists = true;
                                  break;
                             }else{
                                  RecordExists = false;
                        if(RecordExists == false){
                              * If the RecordExists is assigned a false statement, then a message will be
                              * displayed to show that the record does not exist.
                             JOptionPane.showMessageDialog(null, "Record Does Not Exist!", "Error Message", JOptionPane.ERROR_MESSAGE, createErrorIcon());
                        }else{
                             getFieldText(Find);
              buttonpanel.add(gotorecordbtn);
              return buttonpanel;
         //TODO
         public void setFieldText(int orderID){//TODO
              orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
              orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
              orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
              orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
              orderDetails[orderID].setMaxItems(MaxItems);
              setInnerFieldText(currentItem);
              orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
         public void setInnerFieldText(int currentItem){//TODO
              innerCustOrdObj[currentItem] = new InnerCustOrdObject();
              innerCustOrdObj[currentItem].setMaxItems(MaxItems);
              innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
              innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
              innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
              innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
         public void getFieldText(int orderID){
              CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
              CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
              OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());          
              currentItem = orderDetails[orderID].getMaxItems();
              orderDetails[orderID].getInnerCustOrdObj();
              System.err.println("currentItem" + currentItem);
              //getInnerFieldText(currentItem);
              GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
         public void getInnerFieldText(int currentItem){
              ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
              UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
              QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
              TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
         public void writeOrder(){//TODO
              try {
                   objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
                   objOut.writeObject(orderDetails);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              } catch (IOException e) {
                   e.printStackTrace();
         public Object readOrder(){
              Object temporaryObj;
              try{
                   objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
                   temporaryObj = objIn.readObject();               
                   CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
                   /*               System.out.println("Outer: "+blah[1].getCustID());
                   InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
                   System.out.println("Inner: "+whee[1].getItemNumber());*/
                   objIn.close();
                   System.out.println("Read Worky!");
                   return temporaryObj;
              }catch(Exception e){
                   e.printStackTrace();
                   System.out.println("Read No Worky!");
                   return null;
         public void writeRecordNumber(int MaxRecord){
              try{
                   objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
                   objOut.writeObject(MaxRecord);
                   System.out.println("WORKING!");
                   objOut.flush();
                   objOut.close();
              }catch(Exception e){e.printStackTrace();}
         public int readRecordNumber() {
              try {
                   objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
                   int temporaryObj = Integer.parseInt(objIn.readObject().toString());
                   objIn.close();
                   System.out.println("Read Number Worky!");
                   return temporaryObj;
              } catch (Exception e) {
                   e.printStackTrace();
                   System.out.println("Read Number No Worky!");
                   return -1;
    }Message was edited by:
    Kilik07

  • Problem in Writing to/Reading from a Binary file placed in a Loop

    Hi
    As you can see in the attahced image, I attempt to write a set of 2*202 data in each iteration of the loop of the loop, yet when I try to read the data (in the second picture) I only get the first (or last, I assume) set of data, up to index 202. I needed to read two set (X, Y) of 402 valuse. So, I am not sure if I am making a  mistake in wrting to the file or reading from it! 
    I really appreciate it if someone could suggest a solution
    Ashakn
     

    You are only reading the first.  In your read, set your number to read to -1.  That will tell the Read Binary File to read all of the data instead just a single set.

  • Problem with writing SQL Select statement.

    Table structure
    Temp_tab
    App_no          Number
    Cln_no          Number
    Example data
    APP_NO          CLN_NO
    1          1
    1          2
    1          4
    2          3
    3          5
    3          7
    3          6
    4          9
    4          8
    7          13
    Output
    APP_NO          CLN_NO
    1          1,2,4
    2          3
    3          5,7,6
    4          9,8
    7          13
    You should not create any function to get this output. It should be a Select statement. You can use 8i features. You can exclude the comma between the values instead of that you can put spaces. No hard coding.
    Thank you in advance.
    Samujjwal Basu

    Table structure
    Temp_tab
    App_no          Number
    Cln_no          Number
    Example data
    APP_NO          CLN_NO
    1          1
    1          2
    1          4
    2          3
    3          5
    3          7
    3          6
    4          9
    4          8
    7          13
    Output
    APP_NO          CLN_NO
    1          1,2,4
    2          3
    3          5,7,6
    4          9,8
    7          13
    You should not create any function to get this output. It should be a Select statement. You can use 8i features. You can exclude the comma between the values instead of that you can put spaces. No hard coding.
    Thank you in advance.
    Samujjwal Basu

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • READ statement problem-URGENT.

    hai experts,
    I am facing problem with read statement.
    <b>read table itab with key f1 = '10'."it works.</b>
    But,
    now i store value '<b>10'</b> in variable <b>f</b> and use it as follows.
    <b>read table itab with key f1 = f."it isn't working</b>.
    My requirement is as above.I have to read a particular record from a internal table with key value stored in a variable ,key should not be  hardcoded.
    Do any one have any idea abt this.
    Plz, help me. Its very urgent.
    Thanks & Regards.
    Shivaa

    Hi Shiva
                That isn't a way to access the internal table via variable. Please refer transaction ABAPDOCU to know more information querying internal table(or transparent table) via a Variable and many more..
    <b> Helpfull: Reward points </b>
    Thanks and Kind Regards
    Mohan

  • Problem in read statement

    hi,
    my code is ;
    select vbeln audat kunnr auart
            from vbak
            into table  t_vbak2
            for all entries in t_vbfa2
            where vbeln = t_vbfa2-vbelv
            and audat in r_daterange
            and kunnr = partner_number.
            if not t_vbak2[] is initial.
              sort t_vbak2 by vbeln audat auart.
            endif.
    now if i use read statement :
    read table t_vbak2 into wa_vbak2
            with key  vbeln = wa_vbfa1-vbelv
                      audat in r_daterange
                      kunnr = partner_number binary search.
    i get a syntax error.
    can any one help me with this..
    Thanks,
    Challa.

    You can't use the IN operator in your READ statement, only  =  as you are trying to read with key.  In your case, you must use the LOOP statement.
    Loop at t_vbak2 into wa_vbak2
              where vbeln = wa_vbfa1-vbelv
                 and audat in R_daterange
                 and kunnr = Partner_Number.
    * Do whatever you need to do
    Exit.   " This is so you only read one record.
    Endloop.
    Regards,
    RIch Heilman

  • Problem in using read statement.

    i am using the read statement as follows :
    read table tekpo with key werks = '1001'.
    it is not reading the corresponding record.
    though it reads or not it is returning the sy-subrc value 0.
    plz let me know why it is happening as soon as possible.
    points will be awarded.

    Hi Srinivas rao,
    You can use this example program and make the changes in your program as well:
    DATA: BEGIN OF LINE,
             COL1 TYPE I,
             COL2 TYPE I,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
      WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
      WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
             1         1
             2       100
             4        16
    I think you have satisfied.
    Thanks and regards
    Vipin Das

  • READ statement problem

    TYPES : BEGIN OF itab,
             matnr LIKE eban-matnr,
             menge LIKE eban-menge,
           END OF itab.
    TYPES : BEGIN OF itab2,
              maktx LIKE makt-maktx,
            END OF itab2.
    DATA : it_eban TYPE STANDARD TABLE OF itab.
    DATA : it_makt TYPE STANDARD TABLE OF itab2.
    DATA : wa_eban TYPE itab.
    DATA : wa_makt TYPE itab2.
    START-OF-SELECTION.
      SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
                            it_eban FROM eban.
      SELECT maktx INTO  CORRESPONDING FIELDS OF TABLE
                           it_makt from makt.
    PERFORM display TABLES it_eban it_makt.
    FORM display TABLES eban_tab makt_tab.
    LOOP AT eban_tab INTO wa_eban.
      WRITE :/ wa_eban-matnr, wa_eban-menge.
      READ TABLE makt_tab with key matnr = wa_eban-matnr.
      "here I'm getting error like
      "the specified type has no structure and therefore no component called "MATNR"
      "How can I write READ statement here to read makt_tab.
    ENDLOOP.
    ENDFORM.

    Try that
    TYPES : BEGIN OF itab,
             matnr LIKE eban-matnr,
             menge LIKE eban-menge,
           END OF itab.
    TYPES : BEGIN OF itab2,
              <b>matnr like mara-matnr,</b>
              maktx LIKE makt-maktx,
            END OF itab2.
    DATA : it_eban TYPE STANDARD TABLE OF itab.
    DATA : it_makt TYPE STANDARD TABLE OF itab2.
    DATA : wa_eban TYPE itab.
    DATA : wa_makt TYPE itab2.
    START-OF-SELECTION.
      SELECT matnr menge INTO CORRESPONDING FIELDS OF TABLE
                            it_eban FROM eban.
      SELECT <b>matnr</b> maktx INTO  CORRESPONDING FIELDS OF TABLE
                           it_makt from makt.
    PERFORM display TABLES it_eban it_makt.
    FORM display TABLES eban_tab makt_tab.
    LOOP AT eban_tab INTO wa_eban.
      WRITE :/ wa_eban-matnr, wa_eban-menge.
      READ TABLE makt_tab into <b>wa_makt</b> with key matnr = wa_eban-matnr.
      "here I'm getting error like
      "the specified type has no structure and therefore no component called "MATNR"
      "How can I write READ statement here to read makt_tab.
    ENDLOOP.
    ENDFORM.
    Message was edited by:
            Jacek Slowikowski

  • Read statement giving problem

    Dear Experts,
    I am making monthly consumption report, In which i am getting monthly data column wise for different month , here firstly i am fetching header mblnr  date according to date from mkpf then i am fetching data from mseg.....
    I have same mblnr in both tables..... Now i am using read statement like this.......
    sort lt_mkpf by mblnr.
    SORT lt_mseg BY mblnr.
    LOOP AT lt_mkpf INTO lw_mkpf.
    READ TABLE lt_mseg INTO lw_mseg WITH KEY mblnr = lw_mkpf-mblnr
                                                mjahr = lw_mkpf-mjahr
                                                        BINARY SEARCH.
    When I am debugging i am getting data in lw_mkpf but sy-subrc = 4 is coming  and getting wrong data in final table by using these above statements..........
    where as if i am using loop like this:
    SORT lt_mkpf BY mblnr.
    SORT lt_mseg BY mblnr.
    LOOP AT lt_mkpf INTO lw_mkpf.
    v_mkpf = lw_mkpf-mblnr.
    LOOP AT lt_mseg INTO lw_mseg WHERE mblnr EQ v_mkpf.
    with this i am getting right data........ But it takes lot of time to execute..........
    Can you please guide me am i using read statement by wrong method. which one is the correct method which one shoul be used.........

    Hello Shelly,
    To solve the issue of read table being failed, Sort the internal table by mblnr and mjahr. say sort lt_mseg by mblnr mjahr but read the internal table mseg will give you only one data. What about the other line items. MSEG is material document line item table. So for one record in MKPF there can be more than one record in MSEG. So to consider all the line items, you need to loop on the MSEG internal table instead of read table.
    LOOP AT lt_mkpf INTO lw_mkpf.
    v_mkpf = lw_mkpf-mblnr.
    LOOP AT lt_mseg INTO lw_mseg WHERE mblnr EQ v_mkpf.
    This statement will take time and create performance issue. So rewrite the statement as
    LOOP AT lt_mseg INTO lw_mseg.
    read table lt_mkpf with key lw_mkpf binary search.
    Regards
    Farzan

  • ABAP Loop/read statement

    Hello All-
    I'm writing a loop and a read statement between two tables.  What I am trying to do is flag certain records that exsist in one table but NOT in the other.  For example, I have table /BIC/PG_ICODE  which is the P table for Global ICODE and I also have a "z" table which hold all "valid" icodes. My logic is as follows: If an icode exsists in the P table AND also exsists in the "Z" table then I don't want to do anything with this record. But if it exsists in the P table but NOT in the "z" table then I want to insert this ICODE into an E_T_RANGE table.  What I have done here is created a FM which will be called in a QUERY that I have built.  The problem is that after the code is executed and I look at the records in the E_T_RANGE table, I find some icodes that exsist both in the P table and "z" table.  The E_T_RANGE table should only contain icodes that exsist in the P table and NOT the "z" table. Can someone please have a look at my code and tell me what I am doing wrong?
    DATA : L_S_RANGE LIKE E_T_RANGE,
           IT_ICODE TYPE standard table of /BIC/TG_ICODE,
           IT_PTABLE TYPE standard table of /BIC/PG_ICODE,
           it_ZVALID_ICODES TYPE standard table of   ZVALID_ICODES,
           wa_ZVALID_ICODES TYPE ZVALID_ICODES,
           l_sign type c value 'I',
           wa type /BIC/TG_ICODE,
           wa2 type /BIC/PG_ICODE.
    SELECT /BIC/G_ICODE FROM /BIC/PG_ICODE INTO
        CORRESPONDING FIELDS OF table IT_PTABLE where /BIC/G_ICODE like
    'I%'.
    sort IT_PTABLE by /BIC/G_ICODE.
    SELECT /BIC/G_ICODE FROM ZVALID_ICODES INTO
        CORRESPONDING FIELDS OF table IT_ZVALID_ICODES.
    sort IT_ZVALID_ICODES by /BIC/G_ICODE.
    loop at IT_PTABLE into wa2.
    read table IT_ZVALID_ICODES with key
    /BIC/G_ICODE = wa2-/BIC/G_ICODE into wa_ZVALID_ICODES.
    if sy-subrc ne 0.
            L_S_RANGE-LOW = wa_ZVALID_ICODES-/BIC/G_ICODE.
            L_S_RANGE-SIGN = l_sign.
            L_S_RANGE-OPT = 'EQ'.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
          APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    endloop.
    ENDFUNCTION.

    Hi try the following code...
    DATA : L_S_RANGE LIKE E_T_RANGE,
    IT_ICODE TYPE standard table of /BIC/TG_ICODE,
    IT_PTABLE TYPE standard table of /BIC/PG_ICODE,
    it_ZVALID_ICODES TYPE standard table of ZVALID_ICODES,
    wa_ZVALID_ICODES TYPE ZVALID_ICODES,
    l_sign type c value 'I',
    wa type /BIC/TG_ICODE,
    wa2 type /BIC/PG_ICODE.
    SELECT /BIC/G_ICODE FROM /BIC/PG_ICODE INTO
    CORRESPONDING FIELDS OF table IT_PTABLE where /BIC/G_ICODE like
    'I%'.
    sort IT_PTABLE by /BIC/G_ICODE.
    DELETE ADJACENT DUPLICATES FROM IT_PTABLE.
    SELECT /BIC/G_ICODE FROM ZVALID_ICODES INTO
    CORRESPONDING FIELDS OF table IT_ZVALID_ICODES.
    sort IT_ZVALID_ICODES by /BIC/G_ICODE.
    DELETE ADJACENT DUPLICATES FROM IT_ZVALID_ICODES.
    loop at IT_PTABLE into wa2.
    read table IT_ZVALID_ICODES with key
    /BIC/G_ICODE = wa2-/BIC/G_ICODE into wa_ZVALID_ICODES
             binary search.
    if sy-subrc ne 0.
    L_S_RANGE-LOW = wa_ZVALID_ICODES-/BIC/G_ICODE.
    L_S_RANGE-SIGN = l_sign.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    endloop.
    sort e_t_range.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
    ENDFUNCTION.
    Regards,
    Suresh Datti

  • Problem with the control break statement  - AT END OF

    data : IT_DATA   TYPE STANDARD TABLE OF /BIC/OH0SPA_OHD WITH  KEY /B28/S_D1DVOX5 ,
    FIELD-SYMBOLS :   <ls_data> TYPE any,
    SELECT * FROM (c_open_hub) INTO TABLE IT_DATA .
    *IF sy-subrc = 0.
    *ENDIF.
    Create the GUID for header
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        EV_GUID_32 = LV_GUID.
    TRY.
        CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
          EXPORTING
            IM_GUID_C = LV_GUID
          IMPORTING
            EX_VALUE  = LV_UUID.
      CATCH CX_GDT_CONVERSION  INTO go_exc .
        gv_text = go_exc->get_text( ).
    Application log for errors
        IF gv_text IS NOT INITIAL.
          PERFORM add_msg_to_log CHANGING lt_return.
          CALL FUNCTION '/SPA/APPL_LOG'
            EXPORTING
              LV_OBJECT    = '/SPA/APPL'
              LV_SUBOBJECT = '/SPA/ESOA'
              IT_RETURN    = lt_return.
        ENDIF.
    ENDTRY.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-ID-CONTENT = LV_GUID.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-UUID-CONTENT = LV_UUID.
    SELECT * FROM DD03T INTO TABLE lt_dd03t WHERE TABNAME = c_open_hub AND DDLANGUAGE = 'E' AND AS4LOCAL = 'A'.
    *IF sy-subrc = 0.
    *ENDIF.
    Sort the delta table
    SORT it_data.
    populate the output structure
    LOOP AT IT_DATA ASSIGNING <ls_data>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_keyfigures.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_keyfigures>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_signdata.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_signdata>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_bbtype.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_bbtype>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_customer.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_customer>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_product.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_product>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_territory.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_territory>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_time.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_time>.
      CASE <l_keyfigures>.
        WHEN c_sd.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-start_date = lv_date.
        WHEN c_ed.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-end_date = lv_date.
        WHEN c_uplift.
          LS_PRODUCT_KF-ID-CONTENT = c_uplift_qyts.
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
        WHEN OTHERS.
        PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
         ls_period_term-start_date = lv_date.
    Get week
         CALL FUNCTION 'DATE_GET_WEEK'
           EXPORTING
             DATE = LS_PERIOD_TERM-START_DATE
           IMPORTING
             WEEK = LV_WEEK.
    append Keyfigure
          LS_PRODUCT_KF-ID-CONTENT = <l_keyfigures> .
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
    append tradespend
          SELECT SINGLE * FROM /SPA/SPEND_MAP INTO CORRESPONDING FIELDS OF LV_/SPA/SPEND_MAP
                 WHERE KEY_FIGURE = <l_keyfigures>.
          IF sy-subrc = 0.
            LS_TRADE_SPEND-TYPE_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_TYPE.
            LS_TRADE_SPEND-CATEGORY_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_CATEGORY.
            LS_TRADE_SPEND-METHOD_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_METHOD.
            APPEND LS_TRADE_SPEND TO LT_TRADE_SPEND.
          else.
            lv_flg = 'X'.
          ENDIF.
      ENDCASE.
    AT END OF /B28/S_D1DVOX5.   "
        SELECT SINGLE * FROM  /SPA/SO_TER_MAP INTO LS_/SPA/SO_TER_MAP WHERE TERRITORY = <l_territory>.
        IF sy-subrc = 0 AND lv_flg IS INITIAL.
    Create the GUID for TP's
          CALL FUNCTION 'GUID_CREATE'
            IMPORTING
              EV_GUID_32 = LV_GUID_MESSAGE.
          TRY.
              CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
                EXPORTING
                  IM_GUID_C = LV_GUID_MESSAGE
                IMPORTING
                  EX_VALUE  = LV_UUID_MESSAGE.
            CATCH CX_GDT_CONVERSION .
          ENDTRY.
    populate the product
          LS_PRODUCT-ID-CONTENT = <l_product>.
          LS_CUSTOMER-ID-CONTENT = '300022'.
          LS_CUSTOMER-ROLE_CODE = '00000105'.
          LS_PRODUCT-KEY_FIGURE = LT_PRODUCT_KF.
          APPEND LS_PRODUCT TO LT_PRODUCT.
          APPEND LS_CUSTOMER TO LT_CUSTOMER.
          APPEND LS_DESCRIPTION TO LT_DESCRIPTION.
          APPEND LS_PERIOD_TERM TO LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-ORGANISATIONAL_CENTRE_ID = LS_/SPA/SO_TER_MAP-SALES__ORG.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-DISTRIBUTION_CHANNEL_CODE-CONTENT = LS_/SPA/SO_TER_MAP-DIST_CHANNEL.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_ACCOUNT-CUSTOMER_INTERNAL_ID = <l_customer>.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_PROFILE_GROUP_CODE-CONTENT = '4TPM'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TYPE_CODE-CONTENT = 'Z002'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-UPLIFT_ACTIVE_INDICATOR = 'X'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-MARKETING_PROJECT_PLANNING_PRO = '5'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-CALENDAR_UNIT_CODE = 'WEE'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TRADE_SPEND = LT_TRADE_SPEND.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PARTY = LT_CUSTOMER.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-DESCRIPTION = LT_DESCRIPTION.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-PRODUCT = LT_PRODUCT.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PERIOD_TERM = LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-ID-CONTENT = LV_GUID_MESSAGE.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-UUID-CONTENT = LV_UUID_MESSAGE.
          LS_/SPA/REPORT_TAB-SPA_TP_ID = <l_bbtype>.
          LS_/SPA/REPORT_TAB-MESSAGE_ID = LV_GUID_MESSAGE.
          LS_/SPA/REPORT_TAB-CREATE_DATE = SY-DATUM.
          INSERT /SPA/REPORT_TAB FROM LS_/SPA/REPORT_TAB.
          APPEND LS_TRADE_PROMOTION TO LT_TRADE_PROMOTION.
          OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-TRADE_PROMOTION_CRMCREATE_REQU = LT_TRADE_PROMOTION.
          CLEAR : LT_DESCRIPTION, LT_PERIOD_TERM,LT_CUSTOMER, LT_PRODUCT, LT_PRODUCT_KF, LT_TRADE_SPEND,LS_/SPA/HEADER_TAB.
        ENDIF.
        CLEAR lv_flg .
      ENDAT.
    ENDLOOP.
    My problem is AT-END OF STATEMENT IS executing for each and every record of same /B28/S_D1DVOX5.
    Please help me from this problem

    Hello,
    First of all to know clearly about AT END.
    Let's say In IT_DATA fields are F1 F2 F3 /B28/S_D1DVOX5 F5.
    then AT END of /B28/S_D1DVOX5 means for each new value of this field at the end it will trigger.
    Please ensure thet IT_DATA is sorted by this field and then used Control break.
    Thanks,
    Pramod

  • Problems with explain plan and statement

    Hi community,
    I have migrated a j2ee application from DB2 to Oracle.
    First some facts of our application and database instance:
    We are using oracle version 10.2.0.3 and driver version 10.2.0.3. It runs with charset Unicode 3.0 UTF-8.
    Our application is using Tomcat as web container and jboss as application server. We are only using prepared statements. So if I talk about statements I always mean prepared statements. Also our application is setting the defaultNChar property to true because every char and varchar field has been created as an nchar and nvarchar.
    We have some jsp sites that contains lists with search forms. Everytime I enter a value to the form that returns a filled resultset, the lists are performing great. But everytime I enter a value that returns an empty resultset, the lists are 100 times slower. The jsp sites are running in the tomcat environment and submitting their statements directly to the database. The connections are pooled by dbcp. So what can cause this behaviour??
    To anaylze this problem I started logging all statements and filled-in search field values and combinations that are executed by the lists described above. I also developed a standalone helper tool that reads the logged statements, executes them to the database and generates an explain plan for every statement. But now there appears a strange situation. Every statement, that performs really fast within our application, is now executed by the helper tool extremely slow. So I edited some jsp pages within our application to force an explain plan from there (tomcat env). So when I'm executing the same statement I'm getting with the exactly same code two completely different explain plans.
    First the statement itself:
    select LINVIN.BBASE , INVINNUM , INVINNUMALT , LINVIN.LSUPPLIERNUM , LSUPPLIERNUMEXT , LINVIN.COMPANYCODE , ACCOUNT , INVINTXT , INVINSTS , INVINTYP , INVINDAT , RECEIPTDAT , POSTED , POSTINGDATE , CHECKCOSTCENTER , WORKFLOWIDEXT , INVINREFERENCE , RESPONSIBLEPERS , INVINSUM_V , INVINSUMGROSS_V , VOUCHERNUM , HASPOSITIONS , PROCESSINSTANCEID , FCURISO_V , LSUPPLIER.AADDRLINE1 from LINVIN, LSUPPLIER where LINVIN.BBASE = LSUPPLIER.BBASE and LINVIN.LSUPPLIERNUM = LSUPPLIER.LSUPPLIERNUM and LINVIN.BBASE = ? order by LINVIN.BBASE, INVINDAT DESC
    Now the explain plan from our application:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 101 | 28583 | 55 (0)| 00:00:01 |
    | 1 | NESTED LOOPS | | 101 | 28583 | 55 (0)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| 25 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | LINV_INVDAT | 101 | | 1 (0)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 1 | 148 | 1 (0)| 00:00:01 |
    |* 5 | INDEX UNIQUE SCAN | PK_177597 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("LINVIN"."BBASE"=:1)
    filter("LINVIN"."BBASE"=:1)
    5 - access("LSUPPLIER"."BBASE"=:1 AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
    Now the one from the standalone tool:
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 93773 | 25M| | 12898 (1)| 00:02:35 |
    | 1 | SORT ORDER BY | | 93773 | 25M| 61M| 12898 (1)| 00:02:35 |
    |* 2 | HASH JOIN | | 93773 | 25M| 2592K| 7185 (1)| 00:01:27 |
    | 3 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 16540 | 2390K| | 332 (0)| 00:00:04 |
    |* 4 | INDEX RANGE SCAN | LSUPPLIER_HAS_BASE_FK | 16540 | | | 11 (0)| 00:00:01 |
    | 5 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| | 6073 (1)| 00:01:13 |
    |* 6 | INDEX RANGE SCAN | LINVOICE_BMDT_FK | 93709 | | | 84 (2)| 00:00:02 |
    Predicate Information (identified by operation id):
    2 - access("LINVIN"."BBASE"="LSUPPLIER"."BBASE" AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
    4 - access("LSUPPLIER"."BBASE"=:1)
    6 - access("LINVIN"."BBASE"=:1)
    The size of the tables are: LINVIN - 383.692 Rows, LSUPPLIER - 115.782 Rows
    As you can see the one executed from our application is much faster than the one from the helper tool. So why picks oracle a completely different explain plan for the same statement? An why is a hash join much slower than a nested loop? Because If I'm right a nested loop should only be used when the tables are pretty small..
    I also tried to play with some parameters:
    I set optimizer_index_caching to 100 and optimizer_index_cost_adj to 30. I also changed optimizer_mode to FIRST_ROWS_100.
    I would really appreciated, if somebody can help me with this issue, because I'm really getting more and more distressed...
    Thanks in advance,
    Tobias
    Edited by: tobiwan on Sep 3, 2008 11:49 PM
    Edited by: tobiwan on Sep 3, 2008 11:50 PM
    Edited by: tobiwan on Sep 4, 2008 12:01 AM
    Edited by: tobiwan on Sep 4, 2008 12:02 AM
    Edited by: tobiwan on Sep 4, 2008 12:04 AM
    Edited by: tobiwan on Sep 4, 2008 12:06 AM
    Edited by: tobiwan on Sep 4, 2008 12:06 AM
    Edited by: tobiwan on Sep 4, 2008 12:07 AM

    tobiwan wrote:
    Hi again,
    Here ist the answer:
    The problem, because I got two different explain plans, was that the external tool uses the NLS sesssion parameters coming from the OS which are in my case "de/DE".
    Within our application these parameters are changed to "en/US"!! So if I'm calling in my external tool the java function Locale.setDefault(new Locale("en","US")) before connecting to the database the explain plans are finally equal.That might explain why you got two different execution plan, because one plan was obviously able to avoid a SORT ORDER BY operation, whereas the second plan required to run SORT ORDER BY operation, obviously because of the different NLS_SORT settings. An index by default uses the NLS_SORT = 'binary' order whereas ORDER BY obeys the NLS_SORT setting, which probably was set to 'GERMAN' in your "external tool" case. You can check the "NLS_SESSION_PARAMETERS" view to check your current NLS_SORT setting.
    For more information regarding this issue, see my blog note I've written about this some time ago:
    http://oracle-randolf.blogspot.com/2008/09/getting-first-rows-of-large-sorted.html
    Now let me make a guess why you observe the behaviour that it takes so long if your result set is empty:
    The plan avoiding the SORT ORDER BY is able to return the first rows of the result set very quickly, but could take quite a while until all rows are processed, since it requires potentially a lot of iterations of the loop until everything has been processed. Your front end probably by default only display the first n rows of the result set and therefore works fine with this execution plan.
    Now if the result set is empty, depending on your data, indexes and search criteria, Oracle has to work through all the data using the inefficient NESTED LOOP approach only to find out that no data has been found, and since your application attempts to fetch the first n records, but no records will be found, it has to wait until all data has been processed.
    You can try to reproduce this by deliberately fetching all records of a query that returns data and that uses the NESTED LOOP approach... It probably takes as long as in the case when no records are found.
    Note that you seem to use bind variables and 10g, therefore you might be interested that due to the "bind variable peeking" functionality you might potentially end up with "unstable" plans depending on the values "peeked" when the statement is parsed.
    For more information, see this comprehensive description of the issue:
    http://www.pythian.com/blogs/867/stabilize-oracle-10gs-bind-peeking-behaviour-by-cutting-histograms
    Note that this changes in 11g with the introduction of the "Adaptive Cursor Sharing".
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Problem in writing a query

    Dear all,
    I have a problem for writing a query,
    country: name,code,population.
    economy:country(code),gdp
    in the economy table i have gdp of each country, i calculated sum of the GDP of all countries and then half of it(50% of world GDP)
    then i should calculate the minimum population of the countries needed to have this 50% of GDP.
    here is what i wrote until now but i really don't have any more idea, if you help me i'll learn something.
    thank you.
    select e.country,c.population,e.gdp
    from country c
    join economy e
    on c.code=e.country
    order by e.gdp desc;
    set serveroutput on
    declare
    half_gdp_n number;
    begin
    select round(sum(gdp)/2) into half_gdp_n from economy;
    DBMS_OUTPUT.put_line(half_gdp_n);
    end;
      CREATE TABLE "intern"."ECONOMY" ("COUNTRY" CHAR(2), "GDP" NUMBER, "AGRICULTURE" NUMBER, "INDUSTRY" NUMBER, "SERVICES" NUMBER, "INFLATION" NUMBER)
       COMMENT ON COLUMN "intern"."ECONOMY"."COUNTRY" IS 'the country code'
       COMMENT ON COLUMN "intern"."ECONOMY"."GDP" IS 'gross domestic product (in million dollar)'
       COMMENT ON COLUMN "intern"."ECONOMY"."AGRICULTURE" IS 'percentage of agricultural sector of the GDP'
       COMMENT ON COLUMN "intern"."ECONOMY"."INDUSTRY" IS 'percentage of industrial sector of the GDP'
       COMMENT ON COLUMN "intern"."ECONOMY"."SERVICES" IS 'percentage of service sector of the GDP'
       COMMENT ON COLUMN "intern"."ECONOMY"."INFLATION" IS 'inflation rate (percentage, per annum)'
       COMMENT ON TABLE "intern"."ECONOMY"  IS 'economical information about the countries'
    REM INSERTING into intern.ECONOMY
    SET DEFINE OFF;
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ad',1900,null,null,null,4.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ae',63670,4,58.5,37.5,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('af',21500,60,20,20,10.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ag',750,3.9,19.2,76.8,0.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ai',112,4,18,78,2.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('al',17460,46.2,25.4,28.4,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('am',13650,22.9,36.1,41.1,3.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('an',2450,1,15,84,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ao',23170,8,67,25,43.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ar',483500,10.6,35.9,53.5,6.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('as',500,null,null,null,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('at',255900,2.3,30.8,66.9,1.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('au',611700,3.4,28.2,68.4,2.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('aw',1940,null,null,null,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('az',30010,14.1,45.7,40.2,4.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ba',26210,14.2,30.8,55,1.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bb',4569,6,16,78,-0.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bd',275700,21.2,27.1,51.7,6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('be',316200,1.3,25.7,73,1.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bf',15740,39.5,19.3,41.3,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bg',61630,11.5,30.1,58.4,6.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bh',13010,0.7,41,58.4,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bi',4001,48.1,19,32.9,8.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bj',8338,36.3,14.3,49.4,2.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bm',2330,1,10,89,3.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bn',6842,5,45,50,0.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bo',22330,13,28,59,4.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('br',1492000,10.1,38.6,51.3,7.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bs',5295,3,7,90,1.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bt',2900,45,10,45,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bw',15050,4,44,52,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('by',70500,11,36.4,52.6,17.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('bz',1778,17.7,15,67.3,2.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ca',1023000,2.3,26.4,71.3,1.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cd',42740,55,11,34,14);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cf',4248,55,20,25,3.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cg',2324,7.4,52,40.6,1.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ch',251900,1.5,34,64.5,0.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ci',24780,27.8,19.4,52.8,1.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ck',105,17,7.8,75.2,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cl',169100,6.3,38.2,55.5,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cm',30170,43.7,20.1,36.2,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cn',7262000,13.8,52.9,33.3,4.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('co',281100,13.4,32.1,54.5,5.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cr',37970,8.5,29.7,61.8,11.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cu',33920,6.6,25.5,67.9,3.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cv',600,12.1,21.9,66,1.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cy',15710,4.1,19.9,76,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('cz',172200,3.4,39.3,57.3,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('de',2362000,1,31,68,1.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('dj',619,3.5,15.8,80.7,2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('dk',174400,2.2,25.5,72.3,1.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('dm',384,18,24,58,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('do',55680,10.7,31.5,57.8,55);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('dz',212300,10.3,57.4,32.3,3.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ec',49510,8.7,30.5,60.9,2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ee',19230,4.1,28.9,67,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('eg',316300,17.2,33,49.8,9.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('eh',null,null,null,40,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('er',4154,12.4,25.9,61.7,10);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('es',937600,3.5,28.5,68,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('et',54890,47,12.4,40.6,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fi',151200,3.3,30.2,66.5,0.7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fj',5173,16.6,22.4,61,1.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fk',75,null,null,null,3.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fm',null,50,4,46,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fo',1000,27,11,62,5.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('fr',1737000,2.7,24.3,73,2.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ga',7966,7.4,46.7,45.9,1.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gd',440,7.7,23.9,68.4,2.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ge',14450,20.5,22.6,56.9,5.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gf',1551,null,null,null,1.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gg',2590,3,10,87,4.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gh',48270,34.3,24.2,41.4,13);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gi',769,null,null,null,1.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gl',1100,null,null,null,1.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gm',2799,26.8,14.5,58.7,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gn',19500,25,38.2,36.8,18);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gp',3513,15,17,68,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gq',1270,3,95.7,1.3,8.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gr',226400,7,22,71,2.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gt',59470,22.7,19.5,57.9,7.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gu',3200,7,15,78,0);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gw',1008,62,12,26,4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('gy',2899,38.3,19.9,41.8,4.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('hn',18790,12.7,32.1,55.3,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('hr',50330,8.2,30.1,61.7,2.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ht',12050,30,20,50,22);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('hu',149300,3.3,31.4,65.3,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('id',827400,14.6,45,40.4,6.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ie',126400,5,46,49,2.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('il',129000,2.8,37.7,59.5,0);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('im',2113,1,13,86,3.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('in',3319000,23.6,28.4,48,4.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('iq',54400,13.6,58.6,27.8,25.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ir',516700,11.2,40.9,48.7,15.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('is',9373,11.2,9.6,79.2,4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('it',1609000,2.3,28.8,68.9,2.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('je',3600,5,2,93,5.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('jm',11130,6.1,32.7,61.3,12.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('jo',25500,2.4,26,71.5,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('jp',3745000,1.3,24.7,74.1,-0.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ke',34680,19.3,18.5,62.4,9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kg',8495,38.5,22.8,38.7,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kh',26990,35,30,35,3.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ki',79,30,7,63,2.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('km',441,40,4,56,3.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kn',339,3.5,25.8,70.7,1.7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kp',40000,30.2,33.8,36,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kr',925100,3.2,40.4,56.3,3.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kw',48000,0.4,60.5,39.1,2.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ky',1391,1.4,3.2,95.4,2.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('kz',118400,7.4,37.8,54.8,6.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('la',11280,49.5,27.5,23,12.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lb',18830,12,21,67,2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lc',866,7,20,73,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('li',825,null,40,null,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lk',80580,19.1,26.2,54.7,5.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lr',2903,76.9,5.4,17.7,15);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ls',5892,15.2,43.9,40.9,5.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lt',45230,6.1,33.4,60.5,1.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lu',27270,0.5,16.3,83.1,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('lv',26530,4.4,24.8,70.8,6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ly',37480,8.7,45.7,45.6,2.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ma',134600,21.2,35.8,43,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mc',870,17,null,null,1.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('md',8581,22.4,24.8,52.8,11.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mg',14560,29.3,16.7,54,7.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mh',115,14,16,70,2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mk',14400,11.2,26,62.8,0.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ml',11000,45,17,38,4.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mm',74300,56.6,8.8,34.5,17.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mn',5332,20.6,21.4,58,11);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mp',null,null,null,null,1.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mq',6117,6,11,83,3.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mr',5534,25,29,46,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ms',29,5.4,13.6,81,2.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mt',7223,3,23,74,2.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mu',15680,7.6,30,62.4,4.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mv',1250,20,18,62,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mw',7410,54.8,19.2,26,12);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mx',1006000,4,27.2,68.9,5.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('my',229300,7.2,33.6,59.1,1.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('mz',23380,21.1,32.1,46.9,12.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('na',14760,11.3,30.8,57.9,4.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('nc',3158,5,30,65,-0.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ne',9716,39,17,44,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ng',125700,36.3,30.5,33.3,16.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ni',12340,20.7,24.7,54.6,9.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('nl',481100,2.4,24.5,73.1,1.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('no',183000,2.2,36.3,61.6,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('np',39530,40,20,40,2.9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('nr',60,null,null,null,-3.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('nu',7.6,null,null,55,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('nz',92510,4.6,27.4,68,2.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('om',38090,3.1,41.1,55.8,0.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pa',20570,7.2,13,79.8,2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pe',155300,8,27,65,3.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pf',4580,4,18,78,1.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pg',11990,34.5,34.7,30.8,4.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ph',430600,14.8,31.9,53.2,5.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pk',347300,22.6,24.1,53.3,4.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pl',463000,2.9,31.3,65.9,3.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pm',48.3,null,null,null,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pr',68950,1,45,54,6.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ps',2568,9,28,63,2.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pt',188700,5.9,30.2,63.9,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('pw',null,null,null,null,3.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('py',29930,25.3,24.9,49.8,5.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('qa',19490,0.3,58.2,41.5,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('re',4570,8,19,73,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ro',171500,13.1,33.7,53.2,9.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ru',1408000,4.9,33.9,61.2,11.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('rw',10430,41.1,21.2,37.7,7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sa',310200,4.2,67.2,28.6,0.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sb',800,42,11,47,10);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sc',626,2.8,28.7,68.9,5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sd',76190,38.7,20.3,41,9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('se',255400,2,29,69,0.7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sg',120900,0,32.6,67.4,1.7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sh',18,null,null,null,3.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('si',39410,3,36,60,3.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sk',78890,3.5,30.1,66.4,7.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sl',3335,49,30,21,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sm',940,null,null,null,3.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sn',18360,15.9,21.4,62.7,0.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('so',4597,65,10,25,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sr',1885,13,22,65,23);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('st',214,16.5,15.4,68.1,14);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sv',32350,9.2,31.1,59.7,5.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sy',60440,25,31,44,2.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('sz',6018,16.1,43.4,40.5,5.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tc',216,null,null,null,4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('td',15660,22.6,35.6,41.7,8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tg',8684,39.5,20.4,40.1,1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('th',524800,9,44.3,46.7,2.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tj',7950,23.7,24.3,52,8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tk',1.5,null,null,null,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tm',27600,28.5,42.7,28.8,9);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tn',70880,13.8,31.8,54.4,4.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('to',244,23,13,64,10.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tr',508700,11.7,29.8,58.5,9.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tt',11480,2.7,47,50.3,3.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tv',12.2,null,null,null,5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tw',576200,1.7,30.9,67.4,1.7);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('tz',23710,43.2,17.2,39.6,5.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ua',299100,18,45.1,36.9,12);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ug',39390,35.8,20.8,43.6,3.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('uk',1782000,1,26.3,72.7,1.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('us',11750000,0.9,19.7,79.4,2.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('uy',49270,7.9,27.4,64.8,7.6);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('uz',47590,38,26.3,35.7,3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('vc',342,10,26,64,-0.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ve',145200,0.1,46.5,53.4,22.4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('vg',2498,1.8,6.2,92,2.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('vi',2500,1,19,80,2.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('vn',227200,21.8,40.1,38.1,9.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('vu',580,26,12,62,3.1);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('wf',60,null,null,null,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ws',1000,14,23,63,4);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('ye',16250,15.5,44.7,39.7,12.2);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('yt',466.8,null,null,null,null);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('yu',26270,15.5,27.6,56.8,8.8);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('za',491400,3.6,31.2,65.2,4.5);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('zm',9409,14.9,28.9,56.1,18.3);
    Insert into intern.ECONOMY (COUNTRY,GDP,AGRICULTURE,INDUSTRY,SERVICES,INFLATION) values ('zw',24370,18.1,24.3,57.7,133);I'm using oracle 11.2.0.2 and i'll post create-insert for the tables.
    best,
    David
    Edited by: 1003209 on 28.05.2013 08:45

      CREATE TABLE "intern"."COUNTRY" ("NAME" VARCHAR2(40), "CODE" CHAR(2), "CAPITAL" VARCHAR2(40), "PROVINCE" VARCHAR2(40), "POPULATION" NUMBER, "AREA" NUMBER, "NEXTYEAR_POPULATION" NUMBER)
    REM INSERTING into intern.COUNTRY
    SET DEFINE OFF;
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Andorra','ad','Andorra la Vella','Andorra la Vella',69865,468,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('United Arab Emirates','ae','Abu Dhabi','Abu Dhabi',2523915,82880,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Afghanistan','af','Kabul','Kabul',28513677,647500,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Antigua and Barbuda','ag','Saint Johns','Saint John',68320,442.6,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Anguilla','ai',null,null,13008,102,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Albania','al','Tirana','Tirana',3544808,28748,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Armenia','am','Yerevan','Yerevan',2991360,29800,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Netherlands Antilles','an','Willemstad','Curacao',218126,960,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Angola','ao','Luanda','Luanda',10978552,1246700,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Argentina','ar','Buenos Aires','Buenos Aires',39144753,2766890,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('American Samoa','as','Pago Pago','Eastern',57902,199,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Austria','at','Vienna','Wien',8174762,83870,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Australia','au','Canberra','Australian Capital Territory',19913144,7686850,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Aruba','aw',null,null,71218,193,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Azerbaijan','az','Baku','Baki',7868385,86600,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bosnia and Herzegovina','ba','Sarajevo','Federacija Bosna i Hercegovina',4007608,51129,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Barbados','bb','Bridgetown','Saint Michael',278289,431,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bangladesh','bd','Dhaka','Dhaka',141340476,144000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Belgium','be','Brussels','Brussels',10348276,30528,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Burkina Faso','bf','Ouagadougou','Kadiogo',13574820,274200,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bulgaria','bg','Sofia','Sofija grad',7517973,110910,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bahrain','bh','Manama','Manama',677886,665,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Burundi','bi','Bujumbura','Bujumbura',6231221,27830,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Benin','bj','Porto Novo','Oueme',7250033,112620,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bermuda','bm','Hamilton','Hamilton',64935,53.3,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Brunei','bn','Bandar Seri Begawan','Brunei-Muara',365251,5770,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bolivia','bo','La Paz','La Paz',8724156,1098580,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Brazil','br','Brasilia','Distrito Federal',184101109,8511965,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bahamas','bs','Nassau','New Providence',299697,13940,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Bhutan','bt','Timphu','Timphu',2185569,47000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Botswana','bw','Gaborone','Gaborone',1561973,600370,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Belarus','by','Minsk','Minsk',10310520,207600,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Belize','bz','Belmopan','Cayo',272945,22966,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Canada','ca','Ottawa','Ontario',32507874,9984670,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cocos Islands','cc',null,null,629,14,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Democratic Republic of the Congo','cd','Kinshasa','Kinshasa',58317930,2345410,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Central African Republic','cf','Bangui','Bangui',3742482,622984,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Republic of the Congo','cg','Brazzaville','Brazzaville',2998040,342000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Switzerland','ch','Bern','Bern',7450867,41290,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cote dIvoire','ci','Yamoussoukro','Lacs',17327724,322460,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cook Islands','ck','Avarua','Rarotonga',21200,240,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Chile','cl','Santiago','Metropolitana',15823957,756950,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cameroon','cm','Yaounde','Centre',16063678,475440,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('China','cn','Peking','Peking',1298847624,9596960,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Colombia','co','Bogota','Bogota',42310775,1138910,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Costa Rica','cr','San Jose','San Jose',3956507,51100,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cuba','cu','Havanna','Ciudad de la Habana',11308764,110860,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cape Verde','cv','Praia','Sao Tiago',415294,4033,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Christmas Island','cx',null,null,396,135,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cyprus','cy','Nicosia','Government controlled area',775927,9250,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Czech Republic','cz','Prague','Prague',10246178,78866,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Germany','de','Berlin','Berlin',82424609,357021,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Djibouti','dj','Jibuti','Jibuti',466900,23000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Denmark','dk','Copenhagen','Frederiksberg Kommune',5413392,43094,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Dominica','dm','Roseau','Saint George',69278,754,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Dominican Republic','do','Santo Domingo','Distrito Nacional',8833634,48730,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Algeria','dz','Algiers','Algiers',32129324,2381740,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Ecuador','ec','Quito','Pichincha',13212742,283560,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Estonia','ee','Tallinn','Harju',1341664,45226,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Egypt','eg','Cairo','Cairo',76117421,1001450,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Western Sahara','eh',null,null,267405,266000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Eritrea','er','Asmara','Maekel',4447307,121320,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Spain','es','Madrid','Madrid',40280780,504782,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Ethiopia','et','Addis Abeba','Addis Abeba',67851281,1127127,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Finland','fi','Helsinki','Uusimaa',5214512,338145,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Fiji','fj','Suva','Central',880874,18270,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Falkland Islands','fk','Port Stanley','Falkland Islands',2967,12173,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Micronesia','fm','Palikir','Pohnpei',108155,702,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Faroe Islands','fo','Torshavn','Torshavn',46662,1399,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('France','fr','Paris','Paris',60424213,547030,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Gabon','ga','Libreville','Estuaire',1355246,267667,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Grenada','gd','Saint Georges','Saint George',89357,344,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Georgia','ge','Tbilisi','Tbilisi',4693892,69700,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('French Guiana','gf','Cayenne','Cayenne',191309,91000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guernsey','gg','Saint Peter Port','Saint Peter Port',65031,78,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Ghana','gh','Accra','Greater Accra',20757032,239460,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Gibraltar','gi',null,null,27833,6.5,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Greenland','gl','Nuuk','Nuuk',56384,2166086,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Gambia','gm','Banjul','Banjul',1546848,11300,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guinea','gn','Conakry','Conakry',9246462,245857,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guadeloupe','gp','Basse-Terre','Basse-Terre',444515,1780,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Equatorial Guinea','gq','Malabo','Bioko Norte',523051,28051,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Greece','gr','Athens','Attiki',10647529,131940,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guatemala','gt','Guatemala','Guatemala',14280596,108890,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guam','gu','Agana','Hagatna',166090,549,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guinea Bissau','gw','Bissau','Bissau',1388363,36120,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Guyana','gy','Georgetown','Demerara-Mahaica',705803,214970,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Honduras','hn','Tegucigalpa','Distrito Central',6823568,112090,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Croatia','hr','Zagreb','Grad Zagreb',4496869,56542,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Haiti','ht','Port-au-Prince','Ouest',7656166,27750,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Hungary','hu','Budapest','Budapest',10032375,93030,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Indonesia','id','Jakarta','Jakarta',238452952,1919440,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Ireland','ie','Dublin','Dublin',3969558,70280,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Israel','il','Jerusalem','Jerusalem',6199008,20770,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Isle of Man','im','Douglas','Douglas',74655,572,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('India','in','Delhi','Delhi',1065070607,3287590,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Iraq','iq','Baghdad','Baghdad',25374691,437072,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Iran','ir','Tehran','Tehran',69018924,1648000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Iceland','is','Reykjavik','Hoefueborgarsvaeei',293966,103000,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Italy','it','Rome','Lazio',58057477,301230,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Jersey','je','Saint Helier','Saint Helier',90502,116,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Jamaica','jm','Kingston','Kingston',2713130,10991,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Jordan','jo','Amman','Amman',5611202,92300,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Japan','jp','Tokyo','Tokyo',127333002,377835,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Kenya','ke','Nairobi','Nairobi',32021856,582650,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Kyrgyzstan','kg','Biskek','Biskek',5081429,198500,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Cambodia','kh','Phnum Penh','Phnum Penh',13363421,181040,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Kiribati','ki','Bairiki','Tarawa South',100798,811,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Comoros','km','Moroni','Ngazidja',651901,2170,null);
    Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA,NEXTYEAR_POPULATION) values ('Saint Kitts and Nevis','kn','Basseterre','Saint George Basseterre',38836,261,null);

  • Help required in writing And Reading Xml From Database

    Hi
    i m new to java.
    i m facing problem while writing Xml file from Mysql Database in java i m using the WebRowSet
    and also for Reading WebRowSet
    after reading the Xml i have to save this in Database
    (required source code)
    is there any one to help me in this way
    regards
    aamir

    shadab_think_globally wrote:
    {noformat}*hi everybody,
    please send me a ajax with jsp application
    suppose i enter a word in text area ajax will populate/suggest all string from database ,who started
    from that entering character(s).like a google string search.
    please send full source code
    *{noformat}how about you do it yourself?

Maybe you are looking for

  • Syncing Issues: album art, cut-off songs

    I have a 16GB iPod Touch that I've been syncing with my Windows Vista PC, seemingly without complications. It has only recently come to my attention that somewhere between my computer's library and my library on my iPod, something is messing up at ra

  • Handling unit management - pack delivery items in mass

    Dear All, I'd like to ask for your help whether there's any mass transaction in standard system that is designed to pack several deliveries at once (like mass WM picking in VL06P). - Automatic packing and generation of packaging items is set but firs

  • Workplace Installation Error: DB instance not found

    Hello all, While installing our Developer Workplace SR2 on our workstation, we encountered an error indicating that the database instance is not found. FYI, we were able to successfully install two without the problem . It appears that during the ins

  • Creative firmware on a Dell DJ

    I've got a Dell Dj 30 Gen 2 an in all that I've read, Dell DJs are Creative players with a Dell badge. It looks like Dell is getting out of the DJ players as they're only pushing the dittys and the DJ firmware hasn't been updated in a year. I like th

  • Still cant open RAW file in bridge in CS3

    I am on a g4 powerbook and have both cs3 and cs2 installed on my computer. In cs2 bridge i can double click a raw rile and open it in bridge, and i can also paste my raw adjustments to said file in bridge. I cant do any of this in cs3. i ran the scri