?sqlexec(gnConnHandle,"INSERT INTO CLAIMS1 (CLAIMNO) VALUES (X1)")I believe, it will not work because (at least) the variable X1 will not be recognized there: the value of X1 should be passed, and it should be formatted depending on whether it is numeric, character, or other type. I assume that you have either character or numeric data types. Then try this:
?sqlexec(gnConnHandle,"INSERT INTO CLAIMS1 (CLAIMNO) VALUES ("+; iif(type("X1")="C", "'"+X1+"'", trans(X1) )+ ")" )Let me know....
>TEXT TO lcSQL NOSHOW TEXTMERGE >INSERT INTO CLAIMS1 (ClaimNo) VALUES ("<<X1>>") >ENDTEXT > >if sqlexec(gnConnHandle,lcSQL) <=0 > *** it ends up here because of error >..... > >endif >>
>>>>if sqlexec(...) <=0
>>>> if aerror(aa)>0
>>>> ?aa[2]
>>>> else
>>>> ?"?????????"
>>>> endif
>>>>endif