Home » Developer & Programmer » Forms » duplicate records (r12,10g)
icon4.gif  duplicate records [message #516487] Mon, 18 July 2011 11:05 Go to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
hi

there is non database data block of table type.

now i want restrict user that he will not enter same number again.

can anyone suggest way..?

Re: duplicate records [message #516488 is a reply to message #516487] Mon, 18 July 2011 11:14 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As the block is a control block, you can't POST anything and then SELECT from the table because - there's no table.

Therefore, you'll have to scroll through the whole block and compare the latest value with previously entered ones. This is done in a loop.
Re: duplicate records [message #516490 is a reply to message #516488] Mon, 18 July 2011 11:19 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
how can i scroll through whole block as it is non database...?
Re: duplicate records [message #516491 is a reply to message #516490] Mon, 18 July 2011 11:31 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In a loop (there's no difference whether it is a database or a control block; why do you think that there is - regarding scrolling up and down?).
l_current_number := :block.numeric_item
first_record
loop through all records
  if l_current_item = :block.numeric_item 
     message (error - same numbers)
  end if
  next_record
end loop
Previous Topic: Upload file field
Next Topic: CLIENT_HOST is not working
Goto Forum:
  


Current Time: Sun Sep 08 23:03:29 CDT 2024