I have a script that I run in Oracle Database 19c 19.0.0.0.0.0.0, and I use two date parameters from - to in a WITH() closure then depending on what it returns it does the INSERT to a table, then I wonder if it is possible to use my SQL statement in a procedure for this case, it is for an orchestrator that does not allow the SQL statement because of the number of lines, since it exceeds the maximum and I have to use a procedure.
It is the first time that I am going to use a procedure and I did not find information if I can use a with() closure and the parameters in a procedure, thank you.
I attach the SQL statement that I execute, thank you for your attention
SQL Insert F59INVEN.txt (11.26 KB)