<?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: Delete data from multiple tables in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381256#M665040</link>
    <description>Hi Martin,&lt;BR /&gt;&lt;BR /&gt;You need to steps to do this in a practical way:&lt;BR /&gt;&lt;BR /&gt;a) generate the delete script:&lt;BR /&gt;&lt;BR /&gt;select 'delete from '||dtc.table_name||' where DEVICE_ID = ''A1'';'&lt;BR /&gt;from dba_tab_columns dtc&lt;BR /&gt;where dtc.column_name = 'DEVICE_ID';&lt;BR /&gt;&lt;BR /&gt;b) Validade all the table names, copy the script to a *.sql (Unix) file or to the clipboard (Windows) and execute it in SQL*Plus&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
    <pubDate>Wed, 25 Mar 2009 08:28:04 GMT</pubDate>
    <dc:creator>Eric Antunes</dc:creator>
    <dc:date>2009-03-25T08:28:04Z</dc:date>
    <item>
      <title>Delete data from multiple tables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381253#M665037</link>
      <description>I want to delete the data from all the tables in this database which having device_id="A1"&lt;BR /&gt;How to do it. 2 issues heres&lt;BR /&gt;1) There are about 40 tables in this database and don't know which table contained the field device_id .&lt;BR /&gt;2) We have several this kind of deviced_id need to be deleted, e.g. device_id="A1", or device _id="A2", "A3". can sql read this info from a table and process?  thanks</description>
      <pubDate>Tue, 17 Mar 2009 12:53:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381253#M665037</guid>
      <dc:creator>Alain Yoshida</dc:creator>
      <dc:date>2009-03-17T12:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Delete data from multiple tables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381254#M665038</link>
      <description>&lt;BR /&gt;Martin, &lt;BR /&gt;&lt;BR /&gt;This is really  DATABASE questing entirely independent of the OS (hpux). As such this question is better asked (for your own sake, and to cut down noise here) in a database specific forum.&lt;BR /&gt;&lt;BR /&gt;What database are you refering to?&lt;BR /&gt;If it is oracle, then here are some queries to get you going.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select table_name from dict where table_name like '%TAB%COL%';&lt;BR /&gt;---&amp;gt; USER_TAB_COLS&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; describe USER_TAB_COLS&lt;BR /&gt;---&amp;gt;  TABLE_NAME, COLUMN_NAME&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; select TABLE_NAME, COLUMN_NAME from USER_TAB_COLS where COLUMN_NAME like '%DEVICE%ID%'&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Once you know your tables and column you casn then proceed with the delete commands using either the ...WHERE device_id_col IN (...)&lt;BR /&gt;or use a HELPER TABLE with device ids to be listed and then delete correspondig records.&lt;BR /&gt;&lt;BR /&gt;This is really basic SQL stuff, and if you are not ready to deal with this jsut yet, then be sure to work with a peer, GOOGLE a lot, and/or get your hand on a SQL COOKBOOK.&lt;BR /&gt;&lt;BR /&gt;Good Luck!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381254#M665038</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-17T13:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Delete data from multiple tables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381255#M665039</link>
      <description>Dear Martin&lt;BR /&gt;&lt;BR /&gt;sql &amp;gt;delete from table1, table2 where device id=A1;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sajjad&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Mar 2009 06:35:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381255#M665039</guid>
      <dc:creator>Sajjad Sahir</dc:creator>
      <dc:date>2009-03-25T06:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete data from multiple tables</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381256#M665040</link>
      <description>Hi Martin,&lt;BR /&gt;&lt;BR /&gt;You need to steps to do this in a practical way:&lt;BR /&gt;&lt;BR /&gt;a) generate the delete script:&lt;BR /&gt;&lt;BR /&gt;select 'delete from '||dtc.table_name||' where DEVICE_ID = ''A1'';'&lt;BR /&gt;from dba_tab_columns dtc&lt;BR /&gt;where dtc.column_name = 'DEVICE_ID';&lt;BR /&gt;&lt;BR /&gt;b) Validade all the table names, copy the script to a *.sql (Unix) file or to the clipboard (Windows) and execute it in SQL*Plus&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Wed, 25 Mar 2009 08:28:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/delete-data-from-multiple-tables/m-p/4381256#M665040</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2009-03-25T08:28:04Z</dc:date>
    </item>
  </channel>
</rss>

