I am doing simple Insert command
Insert into table1
(fld1, fld2, fld3, fld4)
values
(1,2,3,4)
Now the problem is if value of fld4 is -1 then I want to insert -1. But if it is not -1 then I want to check in another table like table2 before insertion. If value is not present then the command should fail and return error.
I can do this problem with stored procedures but I don't want to change my code in VC++. So Please suggest if possible by one command or two commands.
Insert into table1
(fld1, fld2, fld3, fld4)
values
(1,2,3,4)
Now the problem is if value of fld4 is -1 then I want to insert -1. But if it is not -1 then I want to check in another table like table2 before insertion. If value is not present then the command should fail and return error.
I can do this problem with stored procedures but I don't want to change my code in VC++. So Please suggest if possible by one command or two commands.