Reading two beans into one class?

Hi,
I am trying to deserialize a bean from a database (Oracle blob). I need help in introducing some flexibility, meaning that I can store objects of the same class but different versions, and I can cast them into just one class when I read them back.
For example, initially I wrote an Employee object into the DB, and I had a local Employee class.
class Employee {
     String name;
     int age;
     String getName() {...}
     void setName(String s) {...}
     int getAge() {...}
     void setAge(int i) {...}
}Later, you might want to add a new field 'payRise' to the class, and use the new corresponding getPayRise() and setPayRise().
In the DB, you still want to have both objects from both versions of the same class. Is there a way to still read the old object using the new Employee class? (so now we can read both versions) Currently I'm still having the InvalidClassException (serialVersionUID difference) even after manually setting the serialVersionUID . Please help.
More code example:
   resultSet = statement.executeQuery("SELECT * FROM DB WHERE VERSION = 1")
   resultSet.next();  
   Employee e = (Employee) read (resultSet, "EMPLOYEE_OBJECT")
   // and also..
   resultSet = statement.executeQuery("SELECT * FROM DB WHERE VERSION = 2")
   resultSet.next();
   e = (Employee) read (resultSet, "EMPLOYEE_OBJECT")read() is the usual deserialization:
    public static Object read(ResultSet resultTransactionSet, String column)
            throws SQLException, IOException, ClassNotFoundException {
        byte[] buf = resultTransactionSet.getBytes(column);
        if (buf != null) {
            ObjectInputStream objectIn = new ObjectInputStream(
                    new ByteArrayInputStream(buf));
            return objectIn.readObject();
        return null;
    }Is there a way to do this?
Thanks,
Nico

Serialization does not work for different versions of classes.
You must use XMLEncoder to write the object to DB, and then later can retrieve with XMLDecoder.
It will create an XML representation of your class depending only on your public apis, and works for different versions of the classes/objects.

Similar Messages

  • Mixing two AudioInputStreams into one

    Is there a quick way to mix two or more AudioInputStreams into one, or two Clips into one, or to just play the two together in sync?
    The only way I have found to do this is by using the classes at http://www.jsresources.org/examples/AudioConcat.html - this works by combining two or more AudioInputStreams into a separate AudioInputStream, by reading a frame's worth of bytes at a time from each stream, and using the Tritonus TConversionTool.
    However, there is a delay before long streams are combined using this method. So is there a way that two streams can just be played together right away?

    jamama wrote:
    Is there a quick way to mix two or more AudioInputStreams into one, or two Clips into one, or to just play the two together in sync?[http://java.sun.com/docs/books/tutorial/sound/playing.html]
    Scroll down until you find "Synchronizing Playback on Multiple Lines"

  • HT1473 My girlfriend and I both have iTunes account with our own music libraries and we want to combine our two libraries into one icloude accounts so can both then access our one shared libary at anytime in the cloud.  How do we do this?

    My girlfriend and I both have iTunes account with our own music libraries and we want to combine our two libraries into one icloude accounts so can both then access our one shared libary at anytime in the cloud.  How do we do this?

    No it is not possible.  Content purchased from the iTunes Store is permanently tied to the account from which it was originally purchased, and Apple does not provide a way to change it.

  • HT1449 how do you move all music from two computers into one itunes account?

    How do you move all music from two computers into one itunes account?

    An "iTunes account" is an online account you use for buying music, like a bank account.  An iTunes collection is the media you see when you open iTunes. Which do you mean?
    If it is two computers, it would also help to know where these are located. Are they on the same local network? If they are, try Home Sharing (and you have control of both and you aren't just trying to get music fro your computer to your friend's computer in another state).  If they are not, you'll have to use an external hard drive or flash drive.
    Is this on a PC? Your computer information says Windows but you posted this in the iTunes for Mac forum.

  • I opened an itunes account then forgot my password. I opened a new account now I would like to combine my two accounts into one but I still can't remember my password and now I have a new email account. Help!

    I opened an itunes account then forgot my password. I opened a new account now I would like to combine my two accounts into one but I still can't remember my password and now I have a new email account. Help!

    You can't combine accounts but help here Apple ID FAQ's for resetting your Apple ID password.

  • How do I combine two regents into one in Logic Pro Arrange?

    how do I combine two regents into one in Logic Pro Arrange?

    Thanks for your input kcstudio. I would still be left with 2 regions although one after the other, on one track.
    I am trying to save steps of the way I am combining the info of 2 seperate regions into one: bouncing the 2 tracks then re-importing that audio back into the project. It would save a lot of time if you could just drag one region on top of the other
                                W.W.

  • Wrap a file into one class

    Hello,
    I want to wrap a file into one classe, how can I do that?
    For example:
    class fileWrapper {
    one buffer for file content(what kind of buffer here?)
    Thanks a lot
    Grace

    The following is not a buffer but I hope it could be of some use.
    import java.io.*;
    public class FileWrapper {
        java.io.File file;
        FileWrapper(java.io.File f) throws java.io.IOException{
           this.file =f;
        FileWrapper(java.lang.String fname) throws java.io.IOException{
          this(new java.io.File(fname));
        // .. next is an example of a method ... You can define other useful methods
        public String readLines() throws java.io.IOException{//read all lines as a String object
           java.io.BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(this.file),"UTF8"));
           StringBuffer buffer = new StringBuffer();
           String temp=null,newLine=System.getProperty("line.separator");
           while((temp=reader.readLine())!=null){
               buffer.append(temp).append(newLine);
           reader.close();
           return String.valueOf(buffer);
    /*public static void main(String[] args) throws java.lang.Exception{
      FileWrapper fw = new FileWrapper("test.txt");
      String str = fw.readLines();
      System.out.println(str);
    }

  • Collapsing two tables into one table or one queue

    When you have data that exists in 2 tables A and B and B is essentially a child of A if you want to process these records such that you see all A's before their assoociated B how can you use either Streams or AQ to collapse these two tables into one? The data exists at it's source in database tables it will be replicated to another location and at that location I want to keep the data as it exists at the source but also process it in the ordered fashion I described above. My thinking is to publish the data to one queue but the challenge is to ensure that all A's are put on the queue before their B is. I don't just want a priority queue whereby all A's are processed before B's because if that happens B's will never be processed. but I simply want to avoid reading a B off the queue before I've read it's A.

    No version number and no clarity of what you are trying to accomplish.
    Without knowing that the problem is a nail ... I'd hardly be recommending using a hammer.

  • Join the two JInternalFrame into one

    hi everybody,
    What can I do to join two JInternalFrame into one, like I have 2 floating panel then I join it into 1 by using JTappedPane. That you can drag to spit it out or join together !
    thanks,
    Quin

    I think you mean saving two images side-by-side into one image. You won't be able to this with a native iphone app, but you may find a third party app on the AppStore to do this. Try this http://itunes.apple.com/us/app/two-faces-photo-sharing/id406310161?mt=8 if you want more help, email me at [email protected]

  • Combining multiple programs into one class

    So I have three classes, each with a program that does something different. I have to combine all three of them into one class, that gives an initial user interface asking which of the three programs would the user like to run, then runs the chosen program. How do I combine all three program classes into one class and have them run in such a way.
    Everything must be within ONE class.

    I know that.
    My issue is actually doing it in a way that isn't really ugly. Right now I just used a few huge if statements and put all my programs in those. I need to break it up into separate...methods I think it is.
    Here's my ugly ugly code.
    import java.util.*;
    import java.text.*;
    public class AssignmentFour {
         public static void main(String[] args) {
              Scanner sc1 = new Scanner(System.in);
              System.out.println("What program would you like to run:" );
              System.out.println("1. Long Distance Charges ");
              System.out.println("2. Internet Provider Charges ");
              System.out.println("3. Math Tutor ");
              System.out.println("4. Quit ");
              System.out.println("=> ");
              String numb = sc1.next();
              int num1 = new Integer(numb).intValue();
              if (num1 == 1) {Scanner sc2 = new Scanner(System.in);
              System.out.print("Please Enter the Starting Time of your call: ");
              String clock = sc2.nextLine();
              Scanner sc3 = new Scanner(System.in);
              System.out.print("Please Enter the Length of your call: ");
              String length = sc3.nextLine();
              float clock1 = Float.parseFloat(clock);
              int length1 = new Integer (length).intValue();
              double cost1 = 0;
              if (clock1 < 6.59) {cost1 = 0.14;}
              if (clock1 < 19.00 && clock1 > 7.00) {cost1 = 0.42;}
              if (clock1 < 23.59 && clock1 > 7.01) {cost1 = 0.28;}
              if (clock1 > 0.59 && clock1 < 0.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 1.59 && clock1 < 1.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 2.59 && clock1 < 2.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 3.59 && clock1 < 3.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 4.59 && clock1 < 4.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 5.59 && clock1 < 5.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 6.59 && clock1 < 6.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 7.59 && clock1 < 7.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 8.59 && clock1 < 8.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 9.59 && clock1 < 9.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 10.59 && clock1 < 10.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 11.59 && clock1 < 11.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 12.59 && clock1 < 12.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 13.59 && clock1 < 13.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 14.59 && clock1 < 14.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 15.59 && clock1 < 15.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 16.59 && clock1 < 16.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 17.59 && clock1 < 17.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 18.59 && clock1 < 18.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 19.59 && clock1 < 19.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 20.59 && clock1 < 20.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 21.59 && clock1 < 21.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 22.59 && clock1 < 22.99) {System.out.println("Error! Improper input!");}
              if (clock1 > 23.59) {System.out.println("Error! Improper input!");}
              if (length1 < 300) {length1 = length1;}
              if (length1 < 1) {System.out.println("Error! Improper input!");}
              if (length1 > 300) {System.out.println("Error! Improper input!");}
              double finalcost = (cost1*length1);
              DecimalFormat format = new DecimalFormat("0.00");
              String finalcostprint = (format.format(finalcost) + " ");
              if (clock1 > 0.00 && clock1 < 0.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 1.00 && clock1 < 1.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 2.00 && clock1 < 2.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 3.00 && clock1 < 3.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 4.00 && clock1 < 4.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 5.00 && clock1 < 5.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 6.00 && clock1 < 6.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 7.00 && clock1 < 7.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 8.00 && clock1 < 8.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 9.00 && clock1 < 9.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 10.00 && clock1 < 10.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 11.00 && clock1 < 11.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 12.00 && clock1 < 12.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 13.00 && clock1 < 13.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 14.00 && clock1 < 14.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 15.00 && clock1 < 15.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 16.00 && clock1 < 16.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 17.00 && clock1 < 17.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 18.00 && clock1 < 18.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 19.00 && clock1 < 19.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 20.00 && clock1 < 20.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 21.00 && clock1 < 21.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 22.00 && clock1 < 22.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (clock1 > 23.00 && clock1 < 23.59 && length1 < 300 && length1 > 0) {System.out.println("The charge for your call is " + finalcostprint + "");}
              if (num1 == 2) {
                   Scanner sc4 = new Scanner(System.in);
                   System.out.print("Enter customer billing information (First Name Last Name Package Hours Used): ");
                   String firstname = sc1.next();
                   String lastname = sc1.next();
                   String package1 = sc1.next();
                   String hours = sc4.next();
                   String packaged = package1.substring(0,1);
                   int hour = new Integer(hours).intValue();
                   double costa = (12.95 + 1.50*(hour-10));
                   double costb = (16.95 + 0.85*(hour-20));
                   double costc = (29.95);
                   char pack = packaged.charAt(0);
                   double cost = 0;
                   char A = 'A';
                   char B = 'B';
                   char C = 'C';
                   if (pack == A) {cost = 12.95 + 1.50*(hour-10);}
                   if (pack == B) {cost = 16.95 + 0.85*(hour-20);}
                   if (pack == C) {cost = 29.95;}
                   DecimalFormat format = new DecimalFormat("0.00");
                   String costprint = (format.format(cost));
                   if (pack == A) {System.out.println("Charges for " + firstname + " " + lastname + " (" + package1 + ") are $" + costprint + "");}
                   if (pack == B) {System.out.println("Charges for " + firstname + " " + lastname + " (" + package1 + ") are $" + costprint + "");}
                   if (pack == C) {System.out.println("Charges for " + firstname + " " + lastname + " (" + package1 + ") are $" + costprint + "");}
                   double saved = 0;
                   float costprinty = new Float(costprint).intValue();
                   if (costprinty>costa) {saved = cost - costa;}
                   if (costprinty>costb) {saved = cost - costb;}
                   if (costprinty>costc) {saved = cost - costc;}
                   char packy = 'A';
                   if (cost>costa) {packy = A;}
                   if (cost>costb) {packy = B;}
                   if (cost>costc) {packy = C;}
                   if (cost>costa && cost>costb && costa>costb) {saved = cost - costb;}
                   if (cost>costa && cost>costb && costb>costa) {saved = cost - costa;}
                   if (cost>costa && cost>costc && costa>costc) {saved = cost - costc;}
                   if (cost>costa && cost>costc && costb>costa) {saved = cost - costa;}
                   if (cost>costb && cost>costc && costb>costc) {saved = cost - costc;}
                   if (cost>costb && cost>costc && costc>costb) {saved = cost - costb;}
                   DecimalFormat format2 = new DecimalFormat("0.00");
                   String savey = (format.format(saved));
                   if (saved > 0) {System.out.println("" + firstname + " " +lastname+ " could have saved $" + savey + " by switching to package " + packy + ".");
                   if (num1 == 3) {
                        Random r = new Random();
                        int a = r.nextInt(99);
                        int b = r.nextInt(99);
                        int c = (a + b);
                        int d = (a * b);
                        int z = r.nextInt(2);
                   Scanner sc5 = new Scanner(System.in);
                   if (z == 0) System.out.print("" + a + " + " + b + " = ");
                   if (z == 1) System.out.print("" + a + " * " + b + " = ");
                   String answer = sc5.next();
                   int answery = new Integer(answer).intValue();
                   if (c == answery && z == 0) {System.out.println("Congratulations! You are a math whiz!");}
                   else if (d == answery && z == 1) {System.out.println("Congratulations! You are a math whiz!");}
                   else {System.out.println("Wrong!");}
                   if (num1 == 4) {
                        System.out.println("Goodbye");
                   else {System.out.println("Improper input!");
    }

  • Get value of two fields into one field

    Hellou,
    i need little help with javascript again
    Currently i'm using code below to get value from one field to other:
    getField("Text35").value = getField("Text1").valueAsString;
    Now i'm wondering how to change this code, so i could get values from two fields into one. For example i have field "firstname" and field "lastname", now i want to show this in field "name".
    Example, if field firstname have value John and field lastname value is Doe, i want to show it in field name like "John Doe".
    I hope that u understood what i want
    Thanks for helping me!

    getField("Text35").value = getField("Text1").valueAsString + " " +
    getField("Text2").valueAsString;

  • How to turn two users into one?

    Hey there!
    As I selled my MBP last month I copied all its datas to my iMac via migration assistant and created a new user for it. So I have now two accounts with different photos, documents etc.
    My problem now is how to turn these two users into one?
    I want all my photos appear in Aperture of my first user, I want all my documents appear in "Documents" of the first user and so on..
    Is it able? If yes, how could I realize it?
    Thanks for your support!
    René
    PS: 2 Users on iMac -> 1 User on iMac.

    Thanks for your help at first.
    But you usually can't "merge" two "normal" user accounts successfully.  If both accounts have data for the same application, it will be very difficult or impossible to merge them by copying files & folders.
    I cannot merge them.. So there is the question how to copy all medias from Aperture to my other Aperture medias?
    Can I export my whole medias and import in at the other users Aperture? And how? #
    Edit: I dont want to have two different libraries at all.. I want them to be together in just one..

  • Question - how do I combine two users into one?

    I have migrated a lot of data to a MacBook Pro using Migration Assistant, in the process two users have been created on the Mac. How do I combine the two users into one?

    You don't. Just log in with one, choose Go to Folder from the Finder's Go menu, provide /Users/ as the path. and drag the folder there; you'll need to provide an administrator password at some point.
    (108352)

  • HT4759 How do I combine two accounts into one

    How can I combine two accounts into one account

    If you are talking about iCloud accounts, you can't.
    Or you could tell us what type of accounts these are?

  • List aggregate two rows into one

    query :
    select kod_negeri.NAMA kod_negeri_nama,
    hakmilik.id_hakmilik,
    MOHON.PENYERAH_NAMA,
    MOHON.PENYERAH_ALAMAT1, MOHON.PENYERAH_ALAMAT2, MOHON.PENYERAH_ALAMAT3,
    MOHON.PENYERAH_ALAMAT4, MOHON.PENYERAH_POSKOD, MOHON.PENYERAH_KOD_NEGERI,
    MOHON.PENYERAH_NO_RUJ, MOHON.ID_MOHON, HAKMILIK.KOD_HAKMILIK, HAKMILIK.NO_HAKMILIK,
    KOD_LOT.NAMA, HAKMILIK.NO_LOT, KOD_BPM.NAMA, KOD_DAERAH.NAMA,
      LELONG.TMPT, LELONG.DIMASUK, PGUNA.NAMA,
      PIHAK.ALAMAT1, pihak.NAMA ven,
    PIHAK.ALAMAT2, PIHAK.ALAMAT3, PIHAK.ALAMAT4, PIHAK.POSKOD,
    mohon.id_mohon ,
    pguna.NAMA pguna_nama,
    pguna.JAWATAN,
    kod_daerah.NAMA kod_daerah_nama,
    to_char(enkuiri.TRH_enkuiri,'DD')||' '|| to_char(enkuiri.TRH_enkuiri,'MONTH','nls_date_language=malay') ||' '||TO_CHAR (enkuiri.TRH_enkuiri, 'YYYY') trh_enkuiri,
    to_char(lelong.TRH_lelong,'DD')||' '|| to_char(lelong.trh_lelong,'MONTH','nls_date_language=malay') ||' '||TO_CHAR (lelong.TRH_lelong, 'YYYY') trh_le,
    to_char(lelong.trh_lelong, 'Day') day,
    to_char(lelong.TRH_lelong,'HH12:MI ')  hour,
    DECODE(SUBSTR(to_char(lelong.TRH_lelong,'HH12:MI AM'),-2,2),'AM','Petang','pagi')  noon,
    enkuiri.cara_lelong,
    lelong.TMPT,
    lelong.HARGA_RIZAB,
    enkuiri.harga_rizab,
    initcap(pihak.NAMA) pihak_nama,
    initcap(lelong.EJA_RIZAB) er,
    'RM'||enkuiri.TUNGGAK_AMAUN,
    lelong.DEPOSIT,
    convert_number_words(lelong.DEPOSIT) as converted_form,
    to_char(lelong.TRH_AKHIR_BYR,'DD')||' '|| to_char(lelong.TRH_AKHIR_BYR,'MONTH','nls_date_language=malay') ||' '||TO_CHAR (lelong.TRH_AKHIR_BYR, 'YYYY') TRH_AKHIR_BYR,
    to_char(sysdate,'DD') ||' '|| to_char(sysdate,'MONTH','nls_date_language=malay') ||' '||to_char(sysdate,'yyyy') sysd,
    kod_bpm.NAMA kod_bpm_nama,
    kod_lot.NAMA kod_lot_nama,
    hakmilik.NO_LOT,
    hakmilik.KOD_HAKMILIK,
    hakmilik.NO_HAKMILIK
    from
    mohon ,
    mohon_hakmilik ,
    lelong ,
    pguna ,
    pihak ,
    kod_daerah ,
    enkuiri ,
    kod_bpm ,
    hakmilik ,
    kod_lot ,
    kod_negeri,
    mohon_fasa ,
    kod_hakmilik
    WHERE mohon.id_mohon = mohon_hakmilik.id_mohon and
    mohon_hakmilik.id_hakmilik = hakmilik.id_hakmilik and
    hakmilik.kod_hakmilik = kod_hakmilik.kod(+) and
    hakmilik.kod_lot  = kod_lot.kod(+) and
    hakmilik.kod_bpm = kod_bpm.kod(+) and
    hakmilik.kod_daerah = kod_daerah.kod(+) and
    mohon.id_mohon = enkuiri.id_mohon and 
    lelong.id_pihak = pihak.id_pihak and
    lelong.id_mh = mohon_hakmilik.id_mh and
    pihak.kod_negeri = kod_negeri.kod(+) and
    mohon.id_mohon = mohon_fasa.id_mohon and
    mohon_fasa.id_aliran ='semakan' and
    mohon_fasa.id_pguna = pguna.id_pguna and
    mohon.id_mohon = :p_id_mohon
    and enkuiri.KOD_STS='AK'
    and mohon.id_mohon ='0405AUC2010007436'KOD_NEGERI_NAMA,ID_HAKMILIK,PENYERAH_NAMA,PENYERAH_ALAMAT1,PENYERAH_ALAMAT2,PENYERAH_ALAMAT3,PENYERAH_ALAMAT4,PENYERAH_POSKOD,PENYERAH_KOD_NEGERI,PENYERAH_NO_RUJ,ID_MOHON,KOD_HAKMILIK,NO_HAKMILIK,NAMA,NO_LOT,NAMA_1,NAMA_2,TMPT,DIMASUK,NAMA_3,ALAMAT1,VEN,ALAMAT2,ALAMAT3,ALAMAT4,POSKOD,ID_MOHON_1,PGUNA_NAMA,JAWATAN,KOD_DAERAH_NAMA,TRH_ENKUIRI,TRH_LE,DAY,HOUR,NOON,CARA_LELONG,TMPT_1,HARGA_RIZAB,HARGA_RIZAB_1,PIHAK_NAMA,ER,'RM'||ENKUIRI.TUNGGAK_AMAUN,DEPOSIT,CONVERTED_FORM,TRH_AKHIR_BYR,SYSD,KOD_BPM_NAMA,KOD_LOT_NAMA,NO_LOT_1,KOD_HAKMILIK_1,NO_HAKMILIK_1
    Johor,050503PM00000151,HAMZAH DAUD DAROS & SITI NOR,NO 12 1ST FLOOR & 2ND FLOOR,JLN SRI RAHANG,TMN SRI RAHANG,SEREMBAN,58000,05,12345,0405AUC2010007436,PM,151,Lot,6309,Mukim Lenggeng,Seremban,PTG MELAKA,pptlelong1,Puan Nur Faizati,ASDFSAF,AHMAD,DSFDS,FDSFSDF,DSFSDF,12345,0405AUC2010007436,Puan Nur Faizati,Penolong Pegawai Tanah Lelong (PTD),Seremban,08 DISEMBER 2010,27 JANUARI 2011,Thursday ,02:00 ,pagi,A,PTG MELAKA,,,Ahmad,,RM234,,,24 MEI 2011,10 FEBRUARI 2011,Mukim Lenggeng,Lot,6309,PM,151
    ,050540HSD00022923,HAMZAH DAUD DAROS & SITI NOR,NO 12 1ST FLOOR & 2ND FLOOR,JLN SRI RAHANG,TMN SRI RAHANG,SEREMBAN,58000,05,12345,0405AUC2010007436,HSD,22923,Lot,0009838,Mukim Jimah,Seremban,PTG MELAKA,pptlelong1,Puan Nur Faizati,no2,Ali Bin Abudillah,jalan 3,taman permata,lorong mentari,32333,0405AUC2010007436,Puan Nur Faizati,Penolong Pegawai Tanah Lelong (PTD),Seremban,08 DISEMBER 2010,27 JANUARI 2011,Thursday ,02:00 ,pagi,A,PTG MELAKA,,,Ali Bin Abudillah,,RM234,,,24 MEI 2011,10 FEBRUARI 2011,Mukim Jimah,Lot,0009838,HSD,22923
    KOD_NEGERI_NAMA,ID_HAKMILIK,PENYERAH_NAMA,PENYERAH_ALAMAT1,PENYERAH_ALAMAT2,PENYERAH_ALAMAT3,PENYERAH_ALAMAT4,PENYERAH_POSKOD,PENYERAH_KOD_NEGERI,PENYERAH_NO_RUJ,ID_MOHON,KOD_HAKMILIK,NO_HAKMILIK,NAMA,NO_LOT,NAMA_1,NAMA_2,TMPT,DIMASUK,NAMA_3,ALAMAT1,VEN,ALAMAT2,ALAMAT3,ALAMAT4,POSKOD,ID_MOHON_1,PGUNA_NAMA,JAWATAN,KOD_DAERAH_NAMA,TRH_ENKUIRI,TRH_LE,DAY,HOUR,NOON,CARA_LELONG,TMPT_1,HARGA_RIZAB,HARGA_RIZAB_1,PIHAK_NAMA,ER,'RM'||ENKUIRI.TUNGGAK_AMAUN,DEPOSIT,CONVERTED_FORM,TRH_AKHIR_BYR,SYSD,KOD_BPM_NAMA,KOD_LOT_NAMA,NO_LOT_1,KOD_HAKMILIK_1,NO_HAKMILIK_1
    Johor,050503PM00000151,HAMZAH DAUD DAROS & SITI NOR,NO 12 1ST FLOOR & 2ND FLOOR,JLN SRI RAHANG,TMN SRI RAHANG,SEREMBAN,58000,05,12345,0405AUC2010007436,PM and HSD,151 and 22923,Lot,6309,Mukim Lenggeng,Seremban,PTG MELAKA,pptlelong1,Puan Nur Faizati,ASDFSAF,AHMAD,DSFDS,FDSFSDF,DSFSDF,12345,0405AUC2010007436,Puan Nur Faizati,Penolong Pegawai Tanah Lelong (PTD),Seremban,08 DISEMBER 2010,27 JANUARI 2011,Thursday ,02:00 ,pagi,A,PTG MELAKA,,,Ahmad,,RM234,,,24 MEI 2011,10 FEBRUARI 2011,Mukim Lenggeng,Lot,6309,PM,151
    that means i need to list aggregate the two rows into one how to make the changes for the above query in order to do so .
    Edited by: user9093689 on Feb 9, 2011 10:03 PM

    user9093689 wrote:
    now need to bother abt this that line converts date into malay language
    to_char(enkuiri.TRH_enkuiri,'DD')||' '|| to_char(enkuiri.TRH_enkuiri,'MONTH','nls_date_language=malay') ||' '||TO_CHAR (enkuiri.TRH_enkuiri, 'YYYY') trh_enkuiri,iam retriving two rows of output, wat i need is to display one row and the second row values which are not similar should be added to the first row
    for example for column
    kod_hakmilik two rows values are
    PM
    HSD
    but they should be display as
    PM and HSD
    finally my aim is to retrieve only one row as output.
    i dont how exactly the term listaggr . how ever it may be whether using groupby or any other but the output should be as aboveWhat version of Oracle are you on?
    Look up the LISTAGG() function in the documentation for your version (assuming it is there) and see if it can do what you want

Maybe you are looking for