how to write select Query in the Button to display data into the another block [message #624649] |
Wed, 24 September 2014 07:56 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi all,
Button_1
---------
Go_Block('Dept');
--need to write select query
select deptno from dept;
execute_query();
Dept block
----------
In the canvas(take as normal text)
deptno
-----
10
20
30
40
Button_2
if Button_2 clikced on the 10 row and clicked on the button_2
then go_block('emp');
--display 10 deptno data(records) only
and
How to implement this Query in the Button_2 and display data into the EMP Block
SELECT *
FROM (SELECT a.ID,
b.table_name,
b.creation_date,
RANK() OVER (PARTITION BY b.table_name ORDER BY b.creation_date desc) as date_ranking
FROM xxc_history a,
xxc_history_details b
WHERE a.ID = b.ID
AND name = ' Data Program')
WHERE date_ranking = 1
Assume in place of xxc_history take Dept table and xxc_history_details tale EMP table
[Updated on: Wed, 24 September 2014 07:58] Report message to a moderator
|
|
|
|
Re: how to write select Query in the Button to display data into the another block [message #624748 is a reply to message #624683] |
Thu, 25 September 2014 04:27 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Thanks for reply..
And another Requirement
Conditions:-
1) when i double clicked on the Item Value and it navigates to the Another Block & display the deptno=10's data only
Example:-
if i double click on the deptno 10 value then need to display that 10th dept data only
And
2) if i select(text_item only) deptno=10 value and clicked on the FIND Button , need to pass(dynamically in the Find Button Query) and display that 10th department related data only
Example if select 10 then need to pass that value like a parameter in the FIND Query
select * from (select * form emp
where deptno=:BLOCK.deptno);
How to do this please help me?
[Updated on: Thu, 25 September 2014 07:17] Report message to a moderator
|
|
|
|
Re: how to write select Query in the Button to display data into the another block [message #624808 is a reply to message #624773] |
Fri, 26 September 2014 00:10 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi Craig,
1)History(Parent), History_details(child) are the blocks
2)in the History block i have written "From clause Query" like select distinct name form table
3)And i had FIND Button in the History Block , navigates to the History_details and display the records on that Block
Conditions:-
1) if i doubled click on the History records(name column values) then go to the History_details Block and display that Name column value records.
Assume i am clicking on the 10 and display the 10 related records only
And Also
2) Select name column value , let say 10 and clicked on the FIND Button , display that particular Record.
And also i need to add below code in the FIND Button
select * from (select * form xxc_history_details
where deptno=:History.name);
Thanks in advanced
|
|
|