Home » Developer & Programmer » Forms » duplicate checking (forms 6i)
duplicate checking [message #277472] Tue, 30 October 2007 04:56 Go to next message
sudharshan
Messages: 48
Registered: November 2006
Member
procedure USER_NAME is
    num1 Number;
begin
    select count(1)
	into num1
        from dept
        where deptno = :dept.deptno
	and (:dept.rowid is null or
	     :dept.rowid != rowid);

---i dont understand why they check like this and it is a table 
-- and not a view.
---can someone throw light on this as what this code does?
	    
    if (num1 > 0) then
        message('it is wrong');       
         raise form_trigger_failure;
    end if;

end USER_NAME ;


Regards
sudharshan

[mod-edit]applied code tags.

[Updated on: Tue, 30 October 2007 05:23] by Moderator

Report message to a moderator

Re: duplicate checking [message #277627 is a reply to message #277472] Tue, 30 October 2007 23:12 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
It would appear that they are testing as to whether the value in ':dept.deptno' already exists in the 'dept' table or the value ':dept.rowid' has not been populated.

David
Previous Topic: FRM-18108: Failed to load the following objects
Next Topic: Gantt charts
Goto Forum:
  


Current Time: Fri Sep 27 06:23:47 CDT 2024