>THANK U FOR YOUR HELP.
>
>My another question is, I use following statement to append the record on temp table into my main table after doing some selection. But problem is, when I use following statement :
>
> mfile = sys(6)
If this is really what you're doing, SYS(6) returns the defaulr printer.
> CREAT TABLE &mfile ...
> .
> .
> .
> insert into maintable (a, b, c) ;
> value (mfile.a,mfile.b,mfile.c)
mfile in the value statement here is a literal. I also would not use needless macro expansion - name expansion would do just fine:
mFile = SYS(3) && a file name not an alias
CREATE TABLE (mfile) ... blah blah woof woof
USE (DBF()) ALIAS MyNewRecs
.
. blah blah woof woof
.
INSERT INTO Maintable VALUE (a, b, c)
or
INSERT INTO maintable VALUE ( MyNewRecs.a, MyNewRecs.b, MyNewRecs.c)
And I hope you aren't really naming fields 'a', 'b' 'c' because you're making the code that much harder to understand tomorrow. If the fields are the invoice number, part number and qty for example, give yourself a clue, name the fields InvNo, PartNo and Qty, so when you pick up the code it looks like:
INSERT INTO maintable VALUE( MyNewRecs.InvNo, MyNewRecs.PartNo, MyNewRecs.Qty)
Which gives you or the next guy a chance to understand what is happening...
Being cryptic to save a few keystrokes hurts you in the long run unless you're on the verge of losing use of your hands from carpal tunnel syndrome, in which case, you'll be a hopeless cripple 5 lines later in the incomplete and now uncomprehensible code.