SSC-EWI-OR0002

Columns from expression not found

Some parts in the output code are omitted for clarity reasons.

Severity

High

Description

This error happens when the columns of a Select Expression were unable to be resolved, usually when it either refers to a Type Access whose reference wasn't resolved or a column with a User Defined Type whose columns haven't been defined; such as a Type Without Body or Object Type with no columns.

Example Code

Input Code:

IN -> Oracle_01.sql
CREATE OR REPLACE PROCEDURE record_unknown_table_proc
AS
    unknownTable_variable_rowtype unknownTable%ROWTYPE;
BEGIN
    INSERT INTO MyTable values unknownTable_variable_rowtype;
END;

Output Code:

OUT -> Oracle_01.sql
CREATE OR REPLACE PROCEDURE record_unknown_table_proc ()
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"oracle"}}'
EXECUTE AS CALLER
AS
$$
    DECLARE
        unknownTable_variable_rowtype OBJECT !!!RESOLVE EWI!!! /*** SSC-EWI-0036 - ROWTYPE DATA TYPE CONVERTED TO OBJECT ***/!!! := OBJECT_CONSTRUCT();
    BEGIN
        INSERT INTO MyTable
        SELECT
            null !!!RESOLVE EWI!!! /*** SSC-EWI-OR0002 - COLUMNS FROM EXPRESSION unknownTable%ROWTYPE NOT FOUND ***/!!!;
    END;
$$;

Recommendations

Last updated