Hey guys im back with a couple of questions. I will use table test for demonstration. This table has had a logical field "lsend" and an auto increment field "nid" added to it.
The table has a validation rule of setsend() saved in a db stored procedure.
When data buffering is enabled an insert into statment will not work!! Error message is data type mismatch!
However an append blank followed by a replace statment does.
This fails:
This works:
If i remove the validation rule the statment still does not work which leads me to believe the auto increment field is the culprit!! Does anybody see a solution to this??
Thanks in advance!!
Note any type of data buffering (2-5) causes the above code to fail.
Code:
ALTER TABLE test ADD COLUMN nid i
replace ALL nid WITH RECNO()
CALCULATE MAX(nid) TO lnMax
lcMax = TRANSFORM(lnMax)
ALTER TABLE test alter COLUMN nid i AUTOINC NEXTVALUE &lcMax + 1 STEP 1
ALTER TABLE test ADD COLUMN lsend l DEFAULT .T.
The table has a validation rule of setsend() saved in a db stored procedure.
Code:
FUNCTION setsend()
IF TYPE("lsend") = "L"
IF CURVAL("lSend") = lsend
replace lSend WITH .T.
ENDIF
ENDIF
ENDFUNC
When data buffering is enabled an insert into statment will not work!! Error message is data type mismatch!
However an append blank followed by a replace statment does.
This fails:
Code:
insert into test(cdesc);
values("TEST")
This works:
Code:
select test
append blank
replace test.cdesc with "TEST"
If i remove the validation rule the statment still does not work which leads me to believe the auto increment field is the culprit!! Does anybody see a solution to this??
Thanks in advance!!
Note any type of data buffering (2-5) causes the above code to fail.