I'm currently trying to make a Query which have to get the max value from a column, add one (+1) and format it with N zeros in the left side until nine positions.
I have tried a lot of queries which works in H2 database but don't do the same in Oracle
INSERT INTO XXX.YYY(X,Y,Z)
VALUES
(CONCAT(:X, :Y, (LPAD((SELECT nvl(max(Z),0) + 1 FROM XXX.YYY),9,'0'))),
(LPAD((SELECT nvl(max(Z),0) + 1 FROM XXX.YYY),9,'0')),
:Z)
This is throwing me the following error:
java.sql.SQLSyntaxErrorException: ORA-00909: invalid number of arguments