<?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: SAS program stuck forever while executing proc sql insert in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906170#M357839</link>
    <description>Thank you but No that’s what I added after I kept having this problem.&lt;BR /&gt;</description>
    <pubDate>Tue, 05 Dec 2023 03:23:54 GMT</pubDate>
    <dc:creator>leen</dc:creator>
    <dc:date>2023-12-05T03:23:54Z</dc:date>
    <item>
      <title>SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906146#M357825</link>
      <description>&lt;P&gt;Hi, my sas is stuck everytime I try to run this code:&lt;/P&gt;&lt;PRE&gt;proc sql;
    insert into myora.Customer_t
    set customerid = 100,
        customername = "Cool Future",
        customeraddress = "123 Lake Side Drive",
        customercity = "Ithaca",
        customerstate = "NY",
        customerpostalcode = "14850";
quit;&lt;/PRE&gt;&lt;P&gt;But I can connect to myora and select as normal (as shown below:)&lt;/P&gt;&lt;PRE&gt;1    libname myora oracle user="xxx" password=XXXXXXXXXX path="xe";
NOTE: Libref MYORA was successfully assigned as follows:
      Engine:        ORACLE
      Physical Name: xe
1  !                                                                  run;
2    libname orasas "D:\hw5";
NOTE: Libref ORASAS was successfully assigned as follows:
      Engine:        V9
      Physical Name: D:\hw5

3    title2 "Output2";
4    proc sql;
5    select * from
6    (select * from myora.customer_t where customerstate="NY" or customerstate="PA")
7    order by customerstate, customername;
NOTE: Writing HTML Body file: sashtml.htm
8    quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.25 seconds
      cpu time            0.09 seconds

&lt;/PRE&gt;&lt;P&gt;This is what it looks like when I submit those code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leen_0-1701733228810.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90781i7781D04DAE0E2B04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="leen_0-1701733228810.png" alt="leen_0-1701733228810.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really don't know why it is stuck every time just for this insert statement. I tried to wait for it. But it just won't finish executing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no log output, I can't even scroll the log window, or anywhere else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can insert this row as normal in SQL developer:&lt;/P&gt;&lt;PRE&gt;INSERT INTO Customer_t (customerid, customername, customeraddress, customercity, customerstate, customerpostalcode)
VALUES (100, 'Cool Future', '123 Lake Side Drive', 'Ithaca', 'NY', '14850');&lt;/PRE&gt;&lt;P&gt;(Log: "1 row inserted.")&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 23:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906146#M357825</guid>
      <dc:creator>leen</dc:creator>
      <dc:date>2023-12-04T23:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906148#M357826</link>
      <description>&lt;P&gt;Are you sure that the credentials you log into Oracle with have permission to write to that particular table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, what constraints are on the customer_t table? Perhaps what you attempt to insert violates one or more constraints such as missing a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in the possibly lower probability of causing problems I see you reference "Customer_t" in the first SQL and "customer_t" in the second. I don't use Oracle so don't know how case sensitive names for table may be. So you may want to ask the Oracle administrators.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 23:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906148#M357826</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-12-04T23:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906149#M357827</link>
      <description>Oracle sql plus is not case sensitive. The credentials are the same as those in sql developer. But I can insert as normal there, which means there shouldn’t be any permission/modifying rule issue. even though there is one i think I should get an error instead of running forever.&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Dec 2023 23:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906149#M357827</guid>
      <dc:creator>leen</dc:creator>
      <dc:date>2023-12-04T23:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906153#M357829</link>
      <description>&lt;P&gt;Why are you using two totally different syntaxes for the INSERT statement?&lt;/P&gt;
&lt;P&gt;What happens if you use the second syntax in SAS?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname myora oracle ...... ;
proc sql;
INSERT INTO myora.Customer_t (customerid, customername, customeraddress, customercity, customerstate, customerpostalcode)
VALUES (100, 'Cool Future', '123 Lake Side Drive', 'Ithaca', 'NY', '14850')
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2023 00:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906153#M357829</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-05T00:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906154#M357830</link>
      <description>&lt;P&gt;Just as a thought: In the screenshot you share you're issuing a DELETE and an INSERT within the same Proc SQL. It could be - just a theory - that the DELETE doesn't get committed and though the INSERT is waiting.&lt;/P&gt;
&lt;P&gt;To test the theory: Issue the DELETE and INSERT using two Proc SQL to ensure that the DELETE gets commited prior to the INSERT.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 00:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906154#M357830</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-05T00:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906170#M357839</link>
      <description>Thank you but No that’s what I added after I kept having this problem.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2023 03:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906170#M357839</guid>
      <dc:creator>leen</dc:creator>
      <dc:date>2023-12-05T03:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906172#M357840</link>
      <description>&lt;P&gt;Try SQL Passthru. That's exactly like using SQL Developer:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  connect using myora;
  execute (
INSERT INTO Customer_t (customerid, customername, customeraddress, customercity, customerstate, customerpostalcode)&lt;BR /&gt;VALUES (100, 'Cool Future', '123 Lake Side Drive', 'Ithaca', 'NY', '14850')
) by myora;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2023 03:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906172#M357840</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-12-05T03:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906242#M357847</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/460428"&gt;@leen&lt;/a&gt; .&lt;BR /&gt;Reading this post along with your other post (&lt;A href="https://communities.sas.com/t5/SAS-Programming/SAS-takes-so-long-to-initiate-print-even-very-small-dataset/m-p/905810#M357718" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/SAS-takes-so-long-to-initiate-print-even-very-small-dataset/m-p/905810#M357718&lt;/A&gt; ) and the fact that you have used path="XE",&amp;nbsp; gives me the impression that you have PC SAS and Oracle express installed on your PC and that your SAS initialization and often running small tasks is slow. &lt;BR /&gt;Under these circumstances creating a libname statement implies bring your entire Oracle table into SAS at the backend. That may cause the execution of the process to be slow.&lt;BR /&gt;Rather than dwell on the mechanics of the process, I would recommend that you try SQL pass through as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 14:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906242#M357847</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-12-05T14:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906394#M357900</link>
      <description>&lt;P&gt;I can use sql pass through but it's a homework assignment so i am required to use libref. Anyway I mis-clicked on the accept button and I might find solution by myself. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 07:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906394#M357900</guid>
      <dc:creator>leen</dc:creator>
      <dc:date>2023-12-06T07:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program stuck forever while executing proc sql insert</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906580#M357959</link>
      <description>&lt;P&gt;To be pedantic, you are using the LIBREF as the definition for the Passthru connection...&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 19:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program-stuck-forever-while-executing-proc-sql-insert/m-p/906580#M357959</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-12-06T19:08:44Z</dc:date>
    </item>
  </channel>
</rss>

