I have a insert if not exists query as below.
BEGIN
IF NOT EXISTS (SELECT * FROM tbl_sampleTable WHERE name = ? or subject = ?)
BEGIN
INSERT INTO
Just in this case you might use SQL variables. It is not a general solution. And also many SQL vendor specific variants know such insert-when-not-exists constructs, not needing such archaic code.
BEGIN
DECLARE @MyName varchar(100);
DECLARE @MySubject varchar(100);
SET @MyName = ?;
SET @MySubject = ?;
IF NOT EXISTS (SELECT * FROM tbl_sampleTable WHERE name = @MyName OR subject = @MySubject)
BEGIN
INSERT INTO tbl_sampleTable(subject, name) VALUES (@MySubject, @MyName)
END
END