<?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 How to create a volatile table in oracle pass-thru SAS SQL code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361765#M85366</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to figure out how I can create temporary tables/volatile tables in SAS - ORACLE pass-thru sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my code, but it is throwing an error saying&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: ORACLE execute error: ORA-00933: SQL command not properly ended.&lt;/P&gt;
&lt;PRE&gt;PROC SQL;
	CONNECT TO ORACLE  (PATH="CS.WORLD" USER="&amp;amp;uid_db2." PASSWORD="&amp;amp;pwd_db2.");
	EXECUTE ( 
		CREATE GLOBAL TEMPORARY TABLE QUERY_FOR_INSTN_ENCTR  as 
		 select * from connection to oracle
			(
   SELECT t1.RGN_CD, 
          t1.ENCTR_SK, 
          t1.ENCTR_SRC_SYS_CD, 
          t1.CORR_MRN_PLS_NB, 
          t1.LOC_IK, 
          t1.CARE_SETNG_IK, 
          t1.PTNT_RSDNC_ZIP_IK AS PTNT_RSDNC_ZIP_IK1, 
          t1.ENCTR_STRT_TS, 
          t1.ENCTR_END_TS, 
          t1.DRG_IK, 
          t1.PTNT_RSDNC_ZIP_IK, 
          t1.PRNCPL_ICD_DIAG_IK, 
          t1.PRMY_ATND_PRVDR_IK, 
          t1.MDC_IK, 
          t1.ADMT_PRVDR_IK, 
          t1.PRNCPL_ICD_PROC_IK, 
          t1.PRNCPL_PROC_PRVDR_IK, 
          t1.PTNT_AGE_YR_NB, 
          t1.PTNT_BRTH_DT, 
          t1.PTNT_GNDR_CD, 
          t1.INPAT_LOS_DAY_CT, 
          t1.TTL_LOS_DAY_CT
      FROM IA_V.INSTN_ENCTR t1
      WHERE t1.RGN_CD = '08' AND t1.ENCTR_STRT_DT BETWEEN '1Jan2016:0:0:0'dt AND '31Mar2017:0:0:0'dt AND 
           t1.ENCTR_SRC_SYS_CD = 'C' AND t1.PTNT_AGE_YR_NB &amp;lt; 18
		   ) on commit preserve rows) by oracle;
	

	Create table STEP150 as
		SELECT * FROM CONNECTION TO ORACLE
			(
		Select *
			from QUERY_FOR_INSTN_ENCTR
			);
			disconnect from oracle;
QUIT; &lt;/PRE&gt;
&lt;P&gt;I am not sure my code/syntax is correct. Please advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2017 20:11:13 GMT</pubDate>
    <dc:creator>renjithr</dc:creator>
    <dc:date>2017-05-25T20:11:13Z</dc:date>
    <item>
      <title>How to create a volatile table in oracle pass-thru SAS SQL code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361765#M85366</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to figure out how I can create temporary tables/volatile tables in SAS - ORACLE pass-thru sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my code, but it is throwing an error saying&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: ORACLE execute error: ORA-00933: SQL command not properly ended.&lt;/P&gt;
&lt;PRE&gt;PROC SQL;
	CONNECT TO ORACLE  (PATH="CS.WORLD" USER="&amp;amp;uid_db2." PASSWORD="&amp;amp;pwd_db2.");
	EXECUTE ( 
		CREATE GLOBAL TEMPORARY TABLE QUERY_FOR_INSTN_ENCTR  as 
		 select * from connection to oracle
			(
   SELECT t1.RGN_CD, 
          t1.ENCTR_SK, 
          t1.ENCTR_SRC_SYS_CD, 
          t1.CORR_MRN_PLS_NB, 
          t1.LOC_IK, 
          t1.CARE_SETNG_IK, 
          t1.PTNT_RSDNC_ZIP_IK AS PTNT_RSDNC_ZIP_IK1, 
          t1.ENCTR_STRT_TS, 
          t1.ENCTR_END_TS, 
          t1.DRG_IK, 
          t1.PTNT_RSDNC_ZIP_IK, 
          t1.PRNCPL_ICD_DIAG_IK, 
          t1.PRMY_ATND_PRVDR_IK, 
          t1.MDC_IK, 
          t1.ADMT_PRVDR_IK, 
          t1.PRNCPL_ICD_PROC_IK, 
          t1.PRNCPL_PROC_PRVDR_IK, 
          t1.PTNT_AGE_YR_NB, 
          t1.PTNT_BRTH_DT, 
          t1.PTNT_GNDR_CD, 
          t1.INPAT_LOS_DAY_CT, 
          t1.TTL_LOS_DAY_CT
      FROM IA_V.INSTN_ENCTR t1
      WHERE t1.RGN_CD = '08' AND t1.ENCTR_STRT_DT BETWEEN '1Jan2016:0:0:0'dt AND '31Mar2017:0:0:0'dt AND 
           t1.ENCTR_SRC_SYS_CD = 'C' AND t1.PTNT_AGE_YR_NB &amp;lt; 18
		   ) on commit preserve rows) by oracle;
	

	Create table STEP150 as
		SELECT * FROM CONNECTION TO ORACLE
			(
		Select *
			from QUERY_FOR_INSTN_ENCTR
			);
			disconnect from oracle;
QUIT; &lt;/PRE&gt;
&lt;P&gt;I am not sure my code/syntax is correct. Please advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 20:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361765#M85366</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2017-05-25T20:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a volatile table in oracle pass-thru SAS SQL code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361785#M85371</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	CONNECT TO ORACLE  (PATH="CS.WORLD" USER="&amp;amp;uid_db2." PASSWORD="&amp;amp;pwd_db2.");
	EXECUTE ( 
		CREATE GLOBAL TEMPORARY TABLE QUERY_FOR_INSTN_ENCTR  as 
		 
   SELECT t1.RGN_CD, 
          t1.ENCTR_SK, 
          t1.ENCTR_SRC_SYS_CD, 
          t1.CORR_MRN_PLS_NB, 
          t1.LOC_IK, 
          t1.CARE_SETNG_IK, 
          t1.PTNT_RSDNC_ZIP_IK AS PTNT_RSDNC_ZIP_IK1, 
          t1.ENCTR_STRT_TS, 
          t1.ENCTR_END_TS, 
          t1.DRG_IK, 
          t1.PTNT_RSDNC_ZIP_IK, 
          t1.PRNCPL_ICD_DIAG_IK, 
          t1.PRMY_ATND_PRVDR_IK, 
          t1.MDC_IK, 
          t1.ADMT_PRVDR_IK, 
          t1.PRNCPL_ICD_PROC_IK, 
          t1.PRNCPL_PROC_PRVDR_IK, 
          t1.PTNT_AGE_YR_NB, 
          t1.PTNT_BRTH_DT, 
          t1.PTNT_GNDR_CD, 
          t1.INPAT_LOS_DAY_CT, 
          t1.TTL_LOS_DAY_CT
      FROM IA_V.INSTN_ENCTR t1
      WHERE t1.RGN_CD = '08' AND t1.ENCTR_STRT_DT BETWEEN '1Jan2016:0:0:0'dt AND '31Mar2017:0:0:0'dt AND 
           t1.ENCTR_SRC_SYS_CD = 'C' AND t1.PTNT_AGE_YR_NB &amp;lt; 18;
		    on commit preserve rows;) by oracle;
	

	Create table STEP150 as
		SELECT * FROM CONNECTION TO ORACLE
			(
		Select *
			from QUERY_FOR_INSTN_ENCTR
			);
			disconnect from oracle;
QUIT; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 21:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361785#M85371</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-05-25T21:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a volatile table in oracle pass-thru SAS SQL code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361791#M85375</link>
      <description>&lt;P&gt;Thank you, I am still getting an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: ORACLE execute error: ORA-00905: missing keyword.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 22:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361791#M85375</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2017-05-25T22:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a volatile table in oracle pass-thru SAS SQL code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361830#M85389</link>
      <description>&lt;P&gt;I'm not that familiar with Oracle, but isn't this SAS code, not Oracle code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;t1.ENCTR_STRT_DT BETWEEN '1Jan2016:0:0:0'dt AND '31Mar2017:0:0:0'dt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It has to be Oracle SQL and date formats.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 00:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-volatile-table-in-oracle-pass-thru-SAS-SQL-code/m-p/361830#M85389</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-26T00:11:59Z</dc:date>
    </item>
  </channel>
</rss>

