Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Commit

Status
Not open for further replies.

hluash

Programmer
Aug 7, 2001
10
UG
Somebody help me here am trying to commit entered data to a table from a form without success!!!! here is the dilema
1.DECLARE
2. l_rowid VARCHAR2(30);
3. CURSOR exists_cur
4. IS SELECT ROWID FROM SSD001t WHERE nssf_no = 5. :basetable.id;
6. err_txt VARCHAR2(80);
7. al_id Alert;
8. al_button Number;
9.BEGIN
10. IF :global.l_add = 't' THEN
11. do_key('Commit_form');
12. END IF;

13. IF :global.l_edit = 't' THEN
/* if record exists in master insert edited
in the transaction file */
OPEN exists_cur; -- Check in master file cursor
14. FETCH exists_cur INTO l_rowid;
15. IF exists_cur%FOUND THEN
16. UPDATE basetable
17. SET basetable.CROSSREF =:basetable.crossref,
18. basetable.SURNAME =:basetable.SURNAME,
19. basetable.manager=:ssd001t.manager,
20 basetable.status=:basetable.status
21. WHERE ROWID = l_rowid;
22. ELSE
23. IF :System.Form_Status = 'CHANGED' THEN 24. COMMIT_FORM;
25. IF FORM_SUCCESS THEN
26. Message('saved');
27. END IF;
28. END IF;
29. END IF;
30. CLOSE exists_cur;
31. END IF;
32. CLEAR_FORM;
33. GO_FIELD('add_btn');
34.END;

Note that the numbering is not part of the code.
Problem here is This code is under the when_button _pressed trigger for the save button.
It does not save/commit any thing but gives the messages on line 26. and even does not clear form as told in line 32 but it goes ahead and executes line 33 after a default forms alert asking me whather to save/cancel or not.
Thanks alot.
 
Clear_form asks you whether you want to save changes for its default commit mode is ask_commit. To prevent it to ask you may call it with do_commit (maybe even instead of commit_form). It seems to me that your commit_form is unsuccessfull, so when clearing form it still contains changes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top