Toad World® Forums

Refactor / Rename Identifier renames wrong code parts

Hello,

I noticed that the function "Refractor / Rename Identifier" also renames parts of the code that have nothing to do with the variable.

Example code:

DECLARE
   id_person   persons.id_person%TYPE;
BEGIN
   id_person := getobjectid('PERSON');

   INSERT INTO persons(id_person, last_name, first_name)
        VALUES (id_person, 'Test', 'Test');
END;
/

If you rename the variable id_person to l_id_person, you get the following result:

DECLARE
   l_id_person   persons.l_id_person%TYPE;
BEGIN
   l_id_person := getobjectid('PERSON');

   INSERT INTO persons(l_id_person, last_name, first_name)
        VALUES (l_id_person, 'Test', 'Test');
END;
/

On the one hand, the column name is renamed in the declaration of the variable and on the other hand, the name of the column is renamed in the INSERT statement.