Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Apex Dynamic Actions (Apex windows 7 )
|
|
|
|
|
Re: Apex Dynamic Actions [message #599175 is a reply to message #599171] |
Tue, 22 October 2013 13:56   |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Oh well.
My previous message was based on information I managed to understand. Obviously, you meant something different and that's why I asked you to please describe it so that I would understand. I'd be happy to read it, only if you had enough patience to do that. Apparently, it is you who lost patience, but that's fine with me.
As of me criticizing you: what made you think so? Once again: I can't read your mind. There's nothing wrong in you posting something that I don't understand, and I see nothing wrong in me answering the best I could with the information and knowledge I have. This is a discussion forum; if you are lucky, you get then answer immediately. Otherwise, we'll have to discuss it some more. And here comes the "patience" part again.
Finally: 3 minutes ... I don't know why it took so long. Maybe you should learn how to type faster
OK, now back to reality.
You have a department name item - that I understand.
But you also have employee name items (3 of them: name1, name2 and name3). Is that all you have? What if department contains more than 3 items? How does that page look like? Is it
DEPARTMENT_NAME
NAME1
NAME2
NAME3 orDEPARTMENT_NAME NAME1 NAME2 NAME3 or something different? I can't see your screen, and I couldn't imagine it either - that's why I asked you to post a screenshot (but you don't want to do that).
Furthermore, I asked whether it was a tabular form, because it allows you to have kind of a master-detail form, department being a master and its employees detail. You said that it is not a tabular form.
OK, but master-detail you described looks much more like a report, not a form. That's why I suggested you to use an interactive report, but you don't want that either.
Therefore, I took some time and created sample page using Apex 4.2; schema I'm working with contains Scott's EMP and DEPT tables. The page looks like this:

I set a PL/SQL dynamic action which fires when DEPTNO item is changed and fills EMPNO_1 and EMPNO_2 items with employee names that belong to that department and have MIN and MAX salaries within department, respectively.
Dynamic action code looks like this (avoiding too-many-rows with ROWNUM):begin
select e.ename
into :P2_ENAME_1
from emp e
where e.deptno = :P2_DEPTNO
and e.sal = (select min(sal) from emp e1
where e1.deptno = e.deptno)
and rownum = 1;
select e.ename
into :P2_ENAME_2
from emp e
where e.deptno = :P2_DEPTNO
and e.sal = (select max(sal) from emp e1
where e1.deptno = e.deptno)
and rownum = 1;
end;
Page item to submit was P2_DEPTNO; page items to return were P2_EMPNO_1 and P2_EMPNO_2.
Running the page, it seems that it *works*, but I have no idea whether you asked for that or not.
Anyway, I'll think twice before trying to answer your next question on this forum because I don't like your attitude at all (and I don't like discussing with people I don't like). I'm sure someone else will be happy to assist, so - best of luck (you'll need it)!
[EDIT: added Apex version and items to submit/return information]
[Updated on: Tue, 22 October 2013 14:24] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Thu Mar 13 22:07:53 CDT 2025
|