<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Of incorrect code generation at the Insert rows step in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624060#M18770</link>
    <description>&lt;P&gt;The picture of the flow and the code you've posted don't look to be in sync. I don't see how DIS would generate such Insert code especially given that you've got a Create Table node prior to the Insert Rows transformation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking into the SQL I feel the flow could consist of a single Join transformation creating an intermediary Oracle table and then the Insert transformation could load the intermediary table into the target Oracle table, and then eventually drop the intermediary table or at least truncate it (SQL Delete transformation).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And because you're loading into one of the source tables: Make sure to set option "dbcommit=0" so that the new rows get all committed together.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DIS flow will show you if things run in-database by adding a little O symbol to the transformations - something that's missing in the picture of the flow and what's telling us that your code is moving data between Oracle and SAS even though the code you've posted wouldn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;N.B: The intermediary table doesn't need to be in the same Oracle schema (but should be on the same server).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 01:10:47 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-02-12T01:10:47Z</dc:date>
    <item>
      <title>Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623862#M18766</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;Faced the problem of incorrect code generation at the Insert rows step when executing a job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Job consists of 4 steps:&lt;BR /&gt;1. JOIN of two oracle tables (result of work.table1)&lt;BR /&gt;2. JOIN of three tables, including work.table1 and two oracle tables (result of work.table2)&lt;BR /&gt;3. I output the result of the second step to a new table work.table3&lt;BR /&gt;4. Step Insert rows in oracle table&lt;/P&gt;&lt;P&gt;And I get the error:&lt;BR /&gt;ERROR: ORACLE execute error: ORA-00904: "TABLE1". "WWW_ID": invalid identifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a code generation error?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    INSERT INTO ci_common.award_missioner (
        "PLAYER_GATE_ID",
        "AWARD_ID",
        "UPDATE_DATE",
        "WWW_ID"
    )
        SELECT DISTINCT
            table2.player_gate_id   AS player_gate_id,
            10005 AS award_id,
            to_timestamp('  
11FEB2020:16:36:25.7171', 'DDMONYYYY:HH24:MI:SS.FF', 'NLS_DATE_LANGUAGE=American') AS update_date,
            table2.www_id           AS www_id
        FROM
            (
                SELECT DISTINCT
                    table1."PLAYER_GATE_ID"   AS player_gate_id,
                    10005 AS award_id,
                    to_timestamp('  
11FEB2020:16:36:25.7171', 'DDMONYYYY:HH24:MI:SS.FF', 'NLS_DATE_LANGUAGE=American') AS update_date
                    ,
                    table1."WWW_ID"           AS www_id
                FROM
                    (
                        SELECT DISTINCT
                            table1."PLAYER_GATE_ID"   AS player_gate_id,
                            table1."WWW_ID"           AS www_id
                        FROM
                            (
                                SELECT DISTINCT
                                    player_main."PLAYER_GATE_ID",
                                    player_main."WWW_ID"
                                FROM
                                    cmdm.player_main player_main
                                    LEFT JOIN ci_common.award_missioner award_missioner ON player_main."PLAYER_GATE_ID" = award_missioner
                                    ."PLAYER_GATE_ID"
                                WHERE
                                    ( award_missioner."PLAYER_GATE_ID" IS NULL )
                                    AND ( ( player_main."WWW_ID" IS NOT NULL )
                                          AND ( player_main."WWW_REG_STATUS" = 'REGISTERED' ) )
                            ) table1, cmdm.player_add_services player_add_services
                            LEFT JOIN ci_common.award_missioner_dop award_missioner_dop ON player_add_services."PLAYER_GATE_ID" =
                            award_missioner_dop."PLAYER_GATE_ID"
                        WHERE
                            ( table1."PLAYER_GATE_ID" = award_missioner_dop."PLAYER_GATE_ID" )
                            AND ( ( award_missioner_dop."PLAYER_GATE_ID" IS NULL )
                                  OR ( player_add_services."PLAYER_FRIEND_CNT" &amp;gt; award_missioner_dop."PLAYER_FRIEND_CNT" ) )
                            AND ( ( player_add_services."FRIEND_FLG" = 'Y' )
                                  AND ( player_add_services."PLAYER_FRIEND_CNT" &amp;gt;= 1 ) )
                    ) table2
            ) table3&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I would be grateful for your help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Of incorrect.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36007i11D9B469DB6B3AFE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Of incorrect.PNG" alt="Of incorrect.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 14:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623862#M18766</guid>
      <dc:creator>Shukhrat</dc:creator>
      <dc:date>2020-02-11T14:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623883#M18767</link>
      <description>&lt;P&gt;The error is an Oracle error message. It apparently indicates that the name of a table or variable passed to Oracle does not meet the Oracle standard naming or possibly means the referenced item doesn't exist (Not an Oracle guru by any stretch).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 15:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623883#M18767</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-11T15:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623904#M18768</link>
      <description>&lt;P&gt;You are referencing an alias of TABLE1 , but your query only defines alias of TABLE2 and TABLE3.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What actual table are you trying to reference?&amp;nbsp; You need to include it in the FROM clause.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623904#M18768</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-11T16:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623905#M18769</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Job consists of 4 steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. JOIN of two oracle tables (result of work.table1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. JOIN of three tables, including work.table1 and two oracle tables (result of work.table2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I output the result of the second step to a new table work.table3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Step Insert rows in oracle table&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;There is a logic/data flow problem with this design.&amp;nbsp; In step 1 you are taking data out of Oracle.&amp;nbsp; Then in step2 you either need either pull two full oracle tables into SAS or push the table generated by 1 back into Oracle.&amp;nbsp; Same problem between steps 3 and 4.&amp;nbsp; You are taking data you created in Oracle and moving it into SAS datasets just so you can move it back into Oracle.&amp;nbsp; Is there some reason the whole process is not coded as one step, coded totally to run in the Oracle database?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 16:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/623905#M18769</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-11T16:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624060#M18770</link>
      <description>&lt;P&gt;The picture of the flow and the code you've posted don't look to be in sync. I don't see how DIS would generate such Insert code especially given that you've got a Create Table node prior to the Insert Rows transformation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking into the SQL I feel the flow could consist of a single Join transformation creating an intermediary Oracle table and then the Insert transformation could load the intermediary table into the target Oracle table, and then eventually drop the intermediary table or at least truncate it (SQL Delete transformation).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And because you're loading into one of the source tables: Make sure to set option "dbcommit=0" so that the new rows get all committed together.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DIS flow will show you if things run in-database by adding a little O symbol to the transformations - something that's missing in the picture of the flow and what's telling us that your code is moving data between Oracle and SAS even though the code you've posted wouldn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;N.B: The intermediary table doesn't need to be in the same Oracle schema (but should be on the same server).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 01:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624060#M18770</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-02-12T01:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624096#M18773</link>
      <description>&lt;P&gt;Attempt for the third time to write a message. Please do not delete, this is not spam.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for answers.&lt;BR /&gt;1. Why I do not use 1 step with direct access to sql.&lt;BR /&gt;The answer is: read better and more correct&lt;BR /&gt;2. It does not look like DIS code&lt;BR /&gt;I answer: this request is taken from the job log&lt;BR /&gt;3. You are referencing an alias of TABLE1, but your query only defines alias of TABLE2 and TABLE3.&lt;/P&gt;&lt;P&gt;What actual table are you trying to reference? You need to include it in the FROM clause.&lt;BR /&gt;I answer:&lt;BR /&gt;The table in the request is indicated, if you look carefully, please:&lt;BR /&gt;SELECT DISTINCT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;table1. "PLAYER_GATE_ID" AS player_gate_id,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;table1. "WWW_ID" AS www_id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT DISTINCT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;player_main. "PLAYER_GATE_ID",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;player_main. "WWW_ID"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cmdm.player_main player_main&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LEFT JOIN ci_common.award_missioner award_missioner ON player_main. "PLAYER_GATE_ID" = award_missioner&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;. "PLAYER_GATE_ID"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(award_missioner. "PLAYER_GATE_ID" IS NULL)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND ((player_main. "WWW_ID" IS NOT NULL)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND (player_main. "WWW_REG_STATUS" = 'REGISTERED'))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;) table1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I forgot to clarify.&lt;BR /&gt;If you change the aliases of table1 to table2, in the step where the error occurs. That request fulfills successfully on the oracle base.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INSERT INTO ci_common.award_missioner (
        "PLAYER_GATE_ID",
        "AWARD_ID",
        "UPDATE_DATE",
        "WWW_ID"
    )
        SELECT DISTINCT
        /*table2*/    table3.player_gate_id   AS player_gate_id,
            10005 AS award_id,
            to_timestamp('  
11FEB2020:16:36:25.7171', 'DDMONYYYY:HH24:MI:SS.FF', 'NLS_DATE_LANGUAGE=American') AS update_date,
          /*table2*/   table3.www_id           AS www_id
        FROM
            (
                SELECT DISTINCT
             /*table1*/    table2."PLAYER_GATE_ID"   AS player_gate_id,
                    10005 AS award_id,
                    to_timestamp('  
11FEB2020:16:36:25.7171', 'DDMONYYYY:HH24:MI:SS.FF', 'NLS_DATE_LANGUAGE=American') AS update_date
                    ,
                 /*table1*/     table2."WWW_ID"           AS www_id
                FROM
                    (
                        SELECT DISTINCT
                            table1."PLAYER_GATE_ID"   AS player_gate_id,
                            table1."WWW_ID"           AS www_id
                        FROM
                            (
                                SELECT DISTINCT
                                    player_main."PLAYER_GATE_ID",
                                    player_main."WWW_ID"
                                FROM
                                    cmdm.player_main player_main
                                    LEFT JOIN ci_common.award_missioner award_missioner ON player_main."PLAYER_GATE_ID" = award_missioner
                                    ."PLAYER_GATE_ID"
                                WHERE
                                    ( award_missioner."PLAYER_GATE_ID" IS NULL )
                                    AND ( ( player_main."WWW_ID" IS NOT NULL )
                                          AND ( player_main."WWW_REG_STATUS" = 'REGISTERED' ) )
                            ) table1, cmdm.player_add_services player_add_services
                            LEFT JOIN ci_common.award_missioner_dop award_missioner_dop ON player_add_services."PLAYER_GATE_ID" =
                            award_missioner_dop."PLAYER_GATE_ID"
                        WHERE
                            ( table1."PLAYER_GATE_ID" = award_missioner_dop."PLAYER_GATE_ID" )
                            AND ( ( award_missioner_dop."PLAYER_GATE_ID" IS NULL )
                                  OR ( player_add_services."PLAYER_FRIEND_CNT" &amp;gt; award_missioner_dop."PLAYER_FRIEND_CNT" ) )
                            AND ( ( player_add_services."FRIEND_FLG" = 'Y' )
                                  AND ( player_add_services."PLAYER_FRIEND_CNT" &amp;gt;= 1 ) )
                    ) table2
            ) table3&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 07:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624096#M18773</guid>
      <dc:creator>Shukhrat</dc:creator>
      <dc:date>2020-02-12T07:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624115#M18774</link>
      <description>&lt;P&gt;I tried to redo the diagram and received an error, already on another line of the generated code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rezult2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36058i449FF3B827BC47E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="rezult2.PNG" alt="rezult2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the third step, I explicitly specify&lt;/P&gt;&lt;P&gt;LEFT JOIN ci_common.award_missioner_dop award_missioner_dop ON table2. "PLAYER_GATE_ID" = award_missioner_dop. "PLAYER_GATE_ID",&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result3.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36057i08C8EF8B3AE5E07B/image-size/large?v=v2&amp;amp;px=999" role="button" title="result3.PNG" alt="result3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but the code is generated differently, for example:&lt;BR /&gt;LEFT JOIN ci_common.award_missioner_dop award_missioner_dop ON table1. "PLAYER_GATE_ID" = award_missioner_dop. "PLAYER_GATE_ID"&lt;/P&gt;&lt;P&gt;I can’t understand why this is happening. Can you tell me what I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 09:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624115#M18774</guid>
      <dc:creator>Shukhrat</dc:creator>
      <dc:date>2020-02-12T09:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624121#M18775</link>
      <description>&lt;P&gt;Yes, there is a reason. This option already exists and works quite successfully.&lt;BR /&gt;But I am refactoring such jobs. To make it convenient and understandable to all users.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 09:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624121#M18775</guid>
      <dc:creator>Shukhrat</dc:creator>
      <dc:date>2020-02-12T09:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624423#M18777</link>
      <description>&lt;P&gt;I assume the green tables are actually all views and that's why the error only shows with the Insert node.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still don't understand the purpose of the Create Table node.&lt;/P&gt;
&lt;P&gt;According to the generated SQL table AWARD_MISSIONAR is both a source and the target table. In such a scenario you really should first populate a physical intermediary table (it can be an Oracle Temporary table) and insert the rows from this intermediary table into the target table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's close to impossible to tell you more without actually looking into the DIS job. If you can't solve it then please attach a .spk of the job with all the dependent objects included (tables and libraries). You would ideally also provide another job/script which loads some sample data into the source tables.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624423#M18777</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-02-13T13:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Of incorrect code generation at the Insert rows step</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624781#M18780</link>
      <description>&lt;P&gt;The staging table in ORACLE solved the problem.&lt;BR /&gt;Thanks.&lt;BR /&gt;But it’s still strange for me that my method of building a process works with errors.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 11:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Of-incorrect-code-generation-at-the-Insert-rows-step/m-p/624781#M18780</guid>
      <dc:creator>Shukhrat</dc:creator>
      <dc:date>2020-02-14T11:05:15Z</dc:date>
    </item>
  </channel>
</rss>

