Home » Developer & Programmer » Forms » Matching data in 2 different blocks.....
Matching data in 2 different blocks..... [message #191949] Fri, 08 September 2006 22:33 Go to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
Experts.....

A little help guys.....How can I match data's from 2 different block...and if there are records with the same name it will automatically get the record and save it in another table/block...
any help will be appreciated.......
thanks a lot in advance......


raizen.......
Re: Matching data in 2 different blocks..... [message #191991 is a reply to message #191949] Sat, 09 September 2006 12:35 Go to previous messageGo to next message
RJ.Zijlstra
Messages: 104
Registered: December 2005
Location: Netherlands - IJmuiden
Senior Member
Hi Raizen,

Like to help, but...

What exactly do you mean by
records with the same name

?

Does this mean some column in block A has the same value as some column in block B? Or whatever, please explain.

Also 'it will automatically get the record' etc
Do you mean that a row from block A must be inserted in the base table of block B?


Regards,

Rob Zijlstra
Re: Matching data in 2 different blocks..... [message #192705 is a reply to message #191949] Wed, 13 September 2006 05:45 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member

The requirement is whenever there are same record in Block A and Block B the records will be copy and save in Block C....can u give an example code for this....

tnx in advance.....

raizen...
Re: Matching data in 2 different blocks..... [message #194045 is a reply to message #192705] Wed, 20 September 2006 09:26 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
experts.....

Can you help me solved this prob.....

tnx in advance,....


raizen....
Re: Matching data in 2 different blocks..... [message #194193 is a reply to message #194045] Thu, 21 September 2006 02:41 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please post the text from your written requirement. I am having trouble visualising your requirement.

David
Re: Matching data in 2 different blocks..... [message #194273 is a reply to message #194193] Thu, 21 September 2006 06:26 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
david....

here's the scenario...I have 2 Tabular Blocks with with the same row but it came from different table...now the requirements is whenever there is same record in the 2 tabular blocks...the record will automatically copied in another tabular block w/c have the same row like the other 2 blocks....and i will decide if i will savew it or not...I already use global variable but still not working....plssss help me with this one.....desperately need this....

tnx....

raizen....

Re: Matching data in 2 different blocks..... [message #194412 is a reply to message #194273] Fri, 22 September 2006 01:20 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay ... you have three blocks. Block A for table A, and block B for table B. Then another BLOCK C for table C. All three tables have the same structure.

You could populate tables A and B, and then do something special to get the form to populate block C by looping through block A with another loop through block B, but, in my opinion, the easiest is to show the Block A and Block B the normal way (go_block('a'); execute_query; go_block('B'); execute_query;), but then use a 'select' statement to populate Block C.
select a.item1,
       a.item2
  from a
 where exists (select 'x'
                 from b
                where a.item1 = b.item1
                  and a.item2 = b.item2);

Look at thread http://www.orafaq.com/forum/m/111031/67693/#msg_111031 for sample code on how to populate a block.

David
Re: Matching data in 2 different blocks..... [message #194647 is a reply to message #194412] Sat, 23 September 2006 09:04 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
david.....

I did try the code in the URL that you gave to me but still theres no result showed in block c even if there are records in block a and block b that have the same value....can you code it for me plssssss.....Its for my thesis and my defense is 3 days from now but still i havent done anything yet regarding this matter....this is the main requirement of my thesis...plssss if you have an idea or code bout this, plssss post it in this topic....


tnx in advance.....

raizen....
Re: Matching data in 2 different blocks..... [message #194745 is a reply to message #194647] Mon, 25 September 2006 01:41 Go to previous messageGo to next message
shahidmughal
Messages: 91
Registered: January 2006
Location: Faisalabad Pakistan
Member

hi
please explain
if
you have already saved the data of
block a
and
block b
in the database before fetching the records
into block c.
---------------------------------------------
and can u afford to save the data blocks (a,b) before fetching.
---------------------------------------------
if you are agree then there is some solution i have in my mind.

please reply as soon as possible.

Muhammad Shahid Mughal
Re: Matching data in 2 different blocks..... [message #194764 is a reply to message #194745] Mon, 25 September 2006 03:22 Go to previous messageGo to next message
raizen_underground
Messages: 28
Registered: September 2006
Location: Manila, Phillipines
Junior Member
yes its already saved....only block c is not save...
Re: Matching data in 2 different blocks..... [message #194772 is a reply to message #194764] Mon, 25 September 2006 04:10 Go to previous message
shahidmughal
Messages: 91
Registered: January 2006
Location: Faisalabad Pakistan
Member

hi
i hope u r fine.
please note the following query
put it into the trigger of that field from which you want to go to the block c

you cant put it in

Key-Next-Item
trigger

----------
go_block('c');
clear_block;

-----------------------------------------------------------

CURSOR example IS
SELECT * from table a union select * from table b;

BEGIN

OPEN example;

loop
FETCH example

----(your all field which are to fetch)
INTO c.v1,c.v2

exit when example%notfound;

next_Record;
end loop;

CLOSE example;
END;

-----------------------------------------------

i hope this will solve your problem

but reply me after checking this procedure

-------------------------------------------

Regards,

Muhammad Shahid Mughal
Faisalabad Pakistan

[Updated on: Mon, 25 September 2006 04:13]

Report message to a moderator

Previous Topic: Help NEEDED
Next Topic: fmb issue - immediate help needed
Goto Forum:
  


Current Time: Fri Sep 20 12:48:25 CDT 2024