Query a table using Multi Select Item
Hi everyone!
I got a page where I have this multiselect item, and I want to query a table using its values.
For example: The Multiselect item has this values: 1,2,3,4,5,6,7,8,9 and 10
And I want to query every person who has ID_CLASS 1,4,7 and 9 by selecting those IDs from the list, and when I click que Consult button the Report displays those persons.
Whowever I can't accomplish this, I was trying to find a post about this without success.
Can anybody help me with this?
Thanks!!
Hi,
This is my problem, I select 2 or more options in the multiple select item, then after I click the "Consult" buttom it submits the page, however only 1 option is highlighted. For example I choose the first two options, then I click Consult and the page is submitted. After that only one of the 2 options are selected, but I need to get the 2 options highlighted as selected items.
If I clear cache I think I'll lost everything. (selected items)
Thanks again!
Similar Messages
-
Re querying a table using ONE Select
Hello Experts,
In one hit i want to query a Table2 2 times using oNE select query
Lets say, i have 2 database tables : Table1 & Table2.
& internal tables say itab1 & itab2.
Lets say they have fields: fld1 fld 2 fld3 fld4.
1) I used select * from Table1 into table itab1.
2) Now i want to get entries from table2 based on itab-fld1 and itab2-fld4
select * from Table2 into itab2
FOR ALL ENTRIES in itab1
where fld1 = itab1-fld1
and fld2 = *itab2-fld4* (entries based on
itab2)
Please suggest.,
Thanks
RickyHi Ricky,
it is almost impossible to explain anything if you do not have an example of what you are going to do. When I say example, I don not mean Lets say, i have 2 database tables or Lets say they have fields but a case that everyone understands.
If you are talking about SAP tables, give the names and fields. If you are talking about user-defined tables, decribe the process, give table and field names and characteristics (data element, domain, check table, search help...) of each field.
For the question Now please tell me how can i write aliasing the answer is a clear F1.
Shortly: If you write <tabname> AS <alias> or <fieldname> AS <alias> this means that <tabname> and <fieldname> identifie table and field in the database and <alias> is used for it in the query clause and for the data transfer from database to INTO data object.
Note: It is always better to ask a question for a specific task. Getting the answer you can use it in all tasks that are comparable to the one you asked for. Asking a bla-bla question ( Lets say... ) will rarely get a useful answer.
Regards,
Clermens -
SSAS Default Member Causing incorrect data in Excel Pivot Table using Multi-select in filter
I have an Excel 2013 pivot table connected to an SSAS (2012) cube. One of my dimensions has a default member specified. When I drop this dimension in the filter area of my pivot table and select multiple members including the default member then
only data for the default member is shown. Selecting multiple members where the default member is not included does not result in an issue.
I believe this may be in an issue in how Excel builds the MDX but wanted to see if there are any work arounds.
This issue can be recreated using AdvetureWorks using the following steps:
Alter the Product Dimension of the SSAS Default Member by setting the default member of the Product Line Attribute to Mountain: [Product].[Product Line]&[M]
Process the cube
Connect to the cube via Excel 2013
Drag internet gross profit to the Values area (The value will be 4700437.22 which reflects the Mountain default filter)
Drag Product Model Lines to the Filters area (you will see Mountain selected by default)
Change the filter by checking the Select Multiple Items checkbox and checking Mountain and Road (You will see that the amount does not change)
Change the filter again by selecting Road only (to demonstrate that Road has a value, 5602105.8, associated with it)
Change the filter again to select Road and Touring (to demonstrate that the correct aggregation of the two selected members is preformed)Hi Hirmando,
According to your description, the default member cause incorrect data when dragging a attribute that contain a default member to the FILTERS area, right?
I can reproduce this issue on my environment, when dropping this dimension in the filter area of my pivot table and select multiple members including the default member then only data for the default member is shown. Currently, it's hard to say the root
reason that cause this issue. In order to narrow down this issue, please apply the latest server pack and cumulative update.
Besides, you can submit a feedback at
http://connect.microsoft.com/SQLServer/Feedback So that microsoft will confirm if this is a know issue.
Regards,
Charlie Liao
If you have any feedback on our support, please click
here.
Charlie Liao
TechNet Community Support -
How to use multi select in a query report
I defined a lov. This lov retuns name and a id. I want to use the result of this multi select in my query.
I always get invalid number when I choose two items of the select. When I debug I see that the return value of the multi select is 1:2. How can I change the seperator : in , I tried the following but this does't work.
if :P26_PRODUCTTYPE IS NOT NULL then
l_sql := l_sql ||' and producttype in
(REPLACE(:p26_producttype,'':'','','' ))';
end if;as you're finding, multiple values selected from html db multi-select list items (and checkboxes) are stored as a single, colon-delimited string. i explained an easy way to handle this via pl/sql in...
Multiple select list
...that post shows you how to throw the selected values into a pl/sql table and step through them as needed. it also showed how to use an instr to parse through the string if you want to go that route. you could use that same instr logic right in your sql query. so let's say your lov for your multi-select item (P1_MY_MULTISELECT, we'll call it) was defined as...
select ename, empno from emp order by 1
...and your user selected KING, FORD, and JONES. :P1_MY_MULTISELECT would store those values as...
7839:7902:7566
...you could then write a query to return the selected enames with something like...
select ename, job
from emp
where insrt (':'||:P1_MY_MULTISELECT||':',':'||empno||':') != 0
...hope this helps,
raj -
Query on Multi-select Item and STRING_TO_TABLE
Hi everyone - here's the scoop:
I've got a multi-select item on a US state field that returns one or more state ID selected (eg. '15:26:49'). I want to use that to find rows in a table where the state ID is one of those values. State ID is indexed and I want to ensure that the index can be used, so I don't want to be doing "where instr(...)".
I read a post on Ask Tom - http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061 - where he parses a string of values into a table that can be used in an IN clause, thus allowing use of the index.
Here's my question - I'd like to take advantage of APEX_UTIL.STRING_TO_TABLE to do my parsing, but it returns APEX_APPLICATION_GLOBAL.VC_ARR2. I tried a bunch of different casts but couldn't make it work with a query done as per Tom Kyte's post. Ultimately I wrapped STRING_TO_TABLE and just "copy" the VC_ARR2 to a table of numbers, like this:
create or replace function string_to_numtbl(p_string in varchar2, p_separator in varchar2 default ':')
return num_table as
l_data num_table := num_table();
l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
begin
l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(p_string, p_separator);
FOR z IN 1..l_vc_arr2.count LOOP
l_data.extend;
l_data(l_data.count) := l_vc_arr2(z);
END LOOP;
return l_data;
end;
So I can use the multi-select to feed an IN clause. I'm still getting familiar with casts, but it seems to me thought that there ought to be a straighter path to allow the return of APEX_UTIL.STRING_TO_TABLE to be used in an IN.
Any thoughts?VC_ARR2 is an index by table and in the Tom's example he is using a nested table which
has a different structure and allows different operations. To make this short, you will not be
able to use VC_ARR2 in a SQL statement. Yes, it would be good since ApEx has its own
function to convert a string to a table and back. I have no problems using Tom's examle.
Here, you will find some description on differences:
http://www.unix.org.ua/orelly/oracle/prog2/ch19_09.htm
and here, you may want to se the utilization of PL/SQL collections on my demo application:
http://htmldb.oracle.com/pls/otn/f?p=31517:84
http://htmldb.oracle.com/pls/otn/f?p=31517:87
Denes Kubicek -
What is the syntax for creating global temporary table using a select query
hii
I'm creating a global temporary table using a select query ..how to mention 'on commit preserve rows' that?
create global temporary table t1 as select * from trn_ordbase on commit preserve rows;
but this is invalid syntax,so how to mention on commit preserve rows in this???if i dont mention it ,by default its considering as on commit delete rows.
Please help me out of this problem.create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif -
Max. records in Range table used in Select .. IN ?
Hi
Does somebody knows wich is the max. amount of records in a RANGES table used in Select Comand:
select xxxx FROM table
where field IN range_table.
That, because i found severeal times programs aborting for this cause, so i changed this condition to an ALL ENTRIES.
Regards
FrankIt really depends on the table and DB settings.
Check with your DBA folks.
On our system it's ~ 400-500 for most of the tables.
NOTE: as it depends on DB settings - it may be different on your development system and on your production system.
For all entries does ntohave this limitation as it's being split into several selects, you can see it in the trace. -
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa -
When using multi select in some utilities error RME-00011 occurs
When using multi-select in some utilities of headstart
eg. Enforce CDM Ordering Standard for Colums
RME-000011 error occurs:
RME-00011: Operation 'upd' on COLUMN has failed
Activity aborted with API errors.
Does someone know what went wrong?
regards,
marcelMarcel,
Could you please let me know what utility causes this erroneous behaviour? Is it possible to give a reproduceable description? I'm not aware of this problem. If you can force the failure again, is it possible to include the last part of the debug detailed log (set message level for user at 'debug detailed') in this thread?
Kind regards,
Marc Vahsen
Headstart Team -
Using Multi Select List in SQL Query
Hi all,
I am trying to using a Multi Select list for filtering of a report. I have :P2_RISK_SEVERITY which has has the possibility of values Very Low:Low:Medium:High:Very High. How do I use this Multi Select in the where section of a SQL query?
I need to say something along the lines of:
Select RISK_SEVERITY from TBL_RMD_RISKS where RISK_SEVERITY = (one of the options selected in the multi select)
Thanks for the help.Hi there,
The above suggestion will work perfectly as long as the table you're querying is relatively small, but keep in mind that applying the INSTR to the left side of the WHERE clause will always result in a full table scan. This means that if your table is large and RISK_SEVERITY is indexed, the index will never be used. Here is another approach (credit to AskTom) that converts your colon-delimited string of selected values to a list that can be used in an "IN(...)" clause, which will use an index on RISK_SEVERITY as long as the optimizer otherwise deems it appropriate:
-- creates a type to hold a list of varchars
CREATE OR REPLACE TYPE vc2_list_type as table of varchar2(4000);
-- converts a colon-delimited string of values to a list of varchars
CREATE OR REPLACE FUNCTION vc2_list(p_string in varchar2)
return vc2_list_type is
l_string long default p_string || ':';
l_data vc2_list_type := vc2_list_type();
n pls_integer;
begin
loop
exit when l_string is null;
n := instr(l_string, ':');
l_data.extend;
l_data(l_data.count) := ltrim(rtrim(substr(l_string, 1, n - 1)));
l_string := substr(l_string, n + 1);
end loop;
return l_data;
end vc2_list;
-- your WHERE clause
where risk_severity in(
select *
from the(select cast(vc2_list(:P2_RISK_SEVERITY) as vc2_list_type)
from dual))
...Hope this helps,
John -
How can a classic report be filtered using one select item and dynamic action?
APEX 4.2.1
DB 11g
I have a page with 4 reports on it. The top report is an interactive report and the following 3 are classic reports. The users would like to be able to use a select list to filter the 3rd report by PO line number without refreshing the entire page.
After verifying that the report is set to allow partial refreshes, I took the following steps
1. Created a PO Line select item (p_po_line_select) in the same report region
2. Added p_po_line_select to the report query
3. Created a dynamic action on p_po_line_select with 2 true actions
1. Set value (p_po_line_select)
2. Refresh report region.
The Set Value dynamic step was not working; I would get an out of memory error at line 2, memory stack error, or the value did not get saved to session state depending on the settings I selected. I was able to get it working with the following set:
1. Action = Set Value
2. Set type = PL/SQL Expression
3. PL/SQL Expression = :p_field_does_not_exist
4. Page items to submit = blank
5. Selection Type = Item(s)
6. Item(s) = p_field_does_not_exist
p_field_does_not_exist does not exist as a page or application item which leads me to believe that this is a bug and I am just lucky that it worked. I would rather know how to do this properly. Can someone please provide a link to a working example of how this should be done or state which settings are wrong?
I was able to reproduce the issue in the following app
http://apex.oracle.com/pls/apex/f?p=4500:1000
workspace = occam
user test/apex1
Thanks,STOP POSTING DUPLICATE THREADS.
If you have additional information, continue the discussion by posting it as a follow-up on the original thread: What is the proper way to filter classic report using just an LOV select field with dynamic action? -
Question on Updating the rows of a table using a SELECT Statement
Hi,
I am trying to set all of the R_IDs in one table to the ID from another table using a join.
Here is the SQL I came up with. I don't this is correct though.
UPDATE TABLEA A
SET R_ID=(Select Id from TABLEB B
WHERE A.DEE=B.DEE AND
B.RNUM=1);
Does this make sense?You can try the join view.
UPDATE ( SELECT table_a.id AS a_id,
table_b.id AS b_id,
table_a.col1 AS a_col1,
table_b.col1 AS b_col1,
table_a.col2 AS a_col2,
table_b.col2 AS b_col2,
table_a.col3 AS a_col3,
table_b.col3 AS b_col3
FROM table_a,
table_b
WHERE table_a.id = table_b.id)
SET a_col1 = b_col1,
a_col2 = b_col2,
a_col3 = b_col3;
However it may result in
ORA-01779: cannot modify a column which maps to a non key-preserved tableThis is because the key-preserving property of a table does not depend on the actual data in the table. It is, rather, a property of its schema. For example, if in table_b there was at most one record for each id value, then table_a.id would be unique in the result of a join of table_a and table_b, but table_a would still not be a key-preserved table. By adding the unique/primary key on the id column of table_b we can assure that if table_b.id were part of the result set of the join view then it would be unique. This makes table_a key preserved.
Thus, in order to update a join view we must assure that the columns involved in the join view from the source table are unique. We do this by creating a unique or primary key on those columns.
However, if you do not mind taking responsibility for making sure that there is one-to-one cardinality between the source and destination rows, then you might try the correlated subquery
UPDATE table_a
SET (col1, col2, col3 ) =
( SELECT col1, col2, col3
FROM table_b
WHERE table_b.id = table_a.id )
WHERE EXISTS
( SELECT col1, col2, col3
FROM table_b
WHERE table_b.id = table_a.id ) -
ORA-0907 error when querying XMLDB Table using XMLExists
Hi All,
Get ORA-00907 error when trying to use XMLExists:
SELECT *
FROM tnmab_agreement_xml_binary A
WHERE
( XMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/ShippingPartyGroups/ShippingParties/CustomerHolder[SAP_ID="$ARG"]')
passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")
OR
( XMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/NamedCustomerGroups/NamedCustomer/SAP_IDs/StringWrappers[Value="$ARG"]')
passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")
ORA-00907: missing right parenthesis
*00907. 00000 - "missing right parenthesis"*
**Cause:*
**Action:*
Error at Line: 6 Column: 176
Any help is appreciated
Thanks
AuroXMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/ShippingPartyGroups/ShippingParties/CustomerHolder[SAP_ID="$ARG"]'
passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")no ')' after the closing quote -
Delete record using multi select ...
Hi All,
I have a form associated with 4 reports region and retrieve report for that specific customer. In one report, i have option to delete the saved image by using multi selector check box (single or multiple) and hit the delete button. It works fine if there is no records for the other reports. i can upload image and delete record without any problem. As soon as I have records for other reports, multi selector does not work. when I try to delete, i get this error message -
ORA-20001: Error in multi row delete operation: row= 13, ORA-01403: no data found, delete from "RATIS"."RTT_FILES" where "FIL_ID" = :p_pk_col
Error multi row operation failed.
but if I remove the records for the other report, it works again. I have only one process for multi delete in this page. Seems it is conflicting with the other reports when trying to delete.
Can anybody help with this please?
Thanks,
TajuddinHi
That depends if the other "reports" are actually tabular forms as well? If they are, see:
http://apex.oracle.com/pls/otn/f?p=31517:163
this explains how to set up more than one tabular form on a page.
Otherwise, we would probably need to see your code to see what may be happening
Andy -
Table View MULTI SELECT option and Event handling problems
Hello All,
I am facing problem while giving miltselect option in a table view. When i mention multiselect attribute in Select option in table view, i am unable to select all the rows which i want to select,because i have an event onRowSelection event activated so when i select a row then it will automatically go to the event and i am unable to do multiple select.
Can you guys pl tell me is there any way thtat i can put check boxes in a table column and by that i can get values of row seelct and can perform my subsequent SQL operation.
Also i am not able to navigate in table view through BYPAGE or BYLINE option. When I click on navigate button then page got refreshed and i lost data.
One more query guys , can you pl tell me how can i store my internal table values from one event for the another event. I have used EXport/Import but internal table values get refreshed as page got refreshed on event switching/selection.
Please respond.hye rahul.
as i told you my second solution, will help you . the values remain in the corresponding UI elements.
For example , you have a drop down and table view. both will trigger events. bind the data of the table at drop down event and bind the dat of the drop down at table event.
event = cl_htmlb_manager=>get_event( runtime->server->request ).
CASE event->id.
when 'dd1'. drop down event is fired.
bind data for drop down
dd ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'dropdown'
id = dd_id' " name of the drop down id
along with drop down bind data for table view
tbv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'tbv_id' " name of the table view
when 'tbv_id'. drop down event is fired.
bind data for drop down
dd ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'dropdown'
id = dd_id' " name of the drop down id
along with drop down bind data for table view
tbv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'tbv_id' " name of the table view
This is how data should be binded in case of Stateless application. All the UI elemets must b binded again.. as the global data is refresed again.
Hope this helps.
Regards,
Imran.
Maybe you are looking for
-
How do I add a password protection to my email on my iPAD? It just pops up now.
How do I add password protection to my email on my ipad? My email just pops up now.
-
I had Oracle SQL Developer 1.5.0.53 and when I did a "Check for Update" it said no updates found, even though SQL Developer 1.5.1 was released on June 9, 2008. So obviously this is a bug you need to fix. OK - So I downloaded the latest Oracle SQL Dev
-
I've got my app prototyped quickly with the default settings in Flex Builder 4. Now I'm going back and adding/modifying features to polish the app off. For this application I'm using PHP5 as the server side. The data paging is really cool and simple
-
Disable Client Side Rendering on 2008 R2
Hi guys, I have the following: several 2008 R2 RDS servers connecting to queues on a windows 2008 SP2 x64 print server print queues running the HP Universal Print Driver v 5.3 I'm trying to offload rendering to the beefy print server. To test this, I
-
How do I delete j2sdk previous version ?
I have Downloaded J2sdk1.4.2_02 yesterday.I want to Uninstall j2sdk previous version jdk1.3.1_01.but I don't know where uninstall file is.I key "C:\cd j2sdk1.4.2_02,dir"in prompt,and reply message is " driver c has not volumn label". Now I define a f