ADF - BC: query select VO question of Action in function
Hi Experts,
I created a query based Vo that is displayed on the page as a table. It has 1 button on top of table - delete which should only be enabled if a row is selected.
When I select a line, first of all, my entire table is refreshed then only the button is enabled. I'm not refreshing selectAction table. No idea why it's happening and what is possible to solve it.
For reference, code for selectAction is-
{} public void Actionselection (SelectionEvent selectionEvent)
AdfFacesContext context = AdfFacesContext.getCurrentInstance (); | ||
if(Context == null) | ||
return; | ||
JfrInfoData.JfrInfo = selectedRowData | ||
(JfrInfoData.JfrInfo) table.getSelectedRowData (); | ||
setDelJfrDump (selectedRowData.getFileName ()); | ||
setDownLoadFileName (selectedRowData.getFileName ()); | ||
setDelJvmId (selectedRowData.getJvmid ()); | ||
setDelPath (selectedRowData.getPath ()); | ||
context.addPartialTarget (removeButton); | ||
}
There was a double ppr of table for a message at the table box and message box. Removal of the ppr and the table began to work as expected.
Tags: Java
Similar Questions
-
Rewrite the query, select below or try to get the necessary O/P
Hello..
My example of data.,.
Create table customer (name varchar2 (10), telephone1 telephone2 number (10), number of phone3 (10), (10) number, bitwisephone number (10));
Insert into customer values('a',23456,67890,null,12345);
Insert into customer values ('b', 67459,89760,null, 37689);
create table do_not_call (dont_call number (10));
insert into do_not_call values (67890);
insert into do_not_call values (37689);
Question: -.
--------------
Customer 'a' has value of numbers1 as 23456.check if telephone1 exists in the do_not_call table.
In fact there is no, so set the bit for numbers1 as "o" like wise search telephone2
& phone3.after update of the bitwisephone for each client should be as the output below.
Need to O/P: -.
-------------------
name bitwisephone
a 010
b 001
For that matter... I use "any" operator...
SELECT name, case when numbers1 = all (SELECT dont_call FROM do_not_call) and then put an end to '1' other '0'.
-case when telephone2 = all (SELECT dont_call FROM do_not_call) and then put an end to '1' other '0'.
-case when phone3 = all (SELECT dont_call FROM do_not_call) then '1' other '0' end 'Bits '.
OF THE customer;
Is there any other way to get the necessary O/P?
Thank you!!
Kind regards
VijayRajaram.Looks like one already answered Re: rewrite the query, select below or try to get the necessary O/P
with customer(name,phone1,phone2,phone3,bitwisephone) as (select 'a',23456,67890,12345,null from dual union all select 'b',67459,89760,37689,null from dual ), do_not_call(dont_call) as (select 67890 from dual union all select 23456 from dual union all select 37689 from dual ) select name, to_char(mod(trunc(sum(weight)/4),2))|| to_char(mod(trunc(sum(weight)/2),2))|| to_char(mod(sum(weight),2)) bitwisephone from (select name,phone1 phone,4 weight from customer union all select name,phone2,2 from customer union all select name,phone3,1 from customer ) c, do_not_call d where c.phone = d.dont_call(+) and d.dont_call is not null group by name
Please do not duplicate messages
Concerning
Etbin
-
Insert the result of a query select in another table
Hello
I have a strange problem when I try to insert all the results of a query select in another table, using the declaration of the order.
With the declaration of COMMAND it works fine
Work:
------------------------------
INSERT INTO ADART01 (SELECT (codart)
"STOCK". "" CODART_STO ".
Of
"DB". ' ' 'ACTIONS');
------------------------------
But if I try to sort the result using the declaration of the ORDER, I have the following error:
Error: ORA-00907 missing right parenthesis
------------------------------
INSERT INTO ADART01 (SELECT (codart)
"STOCK". "" CODART_STO ".
Of
"DB". "" "ACTIONS"
ORDER BY
"STOCK". ("' CODART_STO ASC ');
------------------------------
Any idea?
Thank you for your help,
Angel.delete "()" to select
create table test1 (a number, b varchar2(100)); insert into test1 (a, b) select level, 'level ' || level from dual connect by level < 101; insert into test1 (a, b) select level, 'level ' || level from dual connect by level < 101 order by to_char(sysdate - level, 'D'); select * from test1; drop table test1;
-
Select - the Question of the Case statement
In my query:
SELECT WR_ITEM_OID, TITLE,
Title = WHEN 'No chocolate' THEN (select "#X #_G1_" ACE double groupname)
When title = 'Chocolate' THEN (select "#X #_G2_" ACE double groupname)
When title = 'Eraser' THEN (select "#X #_G3_" double groupname)
When title = "Import complete" THEN (select "#X # 101_ _G' As double GroupName")
When title = 'Export Total' THEN (select "#X # 102_ _G' As GroupName, the double")
ANOTHER "END as GroupName
OF WR_ITEM
I want to change the title of "Export" when title = 'Export Total'
How would I do that in this query?
Thank youHello
Rich75 wrote:
In my query:SELECT WR_ITEM_OID, TITLE,
Title = WHEN 'No chocolate' THEN (select "#X #_G1_" ACE double groupname)
When title = 'Chocolate' THEN (select "#X #_G2_" ACE double groupname)
When title = 'Eraser' THEN (select "#X #_G3_" double groupname)
When title = "Import complete" THEN (select "#X # 101_ _G' As double GroupName")
When title = 'Export Total' THEN (select "#X # 102_ _G' As GroupName, the double")
ANOTHER "END as GroupName
OF WR_ITEMI want to change the title of "Export" when title = 'Export Total'
How would I do that in this query?
Thank you
You can use another expression BOX to turn the title, usually to himself:
SELECT WR_ITEM_OID , CASE WHEN title = 'Export Total' THEN 'Export' ELSE title END AS title , CASE WHEN title = 'Non Chocolate' THEN '#X#_G1_' When title = 'Chocolate' THEN '#X#_G2_' When title = 'Gum' THEN '#X#_G3_' When title = 'Import Total' THEN '#X#_G-101_' When title = 'Export Total' THEN '#X#_G-102_' ELSE NULL END AS GroupName FROM WR_ITEM
There is no need for all scalar subqueries in double; I replaced the air conditioned and have literals.
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data. -
Why don't I have easily select my questions open after the connection support?
Why don't I have easily select my questions open after the connection support?
When I connect support communities, I have still no clear idea where to find my support questions which remain open to check updates.
Seems to me that this should be a great, distinct and separate button on the homepage of support after you have connected. "My open issues Apple Community Support."
Is this too much to ask?
Steve
- Click / tap your username
- Click / tap 'manage subscriptions '.
-
Prevent Question 2 Radio button selection until Question 1 Radio button selection
I have a script (Javascript) messagebox to appear if the user tries to make a radio button selection to question 2, when they do not have a selection to question 1. However, the message box does not prevent the selection. the radio button is selected after the messagebox goes. How to prevent this? I tried to focus on the set of question 1 of option buttons, but it does not work.
You could define question 2 in read-only or protected using 'access', until answered question 1.
-
Hello
I was out of Oracle for 6 years and am happy back in the fold.
I remember that I used to do some dynamic select statements for lets say I want to lock a bunch of user accounts.
I have my query that takes all the user names I want ready to go.
So you go something like:
Select "edit user" | my query. "account lockout";
or something like that?
I have tried searching without success.
Can someone tell me the right way to do it?
Thank you in advance for your help!
BTW, here's my query:
Select the separate username in dba_audit_object
When trunc (timestamp) < sysdate - 90
and username NOT IN ('JENAS', 'PETER001', 'DISCOVER_OWNER', 'LCL')
less
Select the separate username in dba_audit_object
When trunc (timestamp) > sysdate - 90You can try
select distinct ' alter user ' || username || ' account lock;' stmt from (select distinct username from dba_audit_object where trunc (timestamp) < sysdate - 90 and username not in ('JENAS', 'PETER001', 'DISCOVER_OWNER', 'LCL') minus select distinct username from dba_audit_object where trunc (timestamp) > sysdate - 90) /
-
Hello
I use the apex of oracle 10g 3.2
I use a select statement inside a cursor in an anonymous PL/SQL process. The output of the query is like that.
Method_id patient_id result index_repeat
39 123 12 0
29 123 23 0
39 123 32 1
Now what I want, that is if there is more then a method_id as 39 occurs twice with index_repeat 0 and 1, then take only with index 39 repeat 1 I mean the output of what I want is the select query
Method_id patient_id result index_repeat
29 123 23 0
39 123 32 1
I use the following query
Select method_internal_index, result, patient_id_code, index_repeat
of t_files_data_exp
where f_id =: P56_F_ID
F_ID is the primary key.
Thank you
OlivierDon't know what exactly you need. When I read your condition sounds like all you need is the following;
select method_internal_index ,patient_id_code ,result ,index_repeat from t_files_data_exp where f_id=:P56_F_ID and index_repeat = 1
However, I suspect that what you need is the following;
select * from ( select * ,row_number() over (partition by method_id order by index_repeat desc) rn from t_files_data_exp where f_id=:P56_F_ID ) where rn = 1
because I assume that the INDEX_REPEAT could be 2 or 3 or more!
-
Question from beginner on writing a query select box
Hello
I have a table called 'sites' that has 'site_number' column (data type: number) and area_ha (data type is also the number).
I am trying to write a query that will give me a third column called 'area_description '. This column shows "small" If the site is less than 10 hecatres and 'medium', if the site is greater than 10 hectares:
That's what I have so far:
SELECT site_number, area_ha,
CASE area_ha
WHEN < 10
THEN 'small '.
ELSE "average."
END AS area_description
Sites;
I get the error message is:
ORA-00936: lack of expression
00936 00000 - "missing expression.
* Cause:
* Action:
Error on line: column 7:10
So I know that it is the < that is the problem, but how to rewrite the query?I think this is right, but I don't have a system to test right now.
SELECT site_number, area_ha,
(CASE
WHEN are_ha<>
THEN 'small '.
ELSE "average."
Area_description END)
Sites; -
SQL > select lower (sysdate + 1 |) (' test') twice;
LOWER (SYSDATE + 1
---------------
07 jul-2014test
SQL > select lower ('test' | + 1 sysdate) twice;
Select lower ('test' | sysdate + 1) of the double
*
ERROR on line 1:
ORA-01722: invalid number
The query fails because it cannot perform arithmetic (+ 1) on a channel not digital. However, the query that successfully interpreted the arithmetic in the first place, that it concatenated the string 'test' to it... Make sense?
-
Hallo,
How can I get the value of a field in the row that is currently selected in an af:table?
I need to pass this value to a setCurrentRowWithKeyValue who took the record to display in another (by a button) called page:
Limited workflow
Page1 - goToPage2-> setCurrentRowWithKeyValue-> PAGE2 I defined a managed bean flowScope for the workflow in which I created the variable 'CodeToSetPage2Row '.
I will store the value of the field for the selected line in this variable so that I can move on to the setCurrentRowWithKeyValue.
Could be this method OK? Ore is there any good practice to achieve this goal?
The managed bean flowScope used to go to the stubborn task may take some values from the outside?
The workflow defined will be executed in a dynamic region.
Thank you
Federico
Federico, you cannot use a flow variable scope for this page. The region has no access to the bean. You must use a workflow for this parameter.
To get an attribute of the currently selected line you make slide data vo of control on the page attribute. This will create a link attribute for this attribute. Once this link exists, switch to source mode and remove the component that you do not want.
The framework passes the value of the current row in this affair of the attribute (table should be in single selection mode).
Click on the button, you switch the binding of the attribute for the setting of task flow using a setPropertyListener.
In the workflow, you call the setCurrentRowWithKeyValue with the parameter of workflow as the default activity.
Timo
-
change the results of the report with the selection list using dynamic action
This is one of those situations where if I could understand the appropriate search terms to use, someone else must have asked this question in the past.
I have a report with a SQL query with a condition based on a list of selection on the same page. So I have a list of selection -: P177_FISCAL_YEAR
My request for my report is:
Select md_id, display_name, description
of media_tbl
where fiscal_year =: P177_FISCAL_YEAR
When a person makes a selection on the selection list (: P177_FISCAL_YEAR), I would like to report up-to-date without having to submit the page. I was hoping that I could do something like this using a dynamic action but have not found a way to do it.
Thanks in advance!
JohnCreate dynamic Action:
When
Event: change
Selection type: product (s)
Article (s): P177_FISCAL_YEAR
Condition: - unconditionally.Real Actions (add 2 real actions)
-the first is to load the value in session state so that the report can see.
Sequence: 5
Action: execute the PL/SQL Code
Code PL/SQL: null;
Items to submit page: P177_FISCAL_YEAR-the second to refresh the report
Sequence: 10
Action: Discount
Selection type: region
Region: -
Passing the value of the SQL query select list
Hello
In my application users have in their homepage to a region which has two simple things, a part of LIST SLECT lov function and a BUTTON
There is also another page which has a normal life to report which shows the employees.
Homepage the user can select certain number of Department in its 'SLECT-LIST' and click 'open '.
For example: If the user has selected a DEP_NUM_5 and click on the BUTTON it will be redirected to the page of a report and gets only showed the employees belonging to the Department 5.
The report page contains a simple SQL query, and I understand that somehow I must pass the value in the SELECT LIST, where I now have the '?
How can I do this, where should I start?
Of course I would really appreciate an example of code, if anyone has time to do a.
select "EMP_ID", "EMP_FORNAME", "EMP_SURNAME", "DEP_NUMBER" from EMP E where E.DEP_NUMBER = ????????
Hi Sozua,
1. create an item hidden on the page where you have the report.
I say P2_DEPT_NO
2 assign to that in your sql query
select "EMP_ID", "EMP_FORNAME", "EMP_SURNAME", "DEP_NUMBER" from EMP E where E.DEP_NUMBER = :P2_DEPT_NO
below the area source ther is also an option
Elements of page to submit-> put this element in this.
for example;
Page to submit items: P2_DEPT_NO
3. change your button
Action: Redirecting to page of this application
Page: 2 / / assuming that page 2 is the report page
Place these items: P2_DEPT_NO
with these values: & P1_SELECT_LIST. assuming that selection list is on page 1
Hope this helps you,
Kind regards
Jitendra
-
Hello
Select transactionid, (TO_TIMESTAMP (endtime, "MON-DD-YYYY HH24:MI:SS)-TO_TIMESTAMP (starttime," MY - DD - YYYY HH24 timetaken:MI:SS))))
from (select a.transactionid, MAX (TO_CHAR (HH24:MI:SS' a.time_stamp,'DD-MON-YYYY)) endtime, starttime MAX (TO_CHAR (a.time_stamp,'DD-MON-YYYY HH24:MI:SS')))))
A newspaper, logaltkey b where a.time_stamp > TO_DATE ('29.01.2014:11:00:00 ',' DD.) MESSRS. ' YYYY:HH24:MI:SS)
and
a.time_stamp < TO_DATE ('30.01.2014:15:33:24 ',' DD.) MESSRS. ' YYYY:HH24:MI:SS)
and interfaceid = 'Member '.
and a.logid = b.logid
and b.altkeyname = 'SXC');
The query above returns the error below, some one please share your entries to make it work.
ORA-00937: not a single group group function
00937 00000 - 'not a single-group function.
* Cause:
* Action:
Error on line: column 2:14
You do not have to include group by clause in your query internal.
Try it below:
Select transactionid, (TO_TIMESTAMP (endtime, "MON-DD-YYYY HH24:MI:SS)-TO_TIMESTAMP (starttime," MY - DD - YYYY HH24 timetaken:MI:SS))))
Of
(
Select a.transactionid,
Endtime MAX (TO_CHAR (a.time_stamp, 'DD-MON-YYYY HH24:MI:SS')),
StartTime MAX (TO_CHAR (a.time_stamp,'DD-MON-YYYY HH24:MI:SS'))))
Of
Journal of a,
logaltkey b
where a.time_stamp > TO_DATE ('29.01.2014:11:00:00 ',' DD.) MESSRS. ' YYYY:HH24:MI:SS)
and
a.time_stamp<>
and interfaceid = 'Member '.
and a.logid = b.logid
and b.altkeyname ='SXC
A.transactionid group
)
-
How do the query select outer join to a report of the APEX
Hi all
I'm Ann.
I have a select statement that is used to calculate statistics for a month (October 2012 in this example)
Select ph.phase_number
sum ((case
WHEN ph.date_finished IS NULL or ph.date_finished > last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
THEN last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
Of OTHER ph.date_finished
END)
(-ph.date_started + 1) / count (def.def_id) as avg_days
Ph phase_membership
inner join court_engagement this on ph.mpm_eng_id = ce.engagement_id
join in-house defendant def on ce.defendant_id = def.def_id
where def.active = 1
and ph.date_started < = last_day (TO_DATE (' ' Oct 2012 ', ' MY YYYY' "))
and ph.active = 1
and UPPER (ce.court_name) LIKE '% '.
Rollup Group (phase_number)
;
The result is as below
Phase_Number AVG_DAYS
Phase One 8.6666666666666667
Phase two 14.6
Phase three 12
11.4615365
I have another list of selection mainly the list of months between two date value.
Select to_char (which_month, 'LUN YYYY') as display_month
de)
Select add_months (to_date (' ' August 2012 ', ' MY YYYY' "), rownum-1) which_month
of object
where
rownum < = months_between (to_date (' ' Oct 2012 ', ' MY YYYY' "), add_months (to_date (' ' August 2012", "MY YYYY"), - 1))
order of which_month)
The query result is as below
DISPLAY_MONTH
AUGUST 2012
SEP 2012
OCT 2012
Is it possible I can join these two select statement above to generate a comparable result:
Days of month Phase number Avg
August 2012 Phase One 8.666
Sep 2012 Phase One 7.66
Oct 2012 Phase One 5,66
August 2012 Phase two 8.666
Sep 2012 Phase two 7.66
Oct 2012 Phase two 5,66
August 2012 Phase three 8.666
Sep 2012 Phase three 7.66
Oct 2012 Phase three 5,66
Or
Days of month Phase number Avg
August 2012 Phase One 8.666
August 2012 Phase two 7.66
August 2012 Phase three 5,66
Sep 2012 Phase One 8.666
Sep 2012 Phase two 7.66
Sep 2012 Phase three 5,66
Oct 2012 Phase One 8.666
Oct 2012 Phase two 7.66
Oct 2012 Phase three 5,66
And it can be controlled by Phase number or month.
My other colleague suggested I should use a left outer join, but after having tried many ways, I'm still stuck.
I tried select is
Select a.display_month, b.* in)
Select to_char (which_month, 'LUN YYYY') as display_month
de)
Select add_months (to_date (' ' August 2012 ', ' MY YYYY' "), rownum-1) which_month
of object
where
rownum < = months_between (to_date (' ' Oct 2012 ', ' MY YYYY' "), add_months (to_date (' ' August 2012", "MY YYYY"), - 1))
order which_month)) a left outer join
(Select to_char (ph.date_finished, 'MY YYYY') as join_month, ph.phase_number)
sum ((case
WHEN ph.date_finished IS NULL or ph.date_finished > last_day (TO_DATE (a.display_month, 'MY YYYY'))
THEN last_day (TO_DATE (a.display_month, 'MY YYYY'))
Of OTHER ph.date_finished
END)
(-ph.date_started + 1) / count (def.def_id) as avg_days
Ph phase_membership
inner join court_engagement this on ph.mpm_eng_id = ce.engagement_id
join in-house defendant def on ce.defendant_id = def.def_id
where def.active = 1
and ph.date_started < = last_day (TO_DATE (a.display_month, 'MY YYYY'))
and ph.active = 1
and UPPER (ce.court_name) LIKE '% '.
To_char (ph.date_finished, 'MY YYYY'), group (phase_number) rollup) b
On a.display_month = b.join_month
but then I get an error
SQL error: ORA-00904: "A." "" DISPLAY_MONTH ": invalid identifier
I need to view a report on the APEX with option for people to download at least format CSV.
Already 1 inteactive report in the page, so I don't think adds another interactive report without using the iframe trick.
If any of you have any ideas, please help.
Thank you very much.
AnnHello Ann,.
Frank has done a very good job. I am also impressed.
Is in regard to your correction to his question, the problem is on this replacement you did
last_day(TO_DATE(am.which_month,'MON YYYY'))
AM.which_month is already a date type, and you don't need to convert it to this day.
Here is the correct way:last_day(am.which_month)
There are also sometimes with the data you've posted have no line for this month. So I also added a function NVL to display 0 under avg_days for these cases.
Here is my corrected query:
DEFINE startmonth = "Aug 2012"; DEFINE endmonth = "Oct 2012"; WITH all_months AS ( SELECT ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM-1) AS which_month , ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM ) AS next_month from all_objects where rownum <= months_between(to_date('&endmonth','MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1)) ) SELECT TO_CHAR (am.which_month, 'Mon YYYY') AS month , ph.phase_number , NVL(sum ( (CASE WHEN ph.date_finished IS NULL OR ph.date_finished > last_day(am.which_month) THEN last_day(am.which_month) ELSE ph.date_finished END ) - ph.date_started + 1 ) / count(def.def_id), 0) as avg_days FROM all_months am LEFT OUTER JOIN a_phase_membership ph PARTITION BY (ph.phase_number) ON am.which_month <= ph.date_started AND am.next_month > ph.date_started AND ph.date_started <= last_day(am.which_month) -- May not be needed AND ph.active = 1 LEFT OUTER JOIN a_engagement ce ON ph.mpm_eng_id = ce.engagement_id AND ce.court_name IS NOT NULL -- or something involving LIKE LEFT OUTER join a_defendant def ON ce.defendant_id = def.def_id AND def.active = 1 GROUP BY ROLLUP(phase_number, am.which_month) ORDER BY am.which_month , ph.phase_number ; The output is: MONTH PHASE_NUMBER AVG_DAYS -------- -------------------- ---------- Aug 2012 PHASE ONE 0 Aug 2012 PHASE THREE 0 Aug 2012 PHASE TWO 0 Sep 2012 PHASE ONE 12 Sep 2012 PHASE THREE 1 Sep 2012 PHASE TWO 9 Oct 2012 PHASE ONE 8 Oct 2012 PHASE THREE 0 Oct 2012 PHASE TWO 14 PHASE ONE 11 PHASE THREE 1 PHASE TWO 11.5 9.71428571
I don't know if that's really what you want. In the case check it and let me know.
Kind regards.
Al
Maybe you are looking for
-
How to cure jumbled text on some pages
Occasional web pages, I discovered get crushed by other text text makes it hard to read or unreadable. Can send a screenshot.
-
Disappread name of the left in iMessage column shows only photo
The column on the left in iMessage on my mac is only showing pictures and the display is no longer names. How can I change the display to show again the names as photo?
-
Workstation HP XW6200 need help.
Hello, ive tried searching for an answer that has yet to be resolved. so I thought id try my luck and post here, ive got a Dual xeon HP XW6200 pre-installed a little old but nevertheless, I'm looking for a graphics card that is decent and fit the PCI
-
Memory card not seen by Windows XP computer using the USB card reader portable
I use XP SP2 and have recently had a problem where my laptop does not recognize a card of memory a camera when the USB card reader is connected. It automatically launch an Adobe image management application, but I think that the operating system woul
-
When I open an email and click on a link in this email, I get this message. This file does not have a program associated with it for performing this action. Create an association in the set Associations control panel. I have no idea what it means. *