Home » Developer & Programmer » Forms » Retrieving records (Oracle IDS 10g,Windows XP)
Retrieving records [message #377644] Wed, 24 December 2008 01:24 Go to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi All !

I have a table stud with 5 records.
Then i created a similar table stud1 with the same fiels as that of stud ...

There are no records in this second table stud1..

Now i want to retrieve the records in stud into the stud1 .. I mean through the form..

I have created a form based on the table stud1.. Here a button is placed, on clicking it i want to see the 5 records that is stored in stud table in this form ..

Please help me with a solution !

Thanks And Regards,
Varosh
Re: Retrieving records [message #377645 is a reply to message #377644] Wed, 24 December 2008 01:28 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
Create a "COPY" button and enter the following code into WHEN-BUTTTON-PRESSED trigger:

insert into stud1 select * from stud;
Re: Retrieving records [message #377680 is a reply to message #377645] Wed, 24 December 2008 03:58 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi Frank !

Thanks for replying ! I tried with the coding u suggested .. The records from stud table got retrieved in the form stud1 .. But it causes duplication ..

That is insertion happens first time properly .. But the next time repetition of records happens when i click retrieve button in the form stud1..

Thanks and Regards,
varosh
Re: Retrieving records [message #377683 is a reply to message #377680] Wed, 24 December 2008 04:23 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
How about:

insert into stud1 select * from stud minus select * from stud1;
Re: Retrieving records [message #377692 is a reply to message #377683] Wed, 24 December 2008 05:18 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi Frank !

Thanks for your reply!

The coding u sent worked fine first..

Actually i had 3 records in the stud table ...

So in the stud1 form those 3 records got retrieved well..

Now in this stud1 form i need to make a change in one of the field of each record and save it...

So what happens is , initially no duplication happens .. But as the number of record increases duplication happens..

That is , when i make change in new record(say 4th record) and save, the previous 3 records also getting saved again !!

Thanks and Regards,
varosh
Re: Retrieving records [message #377709 is a reply to message #377692] Wed, 24 December 2008 07:51 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Varosh81, it would be easier to help if you decide to tell us all the traps along the pathway. Because, every new post reveals another request. This is frivolous!
Re: Retrieving records [message #377859 is a reply to message #377709] Thu, 25 December 2008 23:25 Go to previous messageGo to next message
varosh81
Messages: 178
Registered: February 2008
Location: CHENNAI
Senior Member
Hi !

Here is the detailed summary of what i intend to do !

I have got a table stud and other table stud1 with the same fields as stud table..

I have created a form based on the table stud1..

While entering this form i wanted the field entries of tabel stud to be retrieved .. i achieved this by means of insert query suggested by Frank earlier..

In this stud1 form i have placed an save button..

In each record iam retrieving i have to make change in a particular field and click the save buttonm..

For example: If i had 3 records in the table stud and have retrieved the same in the form stud1, Initially when i made change in a particular field of each record and clicked save no problem came..

But say if 2 records have been added in stud table, it is also getting retrieved in the stud1 form well..

But when i change the field entry of those records alone and save it, a copy of previously stored records is stored again! I mean duplication happens !!

Please Help!

Thanks and Regards,
Varosh
Re: Retrieving records [message #377932 is a reply to message #377859] Fri, 26 December 2008 08:27 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Unless you find a way to distinguish records stored in these two tables, you won't be able to solve the problem.

Frank's second message gave you a hint - however, as you have modified certain column values, these records are not entirely the same. Therefore, you'll have to use something else. For example, instead of MINUS, you might try with NOT IN. Or, mark "stud" table records with a flag which says "this record has already been copied to the 'stud1' table - don't process it any more!".
Previous Topic: Problem in Form Update
Next Topic: Logon_Screen Built in errror
Goto Forum:
  


Current Time: Sun Dec 11 04:05:42 CST 2016

Total time taken to generate the page: 0.14528 seconds