>I am inserting the records from cursor. but only one top record is inserting.
>
>
>>
> SELECT student.*, Level.*,exam.*;
> FROM ;
> student,exam ;
> INNER JOIN level ;
> ON Student.lcode = Level.code;
> WHERE scode=thisform.scode.value and lcode=thisform.lcode.Value;
> and sec=thisform.sec.value and admtd=1 AND exam.code=thisform.code.value INTO CURSOR examre1
>
>zpath=path
>zbex=bex_a
>zmonth=Nmonth
>zscode=scode
>zlcode=lcode
>zsec=sec
>zexamcode=code_c
>
> INSERT INTO examtran (ttpath,bex,nmonth,scode,lcode,sec,examcode);
> values (zpath,zbex,zmonth,zscode,zlcode,zsec,zexamcode)>
>what is mistake?thanks
INSERT INTO inserts a single record. You could write a loop, as follows - note that I am omitting most variables:
SELECT student.*, Level.*,exam.*;
FROM ;
student,exam ;
INNER JOIN level ;
ON Student.lcode = Level.code;
WHERE scode=thisform.scode.value and lcode=thisform.lcode.Value;
and sec=thisform.sec.value and admtd=1 AND exam.code=thisform.code.value;
INTO CURSOR examre1
scan
select ExamTran
append blank
replace;
ttPath with examre1.Path,;
bex with examre1.bex_a,;
...
endscan
scan
scatter name loRecord
insert into ExamTran (ttPath, Bex, ...);
values loRecord.Path, loRecord.bex_a, ...)
endscan
Visual FoxPro 9 also has commands to append multiple records directly form an INSERT statement; you must somehow combine those two. But I don't yet feel comfortable with this feature; I will have to look it up eventually.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)