Results 1 to 3 of 3

Thread: vfp8 to vfp6

  1. #1
    Join Date
    Sep 2003
    Location
    New Zealand
    Posts
    2

    Unanswered: vfp8 to vfp6

    why following stmt gets error (i.e syntax error)

    INSERT INTO curFinalResult (ParentTab,Parentfld,ChildTab,ChildFld,OrphChdKey, added) ;
    SELECT distinct lcTable,lcParentfld,lcChild,lcChildfld,&lcChildfld ,0 FROM &lcChild ;
    WHERE &lcWHERE ;
    NOT in (SELECT &lcParentfld FROM &lcTable)

    here lcTable="ABOPER"
    lcchild="PROCPAT"
    lcWHERE ="ABOPER"

    the same abv code works well v foxpro 8 but not in vfp6.
    any ideas plz

  2. #2
    Join Date
    Dec 2003
    Posts
    104
    There were a lot of changes to the SQL engine/syntax from VFP 7 to VFP 8. Not to mention VFP 6.
    Especially with nested queries. I believe you'll have to separate them.
    Try changing your statement to

    SELECT distinct lcTable,lcParentfld,lcChild,lcChildfld,&lcChildfld ,0 FROM &lcChild ;
    WHERE &lcWHERE ;
    NOT in (SELECT &lcParentfld FROM &lcTable) INTO CURSOR MyCursor

    INSERT INTO curFinalResult VALUES (ParentTab,Parentfld,ChildTab,ChildFld,OrphChdKey,
    added) FROM CURSOR MyCursor

    I haven't tested the code, but you should be able to get the idea and tweak it as needed.
    DSummZZZ

    Even more Fox stuff at
    www.davesummers.net/foxprolinks.htm

  3. #3
    Join Date
    Sep 2003
    Location
    New Zealand
    Posts
    2

    Smile

    Hi friend
    Thanks for ur post.i tried ur idea but did not work.
    finally i ended up copying data to a text file and appending my final cursor from that text file and it works
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •