|  | 
	|  | 
	| 
		
			| Re: Update statement not working with Row selector [message #565778 is a reply to message #565612] | Thu, 06 September 2012 11:32   |  
			| 
				
				|  | tinkuvinay Messages: 9
 Registered: December 2011
 Location: Dallas
 | Junior Member |  |  |  
	| I was able to figure the solution for my problem. When this application was build in older version of apex (in 3.2.1), the select query has HTMLDB_ITEM.checkbox (1,pk_column_name,null) check_to_select. And Since this didn't worked(select all box didn't worked) in the new 4.1 apex version, instead of removing this line from query, I added a row selector from the apex tool which worked for me. Now I had both the row selector and the check box column from the query. Some how this didn't worked and when I select more than certain number of rows, I used to get the 400 Bad Request Error. 
 Now the other part of this problem is, after selecting the records, when I push the button to update the records, it isn't working. Since the earlier query has the check box replaced by the primary key column, the pk column value is used to update. Now I want to update the record based on the rownum of the selected records.
 |  
	|  |  | 
	| 
		
			| Re: Update statement not working with Row selector [message #565809 is a reply to message #565778] | Thu, 06 September 2012 14:12  |  
			| 
				
				|  | Littlefoot Messages: 21826
 Registered: June 2005
 Location: Croatia, Europe
 | Senior MemberAccount Moderator
 |  |  |  
	| Is it a complex page? Could you rewrite it now that you're on Apex 4.1? I'm far from being an expert here (that's probably why I have such a stupid idea) but - from my own experience - I found out that sometimes it is easier to rewrite it from scratch than to fix something. Certainly, if there are many validations, processes, whatever, you might miss something and cause even more problems than you have now so - think twice. 
 Anyway: by default, tabular form's "Apply changes" button works just fine and updates fields you changed. I don't know what might cause it not to work correctly. Not to mention what to do in order to fix the fact that "check box was replaced by the primary key column".
 
 If you insist, you might try to manually do the update. You'd do that by looping through all records; something like this:
 
 for i in 1..APEX_APPLICATION.G_F05.count loop
  if APEX_APPLICATION.G_F05(i) = 1 then      -- checkbox checked
     update your_table set
       some_column = APEX_APPLICATION.G_F02(i)
       where some_id = APEX_APPLICATION.G_F01(i);
  end if;
end loop;G_Fxx represent editable page fields (you'll find much more information in documentation).
 [Updated on: Thu, 06 September 2012 14:13] Report message to a moderator |  
	|  |  |