i need a solution for this "conventionally" mean using apex native functionality.
I have two cascading check boxes when i select any or multiple value from the parent checkbox then the referenced values in checkbox 2 should return (this is working) but when deselect all the values from parent checkbox it should return all the value in checkbox 2.
https://apex.oracle.com/pls/apex/f?p=119345:15
help will be appreciated.
Try to use NVL in your input item.
SELECT DEPTNO || '-' || ENAME, EMPNO
FROM EMP
WHERE DEPTNO IN
(SELECT COLUMN_VALUE
FROM TABLE(APEX_STRING.SPLIT(NVL(:P15_CB1,DEPTNO),':')))
ORDER BY 1
Ex. https://apex.oracle.com/pls/apex/f?p=145797:3
login on: https://apex.oracle.com/pls/apex/f?p=4550:1
workspace: stackquestions
user: test
pwd: test
app: 145797
page: 3
Related
I have Interactive report in apex application where first column USER_GID includes links or is a link column.
How do i change the color of the link?
Here column USER_ID contains links.
So 23, is a link and i want to change its color to blue.
So the links are distinguished.
How can i do that?
Apex 20.2
As I don't have your table, I used Scott's EMP. The idea is: if DEPTNO column represents a link (I used the one to Google), paint it differently for each department number.
Interactive report's query would then look like
select
'<a href="https://www.google.com" style="color:' ||
case when deptno = 10 then 'red'
when deptno = 20 then 'green'
else 'pink'
end ||
'">' || deptno || '</a>' detpno,
--
empno, ename, job
from emp
order by ename
Don't forget to set deptno column's "Escape special characters" property to "No".
The result is then
Good day,
I am running orcl apex 20.2. I have a tree region with a simple table: id, title, parent_id.
I am struggling with the JS to get the selected node id, and store it in a page item. My JS skills are very week. I have been trying to use a dynamic Action to execute JS and use a treeNodeAdapter, but the object returned is a jQuery object. I have no idea what to do at that point.
Given the table above, can someone please write back the exact JS I would need in the DA to capture the selected id and save it to the page item...
Pls & thnx
Nikita
Here's how (based on Scott's EMP table).
Suppose it is page 70 which contains the tree region. Create a page item on it (for example, P70_EMPNO).
The tree query looks like this (pay attention to the link column; once clicked, it stores the selected node value into the P70_EMPNO page item):
select
case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status,
level,
ename || ' (' || empno ||')' as title,
'icon-tree-folder' as icon,
empno as value,
ename as tooltip,
--
'javascript:$s(''P70_EMPNO'', '''||EMPNO||''')' as link --> this
from emp
start with mgr is null
connect by prior empno = mgr
order siblings by ename;
The result (when you click on the JAMES node):
P.S. It looks that your keyboard is broken; quite a few letters are missing.
I am currently using apex 19.1. I have this problem where I can't (or don't know how to) select certain columns from checkbox meaning I have this checkbox
which gives me the ability to check the columns names I want to use that output (:P3_COLUMN) from the check box to select a specific columns in a table. My solution was :
select :P3_COLUMN
from INPUT_TABLE$
I also tried :
select case :P3_COLUMN when 'currency' then currency when 'nationality' then nationality end as test from input_table
which gave me this output
and
DECLARE
str varchar2(100);
BEGIN
str := 'select ' || replace(:P3_COLUMN, ':', ',') || ' from input_table';
execute immediate str;
END;
which gave me this error
I don't know what to do, any help will be really appreciated.
Here's a walkthrough (my page is #51). Suppose that we want to display some column from Scott's DEPT table.
create a region whose type is classic report
create a page item (let's call it P51_COLS which is a select list item; its source is a query which looks like this:
select column_name d,
column_name r
from user_Tab_columns
where table_name = 'DEPT'
Page action on selection should be "Submit page"
region's source should be a PL/SQL function body that returns a SQL query and look like this:
return 'select case when :P51_COLS = ''DEPTNO'' then to_char(deptno )
when :P51_COLS = ''DNAME'' then dname
when :P51_COLS = ''LOC'' then loc
end as result
from dept';
Its "Page items to submit" should be set to P51_COLS
That's it ... run the page; select any column from the select list item and the result should be displayed.
Yes, I know - the query itself looks stupid as you have to name all cases. For some reason, Apex expects literally return 'select ...' statement. Concatenation, replace function, ... won't work. Perhaps someone knows why or - even better - can demonstrate how to workaround it. Meanwhile, try what's been written above.
first option use server side condition on the columns.
second option use dynamic sql> create function returns sql statement> call the function in your region source.
APEX 4.2. I have Select List on form, based on query:
SELECT empno || ' ' || ename AS d, empno AS r
FROM emp
When select list expanded there two concatenated fields displayed.
But when some value selected and list collapsed I need only Ename displayed on form. So I need only JONES on pic 2 without number. Of course, return value must be empno anyway.
[EDIT] I mean I need both Empno and Ename displayed when Select List opened, only Ename displayed when it collapsed and always Empno returned.
Try adding another textfield to catch the name and place it over the select list.so every time you select an item, the value displayed is controlled in a separate container. You can try it by doing this:
Aside from the SELECT LIST ITEM you have created. Add another TEXTFIELD.
Then on the Main Page under Javascript > Execute when Page Loads
Paste this code:
$('#P5_SELECT_CONTAINER div:nth-child(2)' ).append($('#P5_TEXT'));
var s_width = Number($('#P5_SELECT').css("width").replace("px",""));
$('#P5_TEXT').css({"width":(s_width-22)+"px","position":"relative","right":s_width+"px","pointer-events":"none"});
But first youll be needing the name/id of your select list and the textfield you created. For this code,
select list id = P5_SELECT
textfield id = P5_TEXT
Just replace them(selectlist and textfield id) with what you already have.
Then create a dynamic action
EVENT = Change
SELECTION TYPE = ITEM
ITEM = P5_SELECT (or in your case Name of your SELECT LIST)
ACTION = EXECUTE JAVASCRIPT
then paste this code
var sel = $('#P5_SELECT option:selected').text();
var substr_sel = sel.substr(sel.indexOf('-')+1).trim();
$s('P5_TEXT', substr_sel);
console.log($v('P5_TEXT')); -- just to check if return is correct.
NOTE:just play with the width so that only the up/down arrow of the select list is displayed.
Hope this Helps
I have created a view as
create or replace view view_emp as
select empno, ename, job
from emp;
and I want to query view_query with non column in view.
select empno, ename
from view_emp
where deptno=10;
When Im trying to query like this it is giving me an error saying
ORA-00904: "TEST_EMP"."DEPTNO": invalid identifier
I have a requirement like this example. Could any one can give me solution for my requirement.
Actually I work on ERP Solutions Inventory Modules.
I have a requirement to find the unit wise , prodct wise stock opening balance and closing balance in date range.
I want a view like
create view stk_bal
as
select unit_code,prod_code, sum(opening_bal) opening_bal, sum(closing_bal) closing_bal
from
(
select unit_code, prod_code, ob_qty opeing_bal, 0 closing_bal
from (table 1) join (table 1.1)
where crtd_date between '02-feb-2013' and '02-mar-2013'
union all
select unit_code, prod_code, 0 , grn_qty
from (table 2) join (table 2.1)
where grn_date between '02-feb-2013' and '02-mar-2013'
union all
select unit_code, prod_code, 0, stk_transfer_in_qty
from (table 3) join (table 3.1)
where stk_trnin_date between '02-feb-2013' and '02-mar-2013'
)
group by unit_code, prod_code;
and I created view by making union all with 3 set of tables where i had hardcoded the dates
But i want to query the view in date range which has no date column in it.
Now I want to query the the view stk_bal in the date range.
You need to add deptno in your view definition:
create or replace view view_emp as
select empno, ename, job
,DEPTNO
from emp;
But of course, the real question is: what exactly is your requirement and why do you need a view.