I'm trying to insert a record into a table, changing the value of the field in the insert based on a condition. To simplify the code:
DECLARE
true_or_false BOOLEAN;
BEGIN
true_or_false := FALSE;
INSERT INTO table1
(column1)
VALUES
(CASE WHEN true_or_false = FALSE THEN 0 ELSE -1 END);
END;
This is something I can do in SQL Server but can't quite get the Oracle syntax right. Can anyone help me please?