Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Do not violate rule G-4320 in Examples of G-3145 #134

Copy link
Copy link
Closed
@PhilippSalvisberg

Description

@PhilippSalvisberg
Issue body actions

The examples in G-3145: Avoid using SELECT * directly from a table or view. violate rule G-4320: Always label your loops..

Here's the suggested solution for bad example:

begin
   <<raise_salary>>
   for r_employee in (
      select *
        from employees
   )
   loop
      employee_api.calculate_raise_by_seniority(
         id_in       => r_employee.id
        ,salary_in   => r_employee.salary
        ,hiredate_in => r_employee.hiredate
      );
   end loop raise_salary;
end;
/

and here the suggested solution for the good example:

begin
   <<raise_salary>>
   for r_employee in (
      select id,salary,hiredate
        from employees
   )
   loop
      employee_api.calculate_raise_by_seniority(
         id_in       => r_employee.id
        ,salary_in   => r_employee.salary
        ,hiredate_in => r_employee.hiredate
      );
   end loop raise_salary;
end;
/ 

Metadata

Metadata

Labels

enhancementNew feature or requestNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.