>>thank Naomi and serg(now i am shacking my head to understand you codes.
>
>Glancing through your original code it seems to be that you wanted to insert new records from students into ExamTran if the code was not found and update ExamTran records certain fields with the information from other fields of the same table.
>
>If this is so, I first selected records matching your original criteria (SET FILTER command).
>
>
>Basically your code may be also re-written this way:
>
>update ExamTran set onefield = '', another field = combination of fields where exists (select * from Student where your filter criteria)
>
>select code,"StaticInfo" as OneExtraField from students where code not in (select code from ExamTran) into cursor curToInsert
>
>insert into ExamTran (code, OneField) select * from curToInsert
Or even easier
insert into ExamTran (code, OneField);
select code,"StaticInfo" as OneExtraField from students where code not in (select code from ExamTran)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.