<?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: sql help throu unix login in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989169#M755399</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;First, use SQL*Loader to get the data into a staging area.  Then conditionally update the existing table using standard PL/SQL.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html" target="_blank"&gt;http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Thu, 26 Apr 2007 06:40:16 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2007-04-26T06:40:16Z</dc:date>
    <item>
      <title>sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989165#M755395</link>
      <description>Hi,&lt;BR /&gt;     I have a list of values in a file. I have to load these values into database. Before this, a check needs to be performed for the existence of these values in the database already. Im logging into oracle database from HP-UX box.&lt;BR /&gt;Can I use a command like sqlplus / &lt;BR /&gt;select * from table where column in $(cat $FILE)?????&lt;BR /&gt;Note, this file contains about million records which needs to be checked against database.</description>
      <pubDate>Thu, 26 Apr 2007 03:07:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989165#M755395</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2007-04-26T03:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989166#M755396</link>
      <description>&lt;!--!*#--&gt;Shalom,&lt;BR /&gt;&lt;BR /&gt;while read -r DATATLINE&lt;BR /&gt;do&lt;BR /&gt;  FIELD1=$(echo $DATALINE | awk '{print $1}')&lt;BR /&gt;  FIELD2=$(echo $DATALINE | awk '{print $2}')&lt;BR /&gt;   #repeat for other fields.&lt;BR /&gt;   # write data (sql plus statement)&lt;BR /&gt;done &amp;lt; file&lt;BR /&gt;&lt;BR /&gt;Note the code isn't all that efficient, running awk over and over again, but its very easy to understand.&lt;BR /&gt;&lt;BR /&gt;If the data is colon delimited for example, change awk to awk -F:&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 26 Apr 2007 03:16:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989166#M755396</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-04-26T03:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989167#M755397</link>
      <description>Hi viseshu,&lt;BR /&gt;as far sa i know this select is not possible;&lt;BR /&gt;maybe is better to load data from file in a "staging" table , make comparison with data in target table and then insert new values.&lt;BR /&gt;&lt;BR /&gt;my 2 cent&lt;BR /&gt;best regards &lt;BR /&gt;pg</description>
      <pubDate>Thu, 26 Apr 2007 03:16:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989167#M755397</guid>
      <dc:creator>Piergiacomo Perini</dc:creator>
      <dc:date>2007-04-26T03:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989168#M755398</link>
      <description>It hasn't become clear to me whether you simply wish to check for the existence of certain column names (aka table fields?, sorry I'm no DBA), or do you really wish to check if the values for records of these fields are the same as in your comparison file?&lt;BR /&gt;My first assumption however would make more sense to me.&lt;BR /&gt;Then this should be fairly easy.&lt;BR /&gt;I think to recall that you can visualize a table's structure with something like&lt;BR /&gt;(is this Oracle SQL?)&lt;BR /&gt;desc tablename;&lt;BR /&gt;Whatever, every brand of DB has some sort of data dictionary that lets you query tables' field names at no cost at all.&lt;BR /&gt;However, if you really need to select over milions of records, I would suggest to reduce this to a single SQL statement to avoid repetative costly queries.&lt;BR /&gt;But as said, I lack any DBMS knowledge to advise.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Apr 2007 05:05:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989168#M755398</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-04-26T05:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989169#M755399</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;First, use SQL*Loader to get the data into a staging area.  Then conditionally update the existing table using standard PL/SQL.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html" target="_blank"&gt;http://www.oreilly.com/catalog/orsqlloader/chapter/ch01.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Thu, 26 Apr 2007 06:40:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989169#M755399</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2007-04-26T06:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989170#M755400</link>
      <description>hi viseshu,&lt;BR /&gt;&lt;BR /&gt;what version of oracle database are you running?&lt;BR /&gt;you may look into external table feature.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Thu, 26 Apr 2007 08:28:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989170#M755400</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-26T08:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989171#M755401</link>
      <description>hi again, &lt;BR /&gt;&lt;BR /&gt;Assuming your data is in a file as /tmp/emp.dat&lt;BR /&gt;&lt;BR /&gt;one simple example would be as follows:&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; create or replace directory data_dir as '/tmp/';&lt;BR /&gt;  Directory created.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; create table external_table&lt;BR /&gt;  2  (EMPNO NUMBER(4) ,&lt;BR /&gt;  3   ENAME VARCHAR2(10),&lt;BR /&gt;  4   JOB VARCHAR2(9),&lt;BR /&gt;  5   MGR NUMBER(4),&lt;BR /&gt;  6   HIREDATE DATE,&lt;BR /&gt;  7   SAL NUMBER(7, 2),&lt;BR /&gt;  8   COMM NUMBER(7, 2),&lt;BR /&gt;  9   DEPTNO NUMBER(2)&lt;BR /&gt; 10  )&lt;BR /&gt; 11  ORGANIZATION EXTERNAL&lt;BR /&gt; 12  ( type oracle_loader&lt;BR /&gt; 13    default directory data_dir&lt;BR /&gt; 14    access parameters&lt;BR /&gt; 15    ( fields terminated by ',' )&lt;BR /&gt; 16    location ('emp.dat')&lt;BR /&gt; 17  )&lt;BR /&gt; 18  /&lt;BR /&gt;Table created.&lt;BR /&gt;&lt;BR /&gt;You can then just query the table using:&lt;BR /&gt;SQL&amp;gt; select count(*) from external_table;&lt;BR /&gt;&lt;BR /&gt;  COUNT(*)&lt;BR /&gt;----------&lt;BR /&gt;    410340&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Thu, 26 Apr 2007 08:53:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989171#M755401</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-26T08:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989172#M755402</link>
      <description>Hi Yogeeraj,&lt;BR /&gt;              Not sure whether i can create a table as you suggested. Is there any other way where in i can check for duplicate values against database?? I have all the list of those values in one file.</description>
      <pubDate>Thu, 26 Apr 2007 09:11:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989172#M755402</guid>
      <dc:creator>viseshu</dc:creator>
      <dc:date>2007-04-26T09:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989173#M755403</link>
      <description>There are lot of options in front of you for weedind out duplicates in your data.  Either 1) create a temp table inside the database or 2) create an external table to hold the file's million or so records or 3) dump contents of your DB table into a flat file and then use the OS utilities to weed out dups. Choice 1) is probably your best bet as you can verify dups and insert them  within the same SQL.&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Thu, 26 Apr 2007 11:11:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989173#M755403</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-04-26T11:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: sql help throu unix login</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989174#M755404</link>
      <description>hi again,&lt;BR /&gt;&lt;BR /&gt;there are two approaches that can choose to perform this:&lt;BR /&gt;1. Bring the data in the OS file to the database&lt;BR /&gt; - implies using SQLLOADER or EXTERNAL TABLES&lt;BR /&gt;&lt;BR /&gt;2. Bring the data in the tables to the OS as an OS file.&lt;BR /&gt; - implies exporting the table as a text file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;After you have done one of the above, then only you can do the comparison.&lt;BR /&gt;&lt;BR /&gt;The choice is yours.&lt;BR /&gt;&lt;BR /&gt;let us know if you need any further assistance.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Fri, 27 Apr 2007 01:38:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-help-throu-unix-login/m-p/3989174#M755404</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2007-04-27T01:38:40Z</dc:date>
    </item>
  </channel>
</rss>

