Tuesday, May 28, 2019

how to update data from apex report to database


select PID,
"ITEMCODE",
"ST_DT",
"USER_ID",
"STATUS" STTS,
apex_item.hidden(1,PID)||apex_item.text(42,remk) remk,
apex_item.checkbox(
p_idx => 43   --f43
,p_value => ROW_NUMBER() OVER (ORDER BY PID)
,p_ATTRIBUTES => NULL   --NOT CHECKED
) CHK
from "#OWNER#"."PRODUCT_CHK"
 
--apex_item.checkbox(1, "PID"||"ST_DT") Check1 , "PID",

page process 

declare
la_checked apex_application_global.vc_arr2;
procedure align_checkboxes
(
p_nbr_records          in  pls_integer,
p_html_checkboxes      in  apex_application_global.vc_arr2,
p_expanded_checkboxes  out apex_application_global.vc_arr2

--takes a dens list of checkbox selections of row numbers from html submission
--and convert to the number of elements as other arrays within the form
--eg: 5 records, 3rd record checked will only have p_html_checkboxes(1)=3
--this will return p_expanded_checkboxes(3)='Y' the rest 'N'
) is

begin
<<prime>>
for i in 1..p_nbr_records loop
p_expanded_checkboxes(i):='N';
end loop  prime;

<<align>>
for i in 1..p_html_checkboxes.count loop
p_expanded_checkboxes(p_html_checkboxes(i)):='Y';
end loop align;
end align_checkboxes;
begin

align_checkboxes(
apex_application.g_f01.count,   --hidden filed
apex_application.g_f43,         --dense checkboxes heading in
la_checked);                    --sparse array comming out

<<html_array>>

for i in 1..apex_application.g_f01.count
loop
if la_checked(i)='Y' then
update product_chK
set status='1' , remk=apex_application.g_f42(i)
where pid=TO_number(apex_application.g_f01(i));
end if;
end loop html_array;
apex_application.g_print_success_message :=apex_application.g_f43.count||'products update.';
end;

Sunday, May 26, 2019

url sql query in oracle apex

--apex_util.prepare_url('f?p=' ||:APP_ID||':'||PAGE_ID||':'||:APP_SESSION|| '') as url

select 'Weekly Project' label, count(Project_no) value,apex_util.prepare_url( 'f?p='||:APP_ID ||':104:'||:APP_SESSION||':::' ) as url
from project_information
    where followup_person=:APP_USER
    and  TO_DATE(TO_DATE(PROJECT_INFORMATION.WK_DT,'DD-MON-RR HH24:MI:SS'),'DD-MON-RR') BETWEEN (to_date(sysdate)-6) AND to_date(sysdate)
union all
SELECT 'Monthly Project' label,count(Project_no) value,apex_util.prepare_url( 'f?p='||:APP_ID||':103:'||:APP
_SESSION||':::' ) as url
from project_information
where TO_DATE(TO_DATE(PROJECT_INFORMATION.WK_DT,'DD-MON-RR HH24:MI:SS'),'DD-MON-RR') BETWEEN add_months(to_date(sysdate),-1) AND to_date(sysdate)
and followup_person=:APP_USER
union all
select 'Total Project' label, count(Project_no) value,apex_util.prepare_url( 'f?p='||:APP_ID||':102:'||:APP_SESSION||':::' ) as url
    from project_information
where followup_person=:APP_USER


Tuesday, May 7, 2019

add pdf file in oracle apex region with download option

1. first upload  -->> Static Application Files or Static Workspace Files 
    copy (#WORKSPACE_IMAGES#FW Sales Incentive Plan.pdf)
2. Source
<div style="width:500px;height:600px;">
<embed height="100%" width="100%" name="embed_content" src="#WORKSPACE_IMAGES#FW Sales Incentive Plan.pdf" type="application/pdf" />
</div>

add state image in oracle apex region

1. first upload  -->> Static Application Files or Static Workspace Files
2. Source
<img src="#APP_IMAGES#Screenshot_1.jpg">

or

<img src="#WORKSPACE_IMAGES#Screenshot_1.jpg"> 



Thursday, May 2, 2019

html link in sql

select  'Edit Project Information'  as "Edit Project", '<a href="f?p=' ||100||':'||3||':'||:APP_SESSION|| '">"Edit Project Information"</a>' as "Edit Project Information" , to_number('1') as slno  from dual
union all
select  'Edit Project Follow Up'    as "Edit Project",'<a href="f?p=' ||100||':'||20||':'||:APP_SESSION|| '">"Edit Project Follow Up"</a>' as "Edit Project Follow Up"  , to_number('2') as slno  from dual
union all
select  'Edit Project Contraction'  as "Edit Project",'<a href="f?p=' ||100||':'||5||':'||:APP_SESSION|| '">"Edit Project Contraction"</a>' as "Edit Project Contraction"  , to_number('3') as slno  from dual
union all
select  'Edit Project Sampling'     as "Edit Project" ,'<a href="f?p=' ||100||':'||12||':'||:APP_SESSION|| '">"Edit Project Sampling"</a>' as "Edit Project Sampling"  , to_number('4') as slno from dual
union all
select  'Edit Project Requirement'  as "Edit Project" ,'<a href="f?p=' ||100||':'||38||':'||:APP_SESSION|| '">"Edit Project Requirement"</a>' as "Edit Project Requirement" , to_number('5') as slno  from dual
union all
select  'Edit Project Projection'   as "Edit Project" ,'<a href="f?p=' ||100||':'||24||':'||:APP_SESSION|| '">"Edit Project Projection"</a>' as "Edit Project Projection"  , to_number('6') as slno from dual
union all
select  'Edit Project Approval'     as "Edit Project",'<a href="f?p=' ||100||':'||14||':'||:APP_SESSION|| '">"Edit Project Approval"</a>' as "Edit Project Approval"  , to_number('7') as slno  from dual
union all
select  'Edit Project Delivery'     as "Edit Project",'<a href="f?p=' ||100||':'||16||':'||:APP_SESSION|| '">"Edit Project Delivery"</a>' as "Edit Project Delivery"  , to_number('8') as slno  from dual
order by slno


Security

Required
Escape special characters

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...