updatind & inserting!!!! [message #274190] |
Mon, 15 October 2007 00:07 |
Dream
Messages: 11 Registered: June 2007 Location: UAE
|
Junior Member |
|
|
hi there,
i would like to ask if anyone can answer me to give me clear idea about
updating current record and at the same time inserting new one with new ID
an example:
if i want to renew card...i want to let user add changes and the new changes will be saved as new data with new ID
hope the idea clear
i will really apperciate your help!!!
Dream
|
|
|
|
Re: updatind & inserting!!!! [message #274239 is a reply to message #274221] |
Mon, 15 October 2007 03:23 |
Flyhard
Messages: 21 Registered: April 2007 Location: Germany
|
Junior Member |
|
|
djmartin wrote on Mon, 15 October 2007 09:22 | Remember to use 'standard.commit' to save your change.
David
|
Nice. Self committing updates.... Seriously though, don't use a commit in your on-update trigger unless you want to commit ALL changes in your transaction. If you need a commit, use a stored procedure with autonomous transaction turned on.
|
|
|
Re: updatind & inserting!!!! [message #274244 is a reply to message #274239] |
Mon, 15 October 2007 03:48 |
Dream
Messages: 11 Registered: June 2007 Location: UAE
|
Junior Member |
|
|
thanks alot for all answering BUT
it do save changes but not creating NEW record with new ID???
the changes which user will add will be save as NEW RECORD
i really hope the idea clear
sorry and i do apperciate your help
may god bless you
|
|
|
|
|
Re: updatind & inserting!!!! [message #274450 is a reply to message #274370] |
Tue, 16 October 2007 01:59 |
Dream
Messages: 11 Registered: June 2007 Location: UAE
|
Junior Member |
|
|
dear all,
the idea of the system... is whenever person need to renew ID card [ pass card] then user of the system will just change some details such as expiry data and issue data and when user click on save then it will save as new record with new ID and old data will remain the same but with notic that it have been renewed!!!!
hope its clear now!!
|
|
|
Re: updatind & inserting!!!! [message #274452 is a reply to message #274190] |
Tue, 16 October 2007 02:09 |
Flyhard
Messages: 21 Registered: April 2007 Location: Germany
|
Junior Member |
|
|
You could do the changes in a dialog of a non database block, and then use it to create a new record in the DB Block (last_record; next_record;) This way you are still using the Commit of Forms for commiting.
|
|
|
|
Re: updatind & inserting!!!! [message #274478 is a reply to message #274466] |
Tue, 16 October 2007 03:41 |
Dream
Messages: 11 Registered: June 2007 Location: UAE
|
Junior Member |
|
|
thanks Flyhard & David
i did write trigger on update and isnide the trigger i wrote insert code ...it gives me msg that its insert but when i check there is NO new data!!!!
|
|
|
|
Re: updatind & inserting!!!! [message #274685 is a reply to message #274668] |
Tue, 16 October 2007 17:26 |
mnanias
Messages: 40 Registered: September 2007 Location: AMERICA
|
Member |
|
|
Hi,
I have a similar issue,I created a data block and i have 2 columns in it and those are related a table in DB now i should be able to update the changes made in one of those columns in that block one column is textbox and the other one is display item so now the value which is changed in text box should be updated for that i have a button called 'save' so when i click on that button it should get saved so for this i wrote the code in on-commit trigger and i did commit in when-button-pressed and when i run the code i am getting msg record updated and that to for many times how many i say ok it kept on popping up i don't know y and one more thing i have till is i also have a block which displays set of records from some other table.I wrote a simple code to update but still i am getting the error please help me in this
please let me know if i need to do any changes.
Thank you
|
|
|
|
|
Re: updatind & inserting!!!! [message #274982 is a reply to message #274694] |
Thu, 18 October 2007 00:52 |
Dream
Messages: 11 Registered: June 2007 Location: UAE
|
Junior Member |
|
|
thanks alot
i wrote this code in when button pressed
begin
if (updating) then
insert into tbl_one
(
filed1 ,
filed2,
filed3
)
values
( '
:block_name.filed1 ,
:block_name.filed2 ,
:block_name.filed3 ' );
end if;
end;
and i got error
indentifier 'UPDATING' must be declared
[Updated on: Thu, 18 October 2007 00:54] Report message to a moderator
|
|
|
Re: updatind & inserting!!!! [message #275226 is a reply to message #274982] |
Thu, 18 October 2007 22:37 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Put the code, without the 'IF' test in the 'on-update' trigger of your data block. Make sure you have a 'standard.commit' after your insert.
David
|
|
|