Updating the recoed based on the value of check box
I have a form which has a check box for each record.
I want to update the values of the checked records.
Enclosing my code below:
htp.htmlOpen;
htp.headOpen;
htp.title ('Out Details Form');
htp.headClose;
htp.bodyOpen;
htp.header (1,'Out Details Form');
htp.formOpen ('RSA.UPDATE_OUT_RECORDS');
br_code := substr(PORTAL.wwctx_api.get_user(),1,2);
product_code := upper(p_product_code);
for each_rec IN ref_cursor (p_date,br_code,product_code)
loop
htp.p(each_rec.ref_no);
htp.p(each_rec.name);
htp.p('<input type = "hidden" name ="p_ref_no" value = '||each_rec.ref_no||'>');
htp.p ('<input type = "checkbox" name = "p_cd" >');
htp.p ('<br>');
end loop;
htp.p('<br>');
htp.p ('Courier Name');
htp.p('<input type = "text" name ="p_courier">');
htp.p('Courier Number');
htp.p('<input type = "text" name ="p_courier_no">');
htp.p('Destination Branch Code');
htp.p ('<input type = "text" name ="p_branch">');
htp.p('<br>');
htp.formSubmit ('Submit');
htp.bodyClose;
htp.htmlClose;
end;
my update procedure is given below
Create or Replace PROCEDURE RSA.UPDATE_OUT_RECORDS
p_ref_no IN PORTAL.wwv_utl_api_types.vc_arr,
p_cd IN PORTAL.wwv_utl_api_types.vc_arr,
p_courier IN VARCHAR2,
p_courier_no IN VARCHAR2,
p_branch IN VARCHAR2,
submit IN VARCHAR2
as
begin
for i in 1..p_ref_no.count loop
htp.p(p_ref_no(i));
update RS_MIMO_TRANSACTIONS
set RS_MIMO_TRANSACTION_TO_PLACE = p_branch,
RS_MIMO_TRANSACTION_OUT_TIME = sysdate,
RS_MIMO_TRANSACTION_COURIER_NO = p_courier_no,
RS_MIMO_TRANSACTION_COUR_NAME = p_courier
where RS_MIMO_TRANSACTION_REF_NO = p_ref_no(i);
commit;
end loop;
exception
when others then
null;
end;
When I ran the above all the records are getting updated
even if I have not clicked the check box.
Please help me how to check the value of the checkbox in the UPDATE_OUT_RECORDS procedure and updating those records for which the check box is clicked.
You can declare one more dummy variable in your procedure to be used as checkbox field in your form and with some javascript code you can set the value 'Y'(es) or 'N'(o) in the original variable which you can refer it in your update procedure to update values in the table. Here is the sample code how you can do this:
declare
lv_string varchar2(32767);
li_ind integer;
begin
lv_string := '<SCRIPT LANGUAGE="JavaScript">
function set_chkbx_value(row_num){
SampleForm.p_yes_no[row_num].value = (SampleForm.p_dummy_chkbx[row_num].checked)?"Y":"N";
</SCRIPT>';
lv_string := lv_string ||'<BODY>
<CENTER>
<form name=SampleForm action="p_update_table" METHOD="POST" ENCTYPE="multipart/form-data">
<div align="center">
<center><TABLE>
<TD align="center"><TABLE BORDER="1" CELLSPACING="2" CELLPADDING="0">
<BR><TR>
<TH><b><font STYLE="font-family:Tahoma; color:brown; font-size:9pt;">Name</font></b></TH>
<TH><b><font STYLE="font-family:Tahoma; color:brown; font-size:9pt;">Salary</font></b></TH></TR><TR>';
For li_ind in 1..10 Loop
lv_string := lv_string ||'<TR><TD ALIGN=middle><INPUT TYPE=text SIZE="20" NAME="p_name" MAXLENGTH = "30" >
<INPUT TYPE=text SIZE="10" NAME="p_salary" MAXLENGTH = "30" >
<TD ALIGN=middle><INPUT TYPE=checkbox SIZE="1" NAME="p_dummy_chkbx" OnClick="set_chkbx_value('||(li_ind - 1)||')"></TD>
<INPUT TYPE="hidden" NAME="p_yes_no"></TR>';
End Loop;
lv_string := lv_string ||' </TABLE></CENTER>
<h2 align="center">
<INPUT TYPE="Submit" VALUE="SAVE">
<input type="reset" value="RESET"><h2>
</TABLE>
</FORM>
</BODY>';
htp.p(lv_string);
end;
Create or Replace PROCEDURE p_update_table
p_name IN PORTAL.wwv_utl_api_types.vc_arr,
p_salary IN PORTAL.wwv_utl_api_types.vc_arr,
p_dummy_chkbx IN PORTAL.wwv_utl_api_types.vc_arr,
p_yes_no IN PORTAL.wwv_utl_api_types.vc_arr
as
begin
for i in 1..p_name.count loop
If p_yes_no(i) = 'Y' Then
update emp
set sal = p_salary(i)
where ename = p_name(i);
commit;
end loop;
exception
when others then
null;
end;
Similar Messages
-
How to implement Check box in the Rtf based on the value from XML datafield
Hello All ,
It would be great if any one can help me in implementing check box in the rtf based on the data filed value from the XML data.
I need to get in the out put checked boxes like what we say Radio button Yes or No ( If Yes it should be marked ).
If any one worked on this please help us...
Thanks in Advance...Did you check the user guide,
we have a section over there :)
http://blogs.oracle.com/xmlpublisher/2007/05/22 -
Get value from the array based on the HashCode
public static void runJoin(int[][] t1,int[][] t2)
PrintWriter out=null;
int rows = 1000;
int cols = 7;
int [][] myTable3 = new int[rows][cols];
int x = 0;
System.out.print("Running HashJoin:Method loads the "+
"smaller table in the memory and applies a hashing function "+
"to common column and stores it in another table. "+
"The larger table is then read from the file. "+
"The same hashing function is applied to Col n of the table and a matching record in the first table is looked up. A match will create a row in Table 3. ");
//Apply hashing function to smaller table and store it in the memory.
Integer[] It2 = new Integer[t2.length];
int [] hashCodest2 = new int[t2.length];
Hashtable ht = new Hashtable();
for(int i =0; i <t2.length;i++){
It2[i] = new Integer(t2[0]);
hashCodest2[i] = It2[i].hashCode();
ht.put(new Integer(hashCodest2[i]),It2[i]);
//Larger table get hashcodes
Integer It1[] = new Integer[t2.length];
int [] hashCodest1 = new int[t2.length];
for(int j =0; j <t1.length;j++){
It1[j] = new Integer(t1[j][4]);
hashCodest1[j] = It1[j].hashCode(); }
//Based on the hashcode get the value from the Table2;
try{
out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
Enumeration e = ht.keys();
while(e.hasMoreElements())
//How do I get the value from the array based on the HashCode? Do I need to do a loop here???
hashCodes1.get(e.nextElement());
}catch(Exception e){}ok I got it......
//Apply hashing function to smaller table and store it in the memory.
Integer[] It2 = new Integer[t2.length];
int [] hashCodest2 = new int[t2.length];
Hashtable ht = new Hashtable();
for(int i =0; i <t2.length;i++){
It2[i] = new Integer(t2[0]);
hashCodest2[i] = It2[i].hashCode();
ht.put(new Integer(hashCodest2[i]),It2[i]);
//Larger table get hashcodes and compare
Integer It1[] = new Integer[t2.length];
int [] hashCodest1 = new int[t2.length];
Hashtable ht2 = new Hashtable();
for(int j =0; j <t1.length;j++){
It1[j] = new Integer(t1[j][4]);
hashCodest1[j] = It1[j].hashCode();
ht2.put(new Integer(hashCodest1[j]),It1[j]);
//Based on the hashcode get the value from the Table2;
try{
out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
Enumeration e = ht.keys();
Integer t3[] = new Integer[t2.length];
while(e.hasMoreElements())
t3[x] = (Integer) ht2.get(e.nextElement());
x++;
}catch(Exception e){} -
Update a table based on Min value of a column of a Another Table.Pls Help.
Dear All,
Wishes,
Actually I need update statement some thing like below scenario...
Data in table is like below:
I wrote a query to fetch data like below ( actually scenario is each control number can have single or multiple PO under it ) (i used rank by to find parent to tree like show of data)
Table: T20
Control_no P_no Col3
19950021 726473 00
19950036 731016 00
19950072 731990 00
731990 01
19950353 734732 00
734732 01
19950406 736189 00
736588 01
736588 02
736588 03
Table : T30
Control_no P_no col3
19950021 726473
19950036 731016
19950072 731990
731990
19950353 734732
734732
19950406 736189
736588
736588
736588
Now requirement is I need to update Table T30's col3 (which do have values in T20 but not this table) in such a way that , It should take MIN (COL3) from T20 and then update that value to related Col3)
Better I can explain through below new data format in T30 after update:
After update it should like:
Table : T30
Control_no P_no col3 (this is updated column)
19950021 726473 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950036 731016 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950072 731990 00 -- see here..both Pno should updated as '00' as MIN value col3 in Table T20 related to this
731990 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950353 734732 00 -- same again both Pno should updated as '00' as MIN value col3 in TableT20 related to this
734732 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950406 736189 00 -- As there is single col3 value in T20, 00 should be updated here.
736588 01 -- Here it should update col3 as '01' since for this pno(736588)
736588 01 -- Here too it should update col3 as 01 per requirement ,minimum value of this pno in T20
736588 01 -- same here too.. Sorry if my post formatting is not good...
Hope i am clear in my requirement..(update T30 col3 based on min value of col3 of related records)
Please suggest some update sql for this...(ideas would be great)
I am using oracle 10 g version soon will be migrated to 11g..
Regards
Prasanth
Edited by: Onenessboy on Oct 20, 2010 12:13 PM
Edited by: Onenessboy on Oct 20, 2010 12:15 PMOnenessboy wrote:
I am really sorry, my post so nonsense in look..
I used to use for actuall code..
the out put i tryped, i used [pre] , [/pre] but still does not look good..
hmm..thanks for your suggestion hoek..
so any ideas about my requirement...I would suggest spending a bit more time trying hoek's suggestion regarding {noformat}{noformat} tags instead of repeatedly asking for more help.
Because to understand your requirement, people are going to have to read it first. -
Is it possible to find the table based on the Date ?
Dear Team ,
Is it possible to find the table based on the Date ?
I have created an table ,But forgot the Table Name .
Is it possible to find the Tables created on particular Date .
Regards ,
Augustineas date is record the time also below query will work.
select * from user_objects
where
object_type = 'TABLE' and
to_date(created,'DD-MON-YYYY') =to_date('<your date value in DD-MON-YYYY format>','DD-MON-YYYY');
Edited by: shaileshM on Feb 24, 2010 9:39 PM -
How to control the measure based on the related dimension.
Hi Experts,
In order to improve performance, I have created three kinds of time tables in DB,such as Year .Month, Day.
Then import them into the physical layer in RPD, and combine them into one dimension in BMM.
Actually, it has three level fact related with three time tables,so they are also dragged into one fact in BMM,and one column will be corresponding with three column derived from different Fact table in physical layer.
So I want to know how to control the measure based on the related dimension.
For example:
when users drag the Year,Sales column, it will come from Year Dimension and Year Fact Table.
when users drag the Month,Sales column, it will come from Month Dimension and Month Fact Table.
when users drag the Day,Sales column, it will come from Day Dimension and Day Fact Table.Hi,
Create a dimension Hierarchy, with Year >> Month >> Day Levels and
Next Double click on Year Table LTS >> click on Ocntetnt Tab >> set as Year
same way for Month LTS and Day LTS.
So now when you select year column then server canknow which LTS to hit and Hits Year LTS.
Mark If Helpfu/correct
Thanks. -
How to Handle and show multiple pushpin imgaes on the map based on the requirement at different coordintes?
I have multiple images in my App folder. I want to use and show those images dynamically in windows phone 8 map applicationThere are a lot of different ways to do this. One simple method is to use a switch statement when creating your pushpins and based on some property in your data, select the icon you want to use and create your pushpin accordingly.
http://rbrundritt.wordpress.com -
I've to extract the data based on the sysdate...like today dd is 11,
BM_PERF is the table name and
BM_PERF_YR,BM_PERF_MONTH,BM_NOP_CT_1........BM_NOP_CT_31 are the column names.
I've to extract the data based on the sysdate...like today dd is 11
so i've to get data from BM_NOP_CT_11 and the column names changes dynamically based on the sysdate. don't use any procedures and functions.You could always pivot it into a more convenient form for querying:
WITH t1 AS
( SELECT 2008 AS yr, 4 AS mnth
, 20 AS dy1
, 10 AS dy2
, 15 AS dy3
, 1 AS dy4
, 17 AS dy5
, 99 AS dy6
, 55 AS dy7
, 45 AS dy8
, 33 AS dy9
, 22 AS dy10
, 74 AS dy11
, 35 AS dy12
, 62 AS dy13
, 24 AS dy14
, 85 AS dy15
FROM dual )
, t2 AS
( SELECT yr
, mnth
, sys.DBMS_DEBUG_VC2COLL
(dy1,dy2,dy3,dy4,dy5,dy6,dy7,dy8,dy9,dy10,dy11,dy12,dy13,dy14,dy15)
AS day_data
FROM t1 )
SELECT t2.yr, t2.mnth, sys_op_ceg(t2.day_data,5) day_value
FROM t2;
YR MNTH DAY_VALUE
2008 4 17
1 row selected.Note that SYS_OP_CEG (first discovered by Padders) is undocumented and unsupported - for production code you'd need to pick the collection row using a WHERE clause, and for that you'd need a custom object and collection type with an attribute to hold the day number.
Message was edited by:
William Robertson
...like this:
CREATE TYPE id_value_ot AS OBJECT
( id INTEGER, val NUMBER );
CREATE TYPE id_value_tt AS TABLE OF id_value_ot ;
WITH t1 AS
( SELECT 2008 AS yr, 4 AS mnth
, 20 AS dy1
, 10 AS dy2
, 15 AS dy3
, 1 AS dy4
, 17 AS dy5
, 99 AS dy6
, 55 AS dy7
, 45 AS dy8
, 33 AS dy9
, 22 AS dy10
, 74 AS dy11
, 35 AS dy12
, 62 AS dy13
, 24 AS dy14
, 85 AS dy15
FROM dual )
, t2 AS
( SELECT yr
, mnth
, id_value_tt
( id_value_ot(1,dy1)
, id_value_ot(2,dy2)
, id_value_ot(3,dy3)
, id_value_ot(4,dy4)
, id_value_ot(5,dy5)
, id_value_ot(6,dy6)
, id_value_ot(7,dy7)
, id_value_ot(8,dy8)
, id_value_ot(9,dy9)
, id_value_ot(10,dy10)
, id_value_ot(11,dy11)
, id_value_ot(12,dy12)
, id_value_ot(13,dy13)
, id_value_ot(14,dy14)
, id_value_ot(15,dy15) )
AS day_data
FROM t1 )
SELECT yr, mnth, dd.val
FROM t2, TABLE(t2.day_data) dd
WHERE dd.id = 5;
YR MNTH VAL
2008 4 17
1 row selected. -
Filter the report based on the date
Hi Experts,
i am working with alv report, I need filter the records based on the field.
So i tried like this.
data : t_filter TYPE slis_t_filter_alv,
w_filter TYPE slis_filter_alv.
W_FILTER-FIELDNAME = 'WERKS'.
W_FILTER-SIGN0 = 'I'.
W_FILTER-OPTIO = 'BT'.
W_FILTER-VALUF_INT = '1003'.
W_FILTER-VALUT_INT = '1007'.
APPEND W_FILTER TO t_FILTER.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER = t_filter
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
But it is was not get the output,
Pls help me how to write the code to filter the recodes.
if any one post the code.
Please help me.
Thanks Advance
IT_EVcheck the documentation of the fm
Table with filter criteria
Using this parameter, you can pass on filter criteria resulting from explicitly loading a display variant in advance, for example, to list output.
This table should never be set up 'manually'.
check these programs
BCALV_TEST_FULLSCREEN_FILTER
BCALV_TEST_LIST
Thanks
Bala Duvvuri
Edited by: Bala Duvvuri on Oct 24, 2010 10:41 PM -
How do you send an email to a specific person based on if a particular check box is checked?
How do you send an email to a specific person based on if a particular check box is checked?
Try the LiveCycle Designer forum.
-
Without refresh value in Check box
hi,
i have one select list class name .now i want the value into check box without refresh .
when i select class name then corresponding subject name should come in to check box item.
How can i do this.
Thanks
Manoj
Edited by: Manoj Kaushik on Oct 11, 2009 3:45 AMhi,
i have a select list class_name with value 1,2,3,4,5 .i have a subject table .
CLASS_SUBJECT_DETAILS
SUBJECT_CODE SUBJECT_NAME CLASS_NAME
ENG --------- ENGLISH------------------------ 1
EORL------- ENGLISH ORAL--------------- 1
HIN--------- HINDI---------------------------- 2
M.E---------- MORAL EDUCATION----------- 2
MAT--------- MATH----------------------------- 3
MAT--------- MATH----------------------------- 4
PED---------- PHYSICAL EDUCATION --------4
SS------------ SOCIAL STUDY------------------ 4
SCI----------- SCIENCE--------------------------- 4
PHY---------- PHYSICS-------------------------- 6
CPRC---------CHEMISTRY PRECTICAL------- 7
ENG--------- ENGLISH-------------------------- 8
HORL---------HINDI ORAL--------------------- 1
HIN---------- HINDI------------------------------ 6
ENG ENGLISH---------------------------------- 6
Now here when i select class_name '1' in select list then subject name ENGLISH,ENGLISH ORAL,HINDI ORAL corresponding to class_name '1' should be come in to check box item.(without refresh)
How can i do this. -
How to capture the entries based on filter values in oo alv..
Hi all,
I have a scenario in my oo alv report, when the user select the any column on report and selects the filter option. In that the user can enters required values. Based on filter values the output will be displayed. Now how can i capture currently displaying entries on report.
Thanks,
AshokHi Jozef,
Is that GET_FILTERED_ENTRIES( ) reads the indexes or values from the entries..?
Thanks,
Ashok -
Passing DB values to the textbox based on Select Value item
Hi,
I am very much new to the Oracle APEX. In my project, I have a requirement wherein I have to pass the different values to the corresponding textboxes on a different page based on the value I select from the "Select Value" item.
I have tried using calling On-Demand Processes, but couldn't get the desired result.
Please suggest!Hi 796444 ,
Welcome to the forum. It will be good if you familiarize yourself with the forum ettiquittes. Also, when posting always state the following:
a. Apex version
b. DB version
c. Web server ; EPG, apexlistener, etc
d. Provide adequate details for others to understand your problem / what you are trying to achieve.
e. Any code snippets you post should be enclosed in a pair of tags
If your current problem is that the you are *calling* Page 2 from Page 1, and while doing so you want the value of P1_ITEM1 to be passed and set in p2_ITEM1 then
a. Edit the branch
b. In Action in Set these items write P2_ITEM1
c. In With these values write &P1_ITEM1. (do not miss the dot at the end)
It looks good if you use a better handle than 796444 :-)
Regards, -
How to increase the salary based on the percentage value
Hi All,
Could you please let me know which API need to be used to implement the hike in salary based on the percentage value. And what all the parameters to be used.
Appreciate your help...
Thanks...Dear All,
Any luck on this please?
thanks.. -
Display Dataset field Value in the footer based on the Group
Hi Guys,
My current SSRS report is displaying multiple projects data. One Project data is rendering into 1 or 2 pages based on the project specific data.
Now, the requirement here is to display the "ProjectName" in the footer of the SSRS report in below format. For instance, if project A data is rendering in 2 pages then the footer in two pages should display project Name A and in the
third page it shows display the Project Name b in the footer of the report.
ProjectName [Insert Reporting Month] Page
# of #
Has anyone come across such requirement. Thanks.
Warm Regards Badal RatraHi Badal,
In SQL Server Reporting Services (SSRS), we cannot use the “Project” filed without specifying a dataset aggregate in page footer. However, we can display the item value in the page footer. Please refer to the following steps:
Add a list in the report. Configure this list with the corresponding dataset.
Configure the list “Group on:” ProjectName.
Add the tablix in the list, add page break “Between each instance of a group” of the list.
Add a text box (TextBox1) with expression below:
=Fields!ProjectName.Valu
Set the visibility of the text box to Hide.
Add a text box in the page footer fill with following expression:
=ReportItems!TextBox1.Value
If you have any questions, please feel free to let me know.
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support
Maybe you are looking for
-
Selection screen texts missing
Hi friends, I am working on a BDC program and when I execute my program, I see that the texts are missing in the selection screen. Can anyone tell me what should be done in order to display the texts in the selection screen in BDC. Thanks, RAJ.
-
Can the brushes be mapped to the area below the viewer window?
I have sent in a recommendation to map the brushes individually so you don't have to select the brush icon then the brush you want. But I am just wondering if there is a way somewhere to do this and I just don't know about it? I would like to map the
-
When trying to open adobe get message internal error occured.
What do I need to do to fix my internal error issue?
-
HttpServletRequest : How to stop it ?
Hi everybody, I am implementing a server-side solution in ordre to prevent the "double click button" by a user. Indeed, when a user clicks on a button, there is a filter that puts a session variable to true telling that a treatment is in progress. An
-
Not able to view "search for jobs " in ESS
hi , i am facing a problem in <b>ESS --> Career and Jobs -->search for jobs.</b>when i go to "search for jobs" i get a pop up window asking for the "application name" and some other mandatory parameters. i have already defined the job vacancy in the