Home » Developer & Programmer » Forms » validating duplicate records without using post
validating duplicate records without using post [message #140693] Wed, 05 October 2005 04:32 Go to next message
ashishmate
Messages: 90
Registered: February 2005
Location: Mumbai
Member

hi friends

this is very basic question

i've multi record block based on SCOTT.EMP

i want to insert records into it but duplicate empnos are not allowd so as soon as user insert duplicate empno i want to prompt him his mistake

and i want to do this with out using post built_in.

is there any disigne time seting for this


Re: validating duplicate records without using post [message #140853 is a reply to message #140693] Wed, 05 October 2005 22:41 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
No ... what other people have done is create a dynamic record_group. The list is populated near to start-up time, then the list is 'scanned' to see if the new entry exists. If yes, then error message, else new entry is added to record_group and the user continues their data entry.

The record_group is deleted and rebuilt as part of any execute_query that is performed.

David
Re: validating duplicate records without using post [message #140867 is a reply to message #140853] Thu, 06 October 2005 00:00 Go to previous messageGo to next message
ashishmate
Messages: 90
Registered: February 2005
Location: Mumbai
Member

thanks djmartin

i know this can be done by looping through all fields also but now can you tell me what will be more faster looping fields or record group( if i am not making any mistake i will have to use loop to get all values from record group)


correct me if i am wrong


Re: validating duplicate records without using post [message #140872 is a reply to message #140867] Thu, 06 October 2005 00:12 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Valid question. Imagine that you have 100 fields per record, half of them have associated fields populated in the Post-Query, and you have one million records in your database. Looping through the block is going to take a very long time.

Create an implicit cursor that brings back just the one field about which you are interested, test if the record group exists, if it does delete it, create your record group, write a loop statement that uses the above cursor, and which add the entries to your record group in this loop. You still have a million records to process but they are much 'narrower' and have none of the processing associated with the Post-Query.

You can write the code as a forms procedure or function and then call it from whichever triggers need it.

David
Previous Topic: Forms 4.5 - Is Query all records in a block available?
Next Topic: uploading word,excel,pdf,autocad files
Goto Forum:
  


Current Time: Fri Sep 20 01:25:46 CDT 2024