<?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 STATEMENT in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817516#M829280</link>
    <description>Hi Sander,&lt;BR /&gt;&lt;BR /&gt;I think that the last sentence is fine if you want to use a cursor and there are other posibity that is to use the insert as select statment.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
    <pubDate>Thu, 03 Oct 2002 06:48:32 GMT</pubDate>
    <dc:creator>Justo Exposito</dc:creator>
    <dc:date>2002-10-03T06:48:32Z</dc:date>
    <item>
      <title>INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817512#M829276</link>
      <description>Hi group,&lt;BR /&gt;&lt;BR /&gt;I have a question regarding an INSERT STATEMENT.&lt;BR /&gt;&lt;BR /&gt;We use an insert statement &lt;BR /&gt;INSERT INTO MyTable(&lt;BR /&gt;field 1,&lt;BR /&gt;field 2,&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;field 20&lt;BR /&gt;VALUES(&lt;BR /&gt;Onhand_rec.upn,&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;onhand_rec.qty&lt;BR /&gt;...&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;However I only want records with a quanty (onhand_rec.qty)&amp;gt;0.&lt;BR /&gt;&lt;BR /&gt;My quick and dirty solution was:&lt;BR /&gt;DELETE FROM MYTABLE&lt;BR /&gt;WHERE qty =0;&lt;BR /&gt;&lt;BR /&gt;Is it possible to check the value of QTY with the above INSERT STATEMENT?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Sander</description>
      <pubDate>Wed, 02 Oct 2002 12:58:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817512#M829276</guid>
      <dc:creator>Sander Derix</dc:creator>
      <dc:date>2002-10-02T12:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817513#M829277</link>
      <description>WHERE qty &amp;gt; 0 &lt;BR /&gt;&lt;BR /&gt;in the insert statement??&lt;BR /&gt;&lt;BR /&gt;Or use perl&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 02 Oct 2002 13:44:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817513#M829277</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-10-02T13:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817514#M829278</link>
      <description>insert into mytable (select upn, ... ..., qty from onhand_rec where qty &amp;gt; 0);&lt;BR /&gt;&lt;BR /&gt;This assumes that the columns from mytable match onhand_rec in their format, otherwise you will need to insert default values as text in the select statement, or format conversions on the fields.&lt;BR /&gt;&lt;BR /&gt;My recommendation:- DBA or SQL course, as soon as!&lt;BR /&gt;&lt;BR /&gt;Share and Enjoy! Ian</description>
      <pubDate>Wed, 02 Oct 2002 13:47:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817514#M829278</guid>
      <dc:creator>Ian Dennison_1</dc:creator>
      <dc:date>2002-10-02T13:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817515#M829279</link>
      <description>Hi IAN,&lt;BR /&gt;&lt;BR /&gt;My mistake i didn't say that onhand_rec is a record in a cursor called onhand_cur.&lt;BR /&gt;&lt;BR /&gt;So again:&lt;BR /&gt;is it possible to create something like this:&lt;BR /&gt;INSERT INTO MyTable&lt;BR /&gt;  ...&lt;BR /&gt;  ...  &lt;BR /&gt;  qty&lt;BR /&gt;  ...&lt;BR /&gt;VALUES&lt;BR /&gt;  (SELECT&lt;BR /&gt;   ...&lt;BR /&gt;   ...&lt;BR /&gt;   onhand_rec.qty &lt;BR /&gt;   ...&lt;BR /&gt;   FROM onhand_cur&lt;BR /&gt;   WHERE onhand_rec.qty &amp;gt; 0)&lt;BR /&gt;&lt;BR /&gt;Sander</description>
      <pubDate>Thu, 03 Oct 2002 06:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817515#M829279</guid>
      <dc:creator>Sander Derix</dc:creator>
      <dc:date>2002-10-03T06:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817516#M829280</link>
      <description>Hi Sander,&lt;BR /&gt;&lt;BR /&gt;I think that the last sentence is fine if you want to use a cursor and there are other posibity that is to use the insert as select statment.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Thu, 03 Oct 2002 06:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817516#M829280</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2002-10-03T06:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817517#M829281</link>
      <description>Sander&lt;BR /&gt;No you cannot do "&lt;BR /&gt;SELECT ..&lt;BR /&gt;FROM cursor&lt;BR /&gt;WHERE (...)&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;You would have to put the WHERE clause into the cursor body.</description>
      <pubDate>Thu, 03 Oct 2002 06:59:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817517#M829281</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2002-10-03T06:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817518#M829282</link>
      <description>Sanders,&lt;BR /&gt;&lt;BR /&gt;1) You have to clean your table from your bad records&lt;BR /&gt;&lt;BR /&gt;2) change your table definition and add a constraint on "qty"&lt;BR /&gt;&lt;BR /&gt;cf. Oracle documentation on constraint&lt;BR /&gt;CREATE TABLE order_detail &lt;BR /&gt;  (CONSTRAINT pk_od PRIMARY KEY (order_id, part_no), &lt;BR /&gt;   order_id NUMBER &lt;BR /&gt;      CONSTRAINT fk_oid REFERENCES scott.order (order_id), &lt;BR /&gt;   part_no            NUMBER &lt;BR /&gt;      CONSTRAINT fk_pno REFERENCES scott.part (part_no), &lt;BR /&gt;   quantity            NUMBER &lt;BR /&gt;      CONSTRAINT nn_qty NOT NULL &lt;BR /&gt;      CONSTRAINT check_qty_low CHECK (quantity &amp;gt; 0), &lt;BR /&gt;   cost            NUMBER &lt;BR /&gt;      CONSTRAINT check_cost CHECK (cost &amp;gt; 0) ); &lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 03 Oct 2002 10:46:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817518#M829282</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-10-03T10:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT STATEMENT</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817519#M829283</link>
      <description>The answer is yes (as shown below)&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; spool test_insert.log&lt;BR /&gt;SQL&amp;gt;&lt;BR /&gt;SQL&amp;gt; create table test_inserts as&lt;BR /&gt;  2          select * from hrd_index_stats&lt;BR /&gt;  3          where blocks between 0 and 100&lt;BR /&gt;  4  ;&lt;BR /&gt;&lt;BR /&gt;Table created.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt;&lt;BR /&gt;SQL&amp;gt; insert into test_inserts&lt;BR /&gt;  2          (select * from hrd_index_stats&lt;BR /&gt;  3           where blocks &amp;gt; 1000)&lt;BR /&gt;  4  ;&lt;BR /&gt;&lt;BR /&gt;1339 rows created.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt;&lt;BR /&gt;SQL&amp;gt; Drop table test_inserts;&lt;BR /&gt;&lt;BR /&gt;Table dropped.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; spool off</description>
      <pubDate>Thu, 03 Oct 2002 11:57:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/insert-statement/m-p/2817519#M829283</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2002-10-03T11:57:19Z</dc:date>
    </item>
  </channel>
</rss>

