Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

New Rule: no SELECT * #46

Closed
Closed
Labels
enhancementNew feature or requesthelp wantedExtra attention is needed
Milestone
@silviomarghitola

Description

@silviomarghitola

Language Usage / DML & SQL / General
Never use SELECT * in a (sub-)query that selects directly from tables or views

fromSonarQube

Columns to be read with a "SELECT" statement should be clearly defined

SELECT * should be avoided because it releases control of the returned columns and could therefore lead to errors and potentially to performance issues.

Noncompliant Code Example

DECLARE  myvarCHAR;BEGINSELECT* INTO myvarFROM DUAL; END;

Compliant Solution

DECLARE  myvarCHAR;BEGINSELECT dummy INTO myvarFROM DUAL;END;

Exceptions

Wrapper queries using ROWNUM are ignored.

SELECT*FROM (SELECT fname, lname, deptIdFROM employeeORDER BY salary  )WHERE rownum<=10

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp