<?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: insert into oracle table with fedsql in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759787#M22766</link>
    <description>&lt;P&gt;Interesting behavior.&amp;nbsp; Apparently SAS (or Oracle) doesn't like how things are working when going directly against the CASLIB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried creating a SAS view of&amp;nbsp;AKAIKE.TEST_DOWNLAOD?&amp;nbsp; Maybe if you used a view as an intermediary, it would iron out the odd problem.&amp;nbsp; I don't know that this will work, but it's worth a shot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you run, would you try turning on the following options?&amp;nbsp; These are 9.4 options; I'm not sure they'll all work with Viya, but let's give it a shot.&amp;nbsp; This will add additional messages to the log which may give us a clue as to what's going on.&amp;nbsp; If one option or another doesn't work, comment it out and use the rest.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS 	SASTRACE		=	",,,ds";
OPTIONS 	SASTRACELOC		=	SASLOG;
OPTIONS 	NOSTSUFFIX;
OPTIONS 	MsgLevel		=	I;
OPTIONS 	DEBUG			=	DBMS_SELECT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 19:37:14 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2021-08-05T19:37:14Z</dc:date>
    <item>
      <title>insert into oracle table with fedsql</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759660#M22764</link>
      <description>&lt;P&gt;In order to update an oracle table from SAS Viya I have found a strategy that works for me.&lt;/P&gt;
&lt;P&gt;But it's slow.&lt;/P&gt;
&lt;P&gt;I hope that fixing the fedsql option the performance gets better. Here comes the error log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;76 proc fedsql sessref=mysession _method exec;&lt;/P&gt;
&lt;P&gt;NOTE: FEDSQL: Running on CAS due to "sessref".&lt;/P&gt;
&lt;P&gt;77 insert into MYORA.TEST_UPLOAD&lt;/P&gt;
&lt;P&gt;78 select * from AKAIKE.TEST_DOWNLAOD1;&lt;/P&gt;
&lt;P&gt;NOTE: Added action set 'fedsql'.&lt;/P&gt;
&lt;P&gt;action returned string actionset = fedsql&lt;/P&gt;
&lt;P&gt;NOTE: CAS action completed [OKAY]&lt;/P&gt;
&lt;P&gt;FEDSQL: load of action set returned rc=00000000&lt;/P&gt;
&lt;P&gt;ERROR: Unsupported SQL statement.&lt;/P&gt;
&lt;P&gt;ERROR: The action stopped due to errors.&lt;/P&gt;
&lt;P&gt;ERROR: The FedSQL action was not successful.&lt;/P&gt;
&lt;P&gt;FEDSQL: The fedsql.execDirect action returned rc=0x000003f4&lt;/P&gt;
&lt;P&gt;NOTE: PROC FEDSQL has set option NOEXEC and will continue to prepare statements.&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;PRE&gt;cas mySession sessopts=(caslib=akaike timeout=1800 locale="en_US");
caslib _all_ assign;

data TEST_DOWNLAOD1;
set AKAIKE.TEST_DOWNLAOD(obs=5000);
run;

data AKIAKE.TEST_DOWNLAOD1;
set AKAIKE.TEST_DOWNLAOD(obs=5000);
run;

/* works for leaving the table structure with 0 rows */
proc sql;
   connect to oracle as dbcon
       (user=SAS password='xxxxxxxxxx' readbuff=50000
        PATH=xxxxxx);
execute (truncate table TEST_UPLOAD)
BY DBCON;
quit;

LIBNAME myora ORACLE PATH=xxxxx USER=SAS PASSWORD='xxxxxxxxxxxx';
/* WORKS for append  */
proc append base=MYORA.TEST_UPLOAD 
data=AKAIKE.TEST_DOWNLAOD(OBS=10000); 
run;

/* WORKS for append  */
proc FEDsql;
  insert into MYORA.TEST_UPLOAD 
  select * from TEST_DOWNLAOD1;
QUIT;

/* does not WORK for append  */
proc fedsql sessref=mysession  _method exec;
  insert into MYORA.TEST_UPLOAD 
  select * from AKAIKE.TEST_DOWNLAOD1;
QUIT;

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 10:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759660#M22764</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2021-08-05T10:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: insert into oracle table with fedsql</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759787#M22766</link>
      <description>&lt;P&gt;Interesting behavior.&amp;nbsp; Apparently SAS (or Oracle) doesn't like how things are working when going directly against the CASLIB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried creating a SAS view of&amp;nbsp;AKAIKE.TEST_DOWNLAOD?&amp;nbsp; Maybe if you used a view as an intermediary, it would iron out the odd problem.&amp;nbsp; I don't know that this will work, but it's worth a shot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you run, would you try turning on the following options?&amp;nbsp; These are 9.4 options; I'm not sure they'll all work with Viya, but let's give it a shot.&amp;nbsp; This will add additional messages to the log which may give us a clue as to what's going on.&amp;nbsp; If one option or another doesn't work, comment it out and use the rest.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS 	SASTRACE		=	",,,ds";
OPTIONS 	SASTRACELOC		=	SASLOG;
OPTIONS 	NOSTSUFFIX;
OPTIONS 	MsgLevel		=	I;
OPTIONS 	DEBUG			=	DBMS_SELECT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 19:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759787#M22766</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-05T19:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: insert into oracle table with fedsql</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759788#M22767</link>
      <description>&lt;P&gt;Does it help to tell it which variables you actually are using?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fedsql sessref=mysession  _method exec;
  insert into MYORA.TEST_UPLOAD (var1, var2) 
  select var1,var2 from AKAIKE.TEST_DOWNLAOD1;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Aug 2021 19:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759788#M22767</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-05T19:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: insert into oracle table with fedsql</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759913#M22769</link>
      <description>&lt;P&gt;thanks, but doesn't work for me neither (replacing var1 with an existing varname)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759913#M22769</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2021-08-06T12:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: insert into oracle table with fedsql</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759978#M22771</link>
      <description>&lt;P&gt;Have you tried creating a SAS view of&amp;nbsp;AKAIKE.TEST_DOWNLAOD?&amp;nbsp; Maybe if you used a view as an intermediary, it would iron out the odd problem.&amp;nbsp; I don't know that this will work, but it's worth a shot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you run, would you try turning on the following options?&amp;nbsp; These are 9.4 options; I'm not sure they'll all work with Viya, but let's give it a shot.&amp;nbsp; This will add additional messages to the log which may give us a clue as to what's going on.&amp;nbsp; If one option or another doesn't work, comment it out and use the rest.&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;OPTIONS 	SASTRACE		=	",,,ds";
OPTIONS 	SASTRACELOC		=	SASLOG;
OPTIONS 	NOSTSUFFIX;
OPTIONS 	MsgLevel		=	I;
OPTIONS 	DEBUG			=	DBMS_SELECT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/insert-into-oracle-table-with-fedsql/m-p/759978#M22771</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-06T15:04:19Z</dc:date>
    </item>
  </channel>
</rss>

