pl/sql stored procedure: parameter name same as column name

后端 未结 4 1516
面向向阳花
面向向阳花 2021-02-02 09:44

I have a Stored Procedure like this

procedure P_IssueUpdate
(
    Id in integer,
    ModifiedDate in date,
    Solution in varchar2
) AS
BEGIN
update T_Issue
Set         


        
4条回答
  •  星月不相逢
    2021-02-02 10:01

    what you described is called variable shadowing. It can happen in any language. You were given good workarounds but the common solution is to design a naming scheme so that it will never happen.

    For example, name your columns without prefix and have your variables with a prefix that depends upon their scope (P_ for parameters, L_ for local variables, G_ for global package variables, etc...). This will have the added benefit of making the code more readable by giving you additional information.

提交回复
热议问题