Home » Developer & Programmer » Forms » Updating a data block (Oracle 8i, Developer 6i, Windows 2000)
Updating a data block [message #328838] Mon, 23 June 2008 00:56 Go to next message
hammad83
Messages: 36
Registered: June 2008
Location: Pakistan
Member
Hi all

I have a problem in updating a data block which is not a Database Block. I want to update whatever changes are made in the data block after displaying the data in it. When I update the data displayed in the data block, it updates only the first row in the block and leave other rows as they were before. Can anyone help me in that?

Thanks

Hammad
Re: Updating a data block [message #328871 is a reply to message #328838] Mon, 23 June 2008 03:21 Go to previous messageGo to next message
durgadas.menon
Messages: 365
Registered: December 2007
Location: Nowhere
Senior Member
You would need to go through all the items on the data block..something like this

get the name of the first item on the form = str_itemname

Loop..

update str_itemname

then

/*get the name of the next item*/
  str_itemname := block_name||'.'||get_item_property(str_itemname,  next_navigation_item);

/*check if the iteration has reached the last item*/
  if (str_itemname =block_name||'.ROWID') then
   exit
  end if;

end loop


Check Online help (CTLR+H) in oracle forms
Re: Updating a data block [message #328874 is a reply to message #328871] Mon, 23 June 2008 03:33 Go to previous messageGo to next message
hammad83
Messages: 36
Registered: June 2008
Location: Pakistan
Member
Thanks for your reply. I actually solved that problem. Now I am facing another one. I want to insert new rows in the data block. It is doing that fine but I want to insert ONLY new rows, and not update the rows that are already displayed. I set the update property of the items to NO, and when a user clicks on the EDIT button it changes the item update property to YES. Now the user is able to insert new rows in the data block and save them too, but at the same time the user can also change the record that is already displayed in the data block. Is there a way to allow user to only insert new rows and not to update the rows that are already entered?

Many Thanks

Hammad
Re: Updating a data block [message #337095 is a reply to message #328874] Tue, 29 July 2008 21:39 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Don't let them into the record. Create a 'dummy' item on each record and only let them navigate to that item in a record that does not have the attribute of 'insert'.

David
Previous Topic: Menu
Next Topic: how to insert a character value with out numbers (merged)
Goto Forum:
  


Current Time: Sun Dec 11 06:07:11 CST 2016

Total time taken to generate the page: 0.10455 seconds