Skip to content

Avoiding hardcoded schema names won't work as advertised in the skill #49

Description

@byte1964

The statement below highlighted in bold, contained in plsql_code_quality.md doesn't make any sense in PL/SQL, it will raise an exception at compile time.

If you need to point to an object in a different schema and you don't want to hardcode the schema in PL/SQL, then you must create a synonym for the "alien" object, possibly a public synonym if the procedure or function runs with AUTHID CURRENT_USER in which case it will also need SELECT privilege on the table to the current user.

Please amend or AI will generate inconsistent code.

-- If cross-schema access is needed, use constants or configurable references
SELECT * FROM config_pkg.schema_prefix || '.employees';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions