Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with default row selector checkbox in tabular form

721597Sep 19 2009 — edited Sep 20 2009
Hello,

Can anyone help me out with this issue.

This is my table structure

CREATE TABLE "OEHR_LOCATIONS"
( "LOCATION_ID" NUMBER(4,0),
"STREET_ADDRESS" VARCHAR2(40),
"POSTAL_CODE" VARCHAR2(12),
"CITY" VARCHAR2(30) CONSTRAINT "OEHR_LOC_CITY_NN" NOT NULL ENABLE,
"STATE_PROVINCE" VARCHAR2(25),
"COUNTRY_ID" CHAR(2),
"FLAG_INDICATOR" NUMBER DEFAULT 1,
CONSTRAINT "OEHR_LOC_ID_PK" PRIMARY KEY ("LOCATION_ID") ENABLE
)
/

I have a column in my my table which is a flag_indicator of number datatype with default value of 1.

So i just want to update this field and set it to 0 whenever an user tries to select a row(by checking the checkbox i.e; the default row selector) and clicks a button in the tabular form.

I just want to update the column flag and set it to 0 whenever user tries to click a button i.e; only for the checked records throught the row selector(checkbox) in the tabular form.

So for this I have created a pl/sql page process with the foll owing code. f02 is column id for my primary key column LOCATION_ID.

MyProcess:

begin
for i in 1..apex_application.g_f02.count
loop
if apex_application.g_f02(i) is not null
then
update oehr_locations
set flag_indicator=0
where location_id=apex_application.g_f02(i);
end if;
end loop;
commit;
exception
when others then
null;
end;

After the above process executes. I want to display only the records whose flag_indicator is set to 1.For this below is my tabualr form report query.

select
"LOCATION_ID",
"STREET_ADDRESS",
"POSTAL_CODE",
"CITY",
"STATE_PROVINCE",
"COUNTRY_ID",
"FLAG_INDICATOR"
from "#OWNER#"."OEHR_LOCATIONS"
WHERE FLAG_INDICATOR=1

after executing the report I have got a problem, like whenever I tried to select the row single or multiple (by checking the row selector checkbox) in the tabular form and then clicked the button, the process "MyProcess" is updating all the records in my first page(like say if i am displaying 15 rows im my first page) and setting the flag_indicator column to 0. I am not able to understand the problem.

Can anyone plz help me out with this.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2009
Added on Sep 19 2009
1 comment
733 views