Home » Developer & Programmer » Forms » Fetching values into a multi record block from another table
Fetching values into a multi record block from another table [message #123470] Mon, 13 June 2005 12:05 Go to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
Hi,

I have one multi record block in which i want to fetch values
(more then one record) from another table using select statement

I have achieved this by using cursors, but i heard that there is a way to do this without using cursors.HOW DO I DO THIS WITHOUT USING CURSORS.

can anybody help me
Re: Fetching values into a multi record block from another table [message #123605 is a reply to message #123470] Tue, 14 June 2005 02:26 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use a master-detail relationship between two blocks.

Block A is the driving block and block B has the details. Join then by using the wizard to create a 'relation' from block A to block B.

David
Re: Fetching values into a multi record block from another table [message #123717 is a reply to message #123605] Tue, 14 June 2005 09:40 Go to previous messageGo to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
These 2 tables are totally un related and i cannot make these two as master detail, is there any other way around
Re: Fetching values into a multi record block from another table [message #123818 is a reply to message #123717] Wed, 15 June 2005 00:19 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
In When-New-Forms-Instance:

go_block('A');
execute_query;
go_block('B');
execute_query;
go_block('A');

That should retrieve records in both blocks.

David

[Updated on: Wed, 15 June 2005 22:01]

Report message to a moderator

Re: Fetching values into a multi record block from another table [message #123930 is a reply to message #123818] Wed, 15 June 2005 10:59 Go to previous messageGo to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
My question is how to populate values into a multi record block from another table by a select statement without using cursors

Block A is based on table X
I want Block A to populate values from table Y
with a select statement and without using cursors

I have only one block A displayed on the screen

can anyone help me here
Re: Fetching values into a multi record block from another table [message #124030 is a reply to message #123930] Wed, 15 June 2005 20:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Let's get this straight. You have one block A which is based on table X, but you also have fields in the block that you want to populate from table Y, and there is no relationship between tables X and Y.

col_x_1 col_x_2 col_x_3 col_y_1 col_y_2
val     val     val     val     val
val     val     val     val     val


and you want them to scroll up and down together in a multi-row block.

Am I correct?

David
Re: Fetching values into a multi record block from another table [message #124031 is a reply to message #124030] Wed, 15 June 2005 21:15 Go to previous messageGo to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
You have one block A which is based on table X -- CORRECT

but you also have fields in the block that you want to populate from table Y --- WRONG

I do not have any extra fields to populate from table Y, i have only fields from table X, i have to populate records from table Y into these fields itself

Yes, there is no relationship between tables X and Y

i hope i have answered your doubts
Re: Fetching values into a multi record block from another table [message #124034 is a reply to message #124031] Wed, 15 June 2005 22:02 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Then how do you know what data to put into which field?

David
Re: Fetching values into a multi record block from another table [message #124089 is a reply to message #124031] Thu, 16 June 2005 06:46 Go to previous messageGo to next message
Jagadeesh_Gadale
Messages: 2
Registered: June 2005
Junior Member
>>I do not have any extra fields to populate from table Y, i have only fields from table X, i have to populate records from table Y into these fields itself

Then why don't you create that bloack based on table Y

Cheers
Re: Fetching values into a multi record block from another table [message #124136 is a reply to message #124034] Thu, 16 June 2005 10:09 Go to previous messageGo to next message
vinodkumarn
Messages: 60
Registered: March 2005
Member
I have some common columns in both table X and table Y. so i want to populate these common columns into block based on table X from table Y

this is like pre populating some of the columns and then later user modifies as he likes and saves it into table X

i do not want to create any block based on table Y







Re: Fetching values into a multi record block from another table [message #124222 is a reply to message #124136] Thu, 16 June 2005 21:47 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Base the block on a view which is table y MINUS table x and then put a check-box on each line. If the user adds the extra data then the check-box is automatically 'ticked'. The user can also manually tick the check-box. When they push the 'add' button, via a loop through the block, all records that have been 'ticked' are inserted in table x.

David
Previous Topic: Can you plese clarify my doubt in the tree
Next Topic: Forms not showing data, unless tracing is on
Goto Forum:
  


Current Time: Thu Sep 19 21:57:22 CDT 2024