Saving values of a query to do another query
Hello:
I have two selectOneChoice in a page. When you select in the first SelectOneChoice, the second one shows the values obtained by a query. This works perfectly.
Now with the second value of the SelectOneChoice I have to do another query to get values for another query. I would like to save this values in a variable to use them in the next query and create a table with the resutl of the query.
Some ideas? I haven´t be able to get this
I have get to execute the query. In the PageDef I have created a variable (codEnf) and a iterator (findCodEnfByIdIter) in the executables. In the bindings I have created an methodAction(findCodEnfById) and a List (findCodEnfById1). In the console i see that the query is executing correctly. If I put a new component referencing to this, all is correct. But.... How to save the result in the variable codEnf??
I have put a OutputText in the page with value #{bindings.codEnf} and it´s empty...
Why?
Message was edited by:
ALF
Help please!!!!!!!!
Similar Messages
-
Which patch parameters "reset to saved value" on changes and which don't?
Despite having the preferences patch set to "reset to saved" AND all screen control inspector attributes set to "preference", AND updating to 2.0.1, I can't make sense out of why some parameters reset to "as-saved" and some don't when changing patches away then back again to a patch. Which parameters reset and which don't quite random and despite many tests and much manual reading I can't figure out the logic, so to speak.
I've been testing by changing a screen parameter on a patch, switching to another patch, then switching back to the first patch, expecting the first patch to be as it was when the concert was opened or last saved. Not so. I've tried this in many different concert templates and only gotten very inconsistent hair-pulling-out results despite much reading of manuals. I know that concert-level parameters take precedence over patch parameters but I'm testing what I am quite sure are patch parameters -- like instrument volume, or drive gain, or filters, etc. -- which do not perform consistently.
Eg: usually but not always, volume does NOT reset back to saved position when I return to a patch I moved it away from saved position on. Sometimes, but not always, deeper parameters like drive volume or bell volume (EP88) or EXS88 parameters will revert back to as-saved in one concert or even set, then in another they won't. On one of the preset concerts, everything works great ("Tonewheel organ"). On another, it's all over the map ("Keyboard with patches") with inconsistencies.
SO: Can anyone clarify if there's a certain type or family of patch parameters that I shouldn't expect to reset? Or are the factory patches buggy? Or is this still a buggy part of MainStage? Or am I looking at this wrong? Or what? Ahhhgggrrrrr.
This is a big deal as my keyboard tech and I prepare to use or not use MainStage's indredibly promising sounds on a European tour. I really want to, as I really hear a difference b/n even the best hardware and MS, but I have to know what to expect on stage. I was really hoping the new update would fix this, but no difference.
Thanks much for any clarification,
NeilActually I think the light bulb just went off, and it is indeed a semantic definition conflict. I thought "revert to saved" was about going back to the untweaked (saved) version of a patch every time you navigated back to it while playing, like in my hardware keyboard example. Upon dissection, I realize that this is about what happens when you actually SAVE the file after playing it; it either saves the file with changes to parameter values (keep current value) or saves the file without keeping the changed values (revert to saved).
The reason for the confusion is two-fold:
One why wouldn't you just "close without saving" if you want to revert to the saved values after playing? Like one does in other programs when you tweak away but want to retain the original version. Seems like overkill to have a preference dedicated to this, maybe you know the design philosophy.
Second, the language is very confusing:
The manual says, in this section, "You can set the default to either have parameters keep their current value when changing patches, or to reset their values to the last saved value".
This sounds like a behavior when changing patches. It's actually trying to say that this is the behavior for when you're saving after the playing time is over. Should have said "When saving a aconcert, you can set the default to either have parameters keep their current value including all changed patch parameters, or to reset their values to the last saved value, ignoring any changed patch parameters".
I still don't understand the reason for this VERY CONFUSING preference versus just closing without saving.
I'd appreciate it if you could confirm if we're looking at this correctly now, which would mean we have to re-think our tech approach to concerts.
Thanks for the help and sorry for the confusion, but hopefully now you understand the reasons.
Neil -
FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.
Hi,
I have one multi record block in which i want to fetch values
(more then one record) from another table using select statement
IN KEY NEXT ITEM.I am getting following error.
ORA-01422: exact fetch returns more than requested number of rows
Thanks in advance.In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
However, you can replace the explicit cursor with implicit one like
go_block('non_db_block_name');
first_record();
FOR v_tab IN (SELECT *
FROM tab
WHERE col_name = :variable)
LOOP
:non_db_block_name.field1 := v_tab.col1;
:non_db_block_name.field2 := v_tab.col2;
next_record();
END LOOP; -
Send values to IN query with parameter
Subject: send values to IN query with parameter
Hello. Hope I'll explain my problem well enough:
I have a query:
-- select id from table where id in ('100')
Now I used parameter for the IN part:
-- select id from table where id in (:param)
and I gave the parameter the value 100.
now I want to have the query with two values:
-- select id from table where id in ('100','200')
I tried to use the parameter and give him the value of: '100','200'.
It didn't worked :(
Is there a syntax to give the parameter more then one value for the IN query (with out using another table or function etc')?
Thanks in advance,Roy.This is the best solution I have for it.
variable parameter varchar2(4000);
exec :parameter := 'SYSTEM,SYS';
select username
from dba_users
where username in ( select COLUMN_VALUE from table (split_string(:parameter,',')))It uses this function
CREATE OR REPLACE
type string_table as table of varchar2(4000)
CREATE OR REPLACE
FUNCTION split_string (
string IN varchar2,
delimiter IN varchar2
) RETURN string_table IS
tab string_table;
pre integer;
post integer;
step integer;
i integer;
BEGIN
pre := 1;
step := length(delimiter);
i := 0;
tab := string_table();
loop
tab.extend;
i := i + 1;
post := instr(string,delimiter,pre);
if ( post = 0 ) then
tab(i) := substr(string,pre);
return tab;
end if;
tab(i) := substr(string,pre,post-pre);
pre := post + step;
end loop;
END;
/Bye Alessandro -
To obtain total value as initial query even if item_number is added
hi all
i have the following query with me
SELECT SUM ( (NVL (f.calc_cement_sk, f.calc_amount) * NVL (f.item_price, 0)
- ( NVL (f.calc_cement_sk, f.calc_amount)
* NVL (f.item_price, 0)
* (NVL (f.dis_per, 0) / 100)
) total,
h.slurry_type, h.stage_id, h.slurry_vol_actual
FROM xxnp_opn_joblog_est_002 f,
xxnp_opn_joblog_001 j,
xxnp_opn_joblog_slurry_003 h,
qp_secu_list_headers_v qw
WHERE j.opn_job_desc = 'K/D/KD43/UG187/1338/D/0211/1'
AND f.opn_joblog_001_id = j.opn_joblog_001_id
AND j.contract = qw.NAME
AND h.opn_joblog_001_id = j.opn_joblog_001_id
AND h.opn_joblog_007_id = f.opn_joblog_007_id
AND h.opn_joblog_006_id = f.opn_joblog_006_id
GROUP BY h.stage_id, h.slurry_type, h.slurry_vol_actualthe output i get is
TOTAL SLURRY_TYPE STAGE_ID SLURRY_VOL_ACTUAL
9,562.59 Lead 1 490
2,184.84 Tail 1 80
1,091.73 Top Up 1 56
3,431.64 Tail 2 100
when i add f.item_number to the above query as shown below
SELECT SUM ( (NVL (f.calc_cement_sk, f.calc_amount) * NVL (f.item_price, 0)
- ( NVL (f.calc_cement_sk, f.calc_amount)
* NVL (f.item_price, 0)
* (NVL (f.dis_per, 0) / 100)
) total,f.item_number,
h.slurry_type, h.stage_id, h.slurry_vol_actual
FROM xxnp_opn_joblog_est_002 f,
xxnp_opn_joblog_001 j,
xxnp_opn_joblog_slurry_003 h,
qp_secu_list_headers_v qw
WHERE j.opn_job_desc = 'K/D/KD43/UG187/1338/D/0211/1'
AND f.opn_joblog_001_id = j.opn_joblog_001_id
AND j.contract = qw.NAME
AND h.opn_joblog_001_id = j.opn_joblog_001_id
AND h.opn_joblog_007_id = f.opn_joblog_007_id
AND h.opn_joblog_006_id = f.opn_joblog_006_id
GROUP BY h.stage_id, h.slurry_type, h.slurry_vol_actual,f.item_number
the field total gets split and gives value corresponding to each item_number
i am giving the ouptut for stage 1TOTAL ITEM_NUMBER SLURRY_TYPE STAGE_ID SLURRY_VOL_ACTUAL
5011.5 1020101001 Lead 1 490
1308.93 1020102002 Lead 1 490
127.215 1020111001 Lead 1 490
138.92 1020112001 Lead 1 490
686 1020113001 Lead 1 490
550.5 1020113002 Lead 1 490
1739.52 1020222010 Lead 1 490
1517.1 1020101001 Tail 1 80
379.5 1020102003 Tail 1 80
83.2 1020103001 Tail 1 80
166.53 1020104001 Tail 1 80
38.511 1020111001 Tail 1 80
1064.7 1020101001 Top Up 1 56
27.027 1020111001 Top Up 1 56
if we sum values in total field corresponding to lead ,tail,top up we get 9562.59,2184.84,1091.73 respectively
kindly guide
to get total value as initial query even if item_number is added
thanking in advanceHi,
you can achieve this by enclosing it with another select
select
total, slurry_type, stage_id, slurry_vol_actual,
sum(total) over (partition by slurry_type, stage_id, slurry_vol_actual) from (
your actual select
)regards -
How to tackle the dataflow problem when Value Change event always triggers after another GUI event
We know that Value change event always triggers after another GUI event. Eg, the user modifies string control, the user clicks on a boolean control. Then event boolean clicked is triggered before event string control value change.
Now suppose somehow the GUI event that must happen to subsequently trigger the Value change event can potentially affect the data that Value change event is supposed to work on. How can we tackle this problem ?
For example, in a mockup application that the grand purpose is to have user entered values in a textbox logged to a file (no missing information is accepted, and there is a boolean to determine how the information is logged).
There are 2 controls, boolean A when clicked (mouse down) will load random number in text box B. Text box B is designed with event structure VALUE change which saves whatever values user enters into text box B to a log file.
There are 3 problems when instead of clicking anywhere on the front panel after modifying text box B, the user ends up clicking on boolean control A.
1. Event mouse down on Boolean control A will execute first, modifying text box B content before the user entered values in B get saved.
2. The value of boolean A can potentially affect how textbox B is loggged.
3. The value of boolean A affects how the file is logged and this is indeterminate. Somehow when running this VI with no Highlighting, the textbox B Value change event executes -before- boolean A value is updated (F to T). When running this VI with Highlighting, the boolean A value is updated (F to T) (because we click on it) -before- textbox B value change event occurs. Why is it like this ?
Now the situation I made up seems non-sense, but I believe it resembles one way or another a problem that you might run into. How would you solve this problem elegantly ?
You can set the string control to "update while typing".
Are you sure appending the log to itself is reasonable? Wouldn't it grow without bounds if the users keeps entering strings or pressing the ingore button?
Why isn't the "constant" a diagram constant instead of a control. Is the user allowed to change it?
To reset just write empty strings or a false to local variables of the controls (renit to defaults" seems a bit heavy handed).
All you probably need is a single event case for "ignore:value change" and "String" value changed", no need for the local variable..
Also add a stop button and an event for it.
You don't need the timeout event.
-
Copy selected values from a table control into another table control
hi there,
as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?you're funny
i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
here's my code, maybe you can tell me exactly were i have to change it:
tc1 = upper table control
tc2 = lower table control
SCREEN 0100:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE get_nfo. --> gets data from the dictionary table
MODULE tc1_change_tc_attr.
LOOP AT it_roles_tc1
INTO wa_roles_tc1
WITH CONTROL tc1
CURSOR tc1-current_line.
ENDLOOP.
MODULE tc2_change_tc_attr.
LOOP AT it_roles_tc2
INTO wa_roles_tc2l
WITH CONTROL tc2
CURSOR tc2-current_line.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT it_roles_tc1.
CHAIN.
FIELD wa_roles_tc1-agr_name.
FIELD wa_roles_tc1-text.
ENDCHAIN.
FIELD wa_roles_tc1-mark
MODULE tc1_mark ON REQUEST.
ENDLOOP.
LOOP AT it_roles_tc2.
CHAIN.
FIELD wa_roles_tc2-agr_name.
FIELD wa_roles_tc2-text.
ENDCHAIN.
FIELD wa_roles_tc2-mark
MODULE tc2_mark ON REQUEST.
ENDLOOP.
MODULE ok_code.
MODULE user_command_0100.
INCLUDE PAI:
MODULE tc1_mark INPUT.
IF tc1-line_sel_mode = 2
AND wa_roles_tc1-mark = 'X'.
LOOP AT it_roles_tc1 INTO g_tc1_wa2
WHERE mark = 'X'. -
> big problem here is, that no entry has an 'X' there
g_tc1_wa2-mark = ''.
MODIFY it_roles_tc1
FROM g_tc1_wa2
TRANSPORTING mark.
ENDLOOP.
ENDIF.
MODIFY it_roles_tc1
FROM wa_roles_tc1
INDEX tc1-current_line
TRANSPORTING mark.
ENDMODULE. "TC1_MARK INPUT
MODULE tc2_mark INPUT.
IF tc2-line_sel_mode = 2
AND wa_roles_tc2-mark = 'X'.
LOOP AT it_roles_tc2 INTO g_tc2_wa2
WHERE mark = 'X'. -
> same here, it doesn't gets any data
g_tc2_wa2-mark = ''.
MODIFY it_roles_tc2
FROM g_tc2_wa2
TRANSPORTING mark.
ENDLOOP.
ENDIF.
MODIFY it_roles_tc2
FROM wa_roles_tc2
INDEX tc2-current_line
TRANSPORTING mark.
ENDMODULE.
thx for anybody who can help with this! -
CHAR's value in the query but not in the report??
Hi all,
I loaded master data and crm transaction data from ODS to Cube. The data is in the cube but there is no value in my report when running it. EX: there are some CHARs in my report, I checked those CHARs have value in the query but it shows 'not assign' in my report when I run it. What happen?
Thanks.
J.Please see below text and also the sent link..
If a navigation attribute is used in an aggregate, this aggregate has to be adjusted using a change run as soon as new values are loaded for the navigation attribute (when master data for the characteristic belonging to the navigation attribute is loaded.) This change run is usually one of the processes that are critical to the system performance of a production BW system. This is why, by avoiding using navigation attributes or not using navigation attributes in aggregates, you can improve the performance of this process. On the other hand, not using navigation attributes in aggregates can lead to poor query response times. The data modeler needs to find the right balance.
http://help.sap.com/saphelp_nw04/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
cheers,
Vishvesh -
Dynamically passing the values to IN query in JDBC
Hi,
I have a list which contains a single or multiple values which does have CustomerVO as a generic.Here i need to iterate the list pass these values to "IN" query.
These should happen dynamically, as we dont know whether the list will hold a single or multiple value. If the list.size ==1 , then it contains a single value in it. Hence there is no need for a comma(,) in the IN query else we need to have it, like .... IN (Aaron,Bob). Please help me in this?
Thanks.797836 wrote:
I have a list which contains a single or multiple values which does have CustomerVO as a generic.Here i need to iterate the list pass these values to "IN" query.
These should happen dynamically, as we dont know whether the list will hold a single or multiple value. If the list.size ==1 , then it contains a single value in it. Hence there is no need for a comma(,) in the IN query else we need to have it, like .... IN (Aaron,Bob).So basically you need to output the List (capital 'L') as a comma-delimited list (small 'l').
The procedure for that is usually something like:
1. Output the first element.
2. For any further elements:
2a. Output ","
2b. Output the element.
Winston -
How to use Item value in chart query
Hi Folks,
I am looking to use calander item value in sql query used to populate flash chart. I tried with following query where P2_DATE1 is the calander item name. This says no data found. I am not sure if I am missing some thing with BUTTON settings which I am using to put data into chart.
Select null "link",to_date(entry_date,'dd-mon-yy hh:mi:ss') "Time in GMT", to_number(load_avg_5,'99.99') "Load Avg 5 Min" from oracle_ocm.top_load_avg --where trunc(entry_date)=:P2_DATE1
I am new to APEX
Please helpHere are few things for you to try:
Hardcode the value and see if it works. "where trunc(entry_date) = to_date('01-May-2010', 'dd-Mon-yyyy')". If it works, then click Session link at the bottom of the page, and check the value of the item P2_DATE1. If null, then you have a problem. If not null, please ensure that you use TO_DATE function as shown above with proper format mask.
Good luck.
Ravi A -
Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
I am using this code :
<HTML>
<HEAD>
<SCRIPT>
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i<colCount; i++ ) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;}}}
function deleteRow(tableID) {
try {var table = document.getElementById(tableID);
var rowCount = table.rows.length;
for(var i=0; i<rowCount; i++) {
var row = table.rows[i];
var chkbox = row.cells[0].childNodes[0];
if(null != chkbox && true == chkbox.checked) {
if(rowCount <= 2) {
alert("Cannot delete all the rows.");
break;}
table.deleteRow(i);
rowCount--;
i--;}}}catch(e) {alert(e);}}
</SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
<INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
<TABLE id="dataTable" width="350px" border="1">
<TR>
<TD width="32"></TD>
<TD width="119" align="center"><strong>Activity</strong></TD>
<TD width="177" align="center"><strong>Cost</strong></TD>
</TR>
<TR>
<TD><INPUT type="checkbox" name="chk"/></TD>
<TD>
<select name="s1" id="s1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</TD>
<TD><input type="text" name="txt1" id="txt1"></TD>
</TR>
</TABLE>
</BODY>
</HTML>Hi,
Let me make sure u r working with table control.
First u have to create a event(VALIDATE) to do the validation.
Inside the event,
1. First get the current index where user has pointed the curson
2. Once u get the index read the internal table with index value.
3. Now u can compare the col1 and col2 values and populate the error message.
1. DATA : lo_elt TYPE REF TO if_wd_context_element,
l_index type i.
lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
CALL METHOD LO_ELT->GET_INDEX( RECEIVING MY_INDEX = l_index.
above code should be written inside the event.
Thanks, -
How to get the max value in the query??
Plant calday(mm.dd.yyyy) Soldout.Qty
0001 01.01.2005 10
0001 01.02.2005 20
0001 01.03.2005 05
0001 01.04.2005 16
0001 01.05.2005 10
0001 01.06.2005 14
From the above values , how can i findout Max(Soldout.Qty)(i.e 20) for the above week...Suppose present aggregation = summation...How can i findout the value in the Query??don't want to do changes to design...Hi Bhanu,
I tried the calculation results as...Maximum,..
But that will pick the maximum value among the avialable values..like
plant1 max 10
plant2 max 20
plant3 max 30
then it will show as..
plant1 max 30
plant2 max 30
...like this...but my case is
plant1 calday1 10
plant1 calday2 05
plan1 calday7 08
plant2 calday1 10
plant2 calday2 05
plan2 calday7 20
so for each set it need to bring the maximum value... -
Select more than 60 values at a query isn't possible?
Post Author: fmonsma
CA Forum: WebIntelligence Reporting
I can't select more than 60 values at my query. We got id numbers. I want to select the name, adress, zipcode etc. of for example 80 id numbers. BO doesn't allow me to make this query. In SQL it's no problem.
The only thing i can do is to make a query with all id numbers and in the report itself i can select this more than 60 values. This is not very handy if you havemore than 150,000 id's in your databases.Rather several select fields because single returned value is a functional limitation of <select>.
-
Using item values in the query
Hi,
Is there a way I can use item values in the query...?
as an example, something like this
select a.*, :P20_CUST_NAME as CUSTOMER_NAME
from
table TEMP a;
haven't tried it yet but want to get the feedback first before making an attempt...
ThanksYes, as long as that item has a value in session state..
Thank you,
Tony Miller
Webster, TX -
How to change the value from one input control to another input control?
Hi Experts,
I want to change the value from one input control to another input control. For Example if i change month in first tab. it should reflect in second tab also. How should we acheive through input control or some other option.
Here I attached screen shot.Please help me for thisHi,
It is not possible to have Input controll in all tabs that will be set from another .
But There is one workaround .
Follow the link below .
http://davidlai101.com/blog/2013/08/13/web-intelligence-input-control-that-affects-all-tabs/
Maybe you are looking for
-
Is there a spinner graphic that I can display while generating a CSV?
I'm using Scott Spendolini's Download to CSV using a before header process to generate the CSV on a page branched to from a button on a previous page. The file takes about a minute to generate before the Save Dialog appears. I'd like to display a spi
-
Variable CWD not set in CGIServlet
We are using a cgi on WL 5.1 We have a third party CGI that looks for a variable CWD which stands for current working directory. This variable should be set to the directory in which the CGI is located. For e.g if the CG
-
How i connect to my localhost machine to other database machine for sending
hi, in our organization lan is there. how should i pass the jdbc connection commands through java program to get the data from database from my system to other database system. here in my system there is no database. please provide the code for that.
-
LDAP : Access for the requested connection is refused.
Hi After successfully connected to ldap server through OBI rpd , I imported the users and created init. blocs and variables. But when logging into dashborad/Answers i am getting the following error : Error Codes: OPR4ONWY:U9IM8TAC State: 08004. Code:
-
Hi, I am still practicing my steps in the XI world. We have CRM4 and R/3(4.6c). Our users use EP (PCUI) for the frontend (say for masterdata). We have some web-application(webservice) system which needs to be integrated through XI. If example, they c