XSharpPublic
XSharpPublic copied to clipboard
[VFP] Cursor Operation REPLACE with ALL
Describe the bug Keyword ALL seems to be not supported (Parser-Error)
To Reproduce Code to reproduce the behavior:
USING System
USING System.Collections.Generic
USING System.Text
FUNCTION check_cursor AS VOID
create cursor abc (mkey i, mident c(10))
insert into abc (mkey,mident) values (1,"a")
insert into abc (mkey,mident) values (2,"b")
insert into abc (mkey,mident) values (3,"c")
create cursor def (mkey_fk i,mtext c(10))
insert into def (mkey_fk,mtext) values (1,"inf1")
insert into def (mkey_fk,mtext) values (1,"inf2")
insert into def (mkey_fk,mtext) values (2,"infA")
insert into def (mkey_fk,mtext) values (3,"to_del")
insert into def (mkey_fk,mtext) values (4,"to_del")
select def
REPLACE ALL mtext WITH "newtext" + transform(recno())
RETURN
Expected behavior All Records should be updated (instead of just the single record with the record pointer)
The ALL clause is supported, but just not at that location in the command. Either move ALL to the end of the command, or add the following to the start of your code or to a header file that you're including in your code.
#command REPLACE <*clauses*> ALL <*moreclauses*> => REPLACE <clauses> <moreclauses> ALL
that works, thanks
Added to the standard Header file for 2.21
Confirmed fixed