I'd like to have increment/decrement operator (++/--) in SQL and PL/SQL.for integer types
in SQL this Operator should be available for updates like:
UPDATE some_table
SET integer_arrtibute ++,
,another_integer_Attribute--,
where ...
leading Operator or combination with assingments should not be allowed.
In PL/SQL the Operator should work as in Java, mening that the leading Operator is evalueated bevore an assingment and the trailing Operator is evaluated after an assingment:
declare
integer v_test1 := 1;
integer v_test2 := 5;
begin
v_test2 := v_test1++;
if(6=v_test2) then dbms_Output.put_line('success'); end if;
if(2=v_test1) then dbms_Output.put_line('success'); end if;
v_test2 := ++v_test1;
if(9=v_test2) then dbms_Output.put_line('success'); end if;
if(3=v_test1) then dbms_Output.put_line('success'); end if;
end;
bye
TPD