<?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: SQL Pass Through Query Records in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/719546#M27672</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/261907" target="_blank"&gt;ssaha&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;OBSIDIAN,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can enable the sastrace from options tab, for the specific transformation&amp;nbsp;if the code is running under DI Studio or else if it's running in BASE then you can pass the below option just right above the passthrough step.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;options sastrace=',,,d' sastraceloc=saslog nostsuffix;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The log will give you some information like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ORACLE: 158 rows inserted/updated/deleted.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks and have a great day ahead.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 08:07:05 GMT</pubDate>
    <dc:creator>rajdeep</dc:creator>
    <dc:date>2021-02-16T08:07:05Z</dc:date>
    <item>
      <title>SQL Pass Through Query Records</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555381#M9667</link>
      <description>&lt;P&gt;Inserting records into Oracle database using SQL passthrough query doesn’t shows the number of records inserted to the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am using SQL passthrough query for inserting records to the DB table in Prod SQL.&lt;/P&gt;&lt;P&gt;The macro code is being included in the parent code that is scheduled for processing. When I run manually the macro code in SAS EG, I can see the number of records inserted in the table.&lt;/P&gt;&lt;P&gt;But when running in the include code in the parent code together, it doesn’t shows any logs messages on how many records are inserted in the oracle table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In SAS EG – can see –&lt;/P&gt;&lt;P&gt;ORACLE: 0 rows inserted/updated/deleted. 153 1556630270 no_name 0 SQL (2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While running in the parent code – &amp;nbsp;cannot see the records inserted in the oracle table as in below log. Already using %PUT &amp;amp;SQLXRC. &amp;amp;SQLXMSG. ; and this only shows 0 as return code is zero with no error message –&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; *SE scrub stg;&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; CONNECT TO oracle ( path=xxx authdomain="xx") ;&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; execute ( INSERT INTO tablename ( col1, col2 ) select&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;app_transaction_key, T. scrub_key, sum(T.flag) as override_type from ( select a.app_transaction_key, b.scrub_key, 1 as flag from&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;schema.v_transaction_current a, schema.master b where trunc(a.s_effective_from) &amp;gt; '30-APR-2019' and&lt;/P&gt;&lt;P&gt;b.query_group_key = 80 and WAREHOUSE_CODE='PPP' AND CUSTOMER_NAME='SAN' union Select a.app_transaction_key, a.scrub_key, -1 as&lt;/P&gt;&lt;P&gt;flag from schema.v_transaction_current c, schema.v_tran_current a, schema.master b where&lt;/P&gt;&lt;P&gt;c.app_transaction_key=a.app_transaction_key and b.scrub_key = a.scrub_key and trunc(c.s_effective_from) &amp;gt; '30-APR-2019' and&lt;/P&gt;&lt;P&gt;b.query_group_key = 80 ) t group by T.app_transaction_key, T.scrub_key ) by oracle ;&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; Disconnect from oracle;&lt;/P&gt;&lt;P&gt;MPRINT(EXECUTESEQUERY):&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 15:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555381#M9667</guid>
      <dc:creator>ssaha</dc:creator>
      <dc:date>2019-05-01T15:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Pass Through Query Records</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555382#M9668</link>
      <description>&lt;P&gt;Are you asking what ORACLE code you can use to mimic the SAS feature that displays the number of records inserted?&lt;/P&gt;
&lt;P&gt;You might just try counting number of observations before and after the insert.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 15:46:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555382#M9668</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-01T15:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Pass Through Query Records</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555442#M9681</link>
      <description>&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Segoe UI" size="2" color="#000000"&gt;Yes, want to know what macro variables or code can help me know how many rows were inserted in the table using SAS SQL pass through query.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Segoe UI" size="2" color="#000000"&gt;as we can do that count of rows after and before, but that is again going to add processing time.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;FONT face="Segoe UI" size="2" color="#000000"&gt;Is there a way we can know from logs that how many rows were inserted like we get when we use libname statement or when we run it as a simple code and not include as sas code in another SAS Code.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Segoe UI" size="1" color="#6E6E73"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;!-- EndFragment  --&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2019 18:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/555442#M9681</guid>
      <dc:creator>ssaha</dc:creator>
      <dc:date>2019-05-01T18:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Pass Through Query Records</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/719546#M27672</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/261907" target="_blank"&gt;ssaha&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;OBSIDIAN,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can enable the sastrace from options tab, for the specific transformation&amp;nbsp;if the code is running under DI Studio or else if it's running in BASE then you can pass the below option just right above the passthrough step.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;options sastrace=',,,d' sastraceloc=saslog nostsuffix;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The log will give you some information like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ORACLE: 158 rows inserted/updated/deleted.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks and have a great day ahead.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 08:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SQL-Pass-Through-Query-Records/m-p/719546#M27672</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2021-02-16T08:07:05Z</dc:date>
    </item>
  </channel>
</rss>

