I came across a little inconsistence in terms of body content when coding user-defined function. Please note that in accordance to the Syntax Pattern the DECLARE part is outside the body, but when coding the example, DECLARE part comes after BEGIN statement (so becomes the part of the body).
Are both ways correct?
Thanks in advance!
Thanks for reaching out.
Thank you for pointing this out. This is something we have to correct and upload, and we will do it.
First you need to use BEGIN, and then – DECLARE. I.e. the DECLARE Statement needs to be within the BEGIN-END block.
Hope this helps.