Home » Developer & Programmer » Forms » duplicate checking (forms 6i)
duplicate checking [message #277472] Tue, 30 October 2007 04:56 Go to next message
Messages: 48
Registered: November 2006
procedure USER_NAME is
    num1 Number;
    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;



[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
Messages: 10180
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.

Previous Topic: Query Problem at pre-insert
Next Topic: pound symbol
Goto Forum:

Current Time: Tue Aug 22 00:37:03 CDT 2017

Total time taken to generate the page: 0.27122 seconds