Home » Developer & Programmer » Forms » How to copy the multirecord block into another (forms 6i)
How to copy the multirecord block into another [message #456456] Tue, 18 May 2010 01:16 Go to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Hi
I have two block namely block-A, Block -B

Block A data queried from a view (it have 10 columns).

Block b (it have 5 columns all columns are same in block A column)

When i query of block - A i have to receive the same copy in Block B too.

How to achieve this.

Kanish
Re: How to copy the multirecord block into another [message #456457 is a reply to message #456456] Tue, 18 May 2010 01:20 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Base block B on the same view as block A (it will have less columns). Execute query (both blocks should have the same WHERE clause, block B's set by SET_BLOCK_PROPERTY, based on block A's LAST_QUERY value).
Re: How to copy the multirecord block into another [message #456459 is a reply to message #456457] Tue, 18 May 2010 01:23 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Block A From Based on View A

But Block B from Based on Another table.

Moreover I am getting data through execute_query from Block A and i want to insert into block B.

Kanish
Re: How to copy the multirecord block into another [message #456482 is a reply to message #456459] Tue, 18 May 2010 02:39 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Two options I can think of.

The first one is to loop through all records of block A and put them into block B.

Another one is to use LAST_QUERY and insert data from a view into a table
insert into table_b 
  select col1, col2, ..., col5
  from view_a
  where <block A's LAST_QUERY goes in here>
and query block B.


By the way, what is the problem you are trying to solve? Perhaps there's an easier way to do that?
Re: How to copy the multirecord block into another [message #456519 is a reply to message #456482] Tue, 18 May 2010 04:09 Go to previous messageGo to next message
mm_kanish05
Messages: 493
Registered: January 2007
Location: Chennai
Senior Member

Thanks First,

I thought the same idea, I don't want that.

My idea is that a form want to load the data from a view based block to table based block with executing two times (on Add option) . In modify case the table based block will open and modify the data.

Nothing but i need the copy of a block to another on single execution.

kanish
Re: How to copy the multirecord block into another [message #456520 is a reply to message #456519] Tue, 18 May 2010 04:16 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
mm_kanish05 wrote on Tue, 18 May 2010 10:09

My idea is that a form want to load the data from a view based block to table based block with executing two times (on Add option) . In modify case the table based block will open and modify the data.


Not really sure what you mean by that.
Never the less, Littlefoot's 2 options are the only ways available.
Re: How to copy the multirecord block into another [message #457090 is a reply to message #456520] Fri, 21 May 2010 00:56 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Perhaps in the 'when-new-block-instance' you could use the 'where' information from block A to perform a manual 'insert' statement in the table of block B, modify the 'where' for block B and then do an 'execute_query'.

David
Previous Topic: need help with forms upgradation from oracle support
Next Topic: Finding out port number of oracle forms and oracle id for compilation
Goto Forum:
  


Current Time: Fri Sep 20 05:40:41 CDT 2024