添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Is the PL/SQL GOTO statement deprecated and should not be used?

SebaVasta Mar 20 2022

I love the GOTO statement and have been using it for ages.
I love it because it reduces the number of IF statements. This makes reading code easier IMHO.
I also like it in functions when the function has many return statements in many places. I just put the return value into a variable do a a GOTO to the last line, and so have only one return statement.
However, I join a new company and used this and was told by senior developer during peer review not to use it. Apparently the DBA who deploys the code to the other environments sometimes reads code and he does not like GOTO statements. So I had to remove the GOTO and put IF/ELSE.
The weird thing is , the senior developer has been with the company for 20 years and the DBA only 11 years. But the developer is worried about what the DBA has to say about code.
Since I was new I had no choice so I recoded with IF/ELSE.
My question is, is the GOTO statement not be used in PL/SQL??
Is it deprecated?
Should you use IF instead of GOTO??
Or is there nothing wrong with using GOTO??