Hi, you're using a wrong set of statements. Please read something about INSERT and UPDATE statements.
For example
http://www.w3schools.com/sql/sql_insert.asp[
^] and
http://www.w3schools.com/sql/sql_update.asp[
^]
If you work with t-sql, your query would be like following:
IF NOT EXISTS (SELECT pID FROM my_table_name WHERE pID = 'p001')
INSERT INTO my_table_name (pID, x, y)
VALUES ('p001', 1, 2)
ELSE
UPDATE my_table_name SET x = x + 1, y = y + 2
WHERE pID = 'p001'
You could also use MERGE statement.
upd
MERGE INTO ptab AS target
USING (SELECT pID FROM ptab WHERE pID = 'p001') AS source
ON target.pID = source.pID
WHEN MATCHED
THEN UPDATE SET target.x = target.x + 1, target.y = target.y + 2
WHEN NOT MATCHED THEN INSERT(pID, x, y) VALUES ('p001', 1, 2);