<?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 SQL Loader in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132883#M799709</link>
    <description>Hi,&lt;BR /&gt;I receive a data file with customer name and date of join.&lt;BR /&gt;&lt;BR /&gt;Sample&lt;BR /&gt;&lt;BR /&gt;Cus100 06/26/01&lt;BR /&gt;Cus200 07/23/02&lt;BR /&gt;Cus300 10/22/02&lt;BR /&gt;Cus400 10/21/03&lt;BR /&gt;Cus500 11/26/03&lt;BR /&gt;&lt;BR /&gt;I want to load the above data into a table which has &lt;BR /&gt;3 columns (Custnum , Date of join, Status).&lt;BR /&gt;&lt;BR /&gt;For Status column i need to update based on the date of join (DOJ). Like if DOJ &amp;gt;= 06/01/02 and DOJ &amp;lt;=12/31/02 then status = S1 else DOJ &amp;gt;= 01/01/03 and DOJ &amp;lt;=06/01/02 then status = S2 and so on ......&lt;BR /&gt;&lt;BR /&gt;this i can do using an update statement after the sqlload. But i want it to be done while loading itself. Is there any option in sqlload ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Dec 2003 14:21:07 GMT</pubDate>
    <dc:creator>Raj_38</dc:creator>
    <dc:date>2003-12-01T14:21:07Z</dc:date>
    <item>
      <title>SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132883#M799709</link>
      <description>Hi,&lt;BR /&gt;I receive a data file with customer name and date of join.&lt;BR /&gt;&lt;BR /&gt;Sample&lt;BR /&gt;&lt;BR /&gt;Cus100 06/26/01&lt;BR /&gt;Cus200 07/23/02&lt;BR /&gt;Cus300 10/22/02&lt;BR /&gt;Cus400 10/21/03&lt;BR /&gt;Cus500 11/26/03&lt;BR /&gt;&lt;BR /&gt;I want to load the above data into a table which has &lt;BR /&gt;3 columns (Custnum , Date of join, Status).&lt;BR /&gt;&lt;BR /&gt;For Status column i need to update based on the date of join (DOJ). Like if DOJ &amp;gt;= 06/01/02 and DOJ &amp;lt;=12/31/02 then status = S1 else DOJ &amp;gt;= 01/01/03 and DOJ &amp;lt;=06/01/02 then status = S2 and so on ......&lt;BR /&gt;&lt;BR /&gt;this i can do using an update statement after the sqlload. But i want it to be done while loading itself. Is there any option in sqlload ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Dec 2003 14:21:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132883#M799709</guid>
      <dc:creator>Raj_38</dc:creator>
      <dc:date>2003-12-01T14:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132884#M799710</link>
      <description>I'm a lightweight with sqlloader, but our scripts are upload only, update after the data is on the database.&lt;BR /&gt;&lt;BR /&gt;That is a good indicator that you should do things that way.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 01 Dec 2003 14:57:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132884#M799710</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-01T14:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132885#M799711</link>
      <description>If you have acces to it, take a look at these Metalink documents.  They have examples of using the decode function (and other relevant stuff) within your SQL*Loader control file.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;amp;p_id=1083518.6" target="_blank"&gt;http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;amp;p_id=1083518.6&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=FOR&amp;amp;p_id=592224.999" target="_blank"&gt;http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=FOR&amp;amp;p_id=592224.999&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;amp;p_id=171762.1" target="_blank"&gt;http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&amp;amp;p_id=171762.1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Dec 2003 15:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132885#M799711</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2003-12-01T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132886#M799712</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here is an alternative in the form of an awk script:&lt;BR /&gt;BEGIN\&lt;BR /&gt;{&lt;BR /&gt;  SQLFILE="custinsert.sql";&lt;BR /&gt;  print "sqlplus /nolog&amp;lt;&lt;EOF&gt; SQLFILE;&lt;BR /&gt;  print "connect user/passwd" &amp;gt; SQLFILE;&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;DATE=substr($0,14,2) substr($0,8,2) substr($0,11,2);&lt;BR /&gt;if ((DATE &amp;gt;= "020601") &amp;amp;&amp;amp; (DATE &amp;lt;= "021231"))&lt;BR /&gt;  STATUS="S1";&lt;BR /&gt;if ((DATE &amp;gt;= "030101") &amp;amp;&amp;amp; (DATE &amp;lt;= "030630"))&lt;BR /&gt;  STATUS="S2";&lt;BR /&gt;if ((DATE &amp;gt;= "030701") &amp;amp;&amp;amp; (DATE &amp;lt;= "031231"))&lt;BR /&gt;  STATUS="S3";&lt;BR /&gt;print "*" DATE "*" STATUS "*";&lt;BR /&gt;print "insert into table values($1,$2,"STATUS")" &amp;gt; SQLFILE;&lt;BR /&gt;}&lt;BR /&gt;END\&lt;BR /&gt;{&lt;BR /&gt;print "EOF" &amp;gt;&amp;gt; SQLFILE;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;this is only a rough idea, but should give you an idea how it works.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;/EOF&gt;</description>
      <pubDate>Mon, 01 Dec 2003 15:26:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132886#M799712</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-01T15:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132887#M799713</link>
      <description>If you are running 9i, the file is a good candidate for an external table. As an external table you can access the two columns that you have and then do the steps for the status column as you insert into your internal table. &lt;BR /&gt;&lt;BR /&gt;BTW external tables use sqlloadr in an transparent manner. So, you are accomplishing running the loader and doing the conditional processing at the same time.&lt;BR /&gt;&lt;BR /&gt;External tables can be good if you receive the file periodically, but for a one time deal. Go with sqlloadr and do the post processing as the others have suggested.</description>
      <pubDate>Tue, 02 Dec 2003 08:37:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132887#M799713</guid>
      <dc:creator>R. Allan Hicks</dc:creator>
      <dc:date>2003-12-02T08:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Loader</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132888#M799714</link>
      <description>Raj, you could also use a trigger on the table as well.  The following is some code that was modified from the Metalink website.  Because the trigger is modifying a row that was already modified, it needs to be done in this way.  &lt;BR /&gt;&lt;BR /&gt;create or replace package password_pkg as&lt;BR /&gt;   type      password_tab_type is table of rowid index by binary_integer;&lt;BR /&gt;   password_tab   password_tab_type;&lt;BR /&gt;   password_index binary_integer;&lt;BR /&gt;end password_pkg;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;create or replace trigger password_bef_stm_all&lt;BR /&gt;before insert or update of password,expiretime,comments on password&lt;BR /&gt;begin&lt;BR /&gt;   password_pkg.password_index := 0;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;create or replace trigger password_aft_row_all&lt;BR /&gt;after insert or update of password,expiretime,comments on password&lt;BR /&gt;for each row&lt;BR /&gt;begin&lt;BR /&gt;   password_pkg.password_index := password_pkg.password_index + 1;&lt;BR /&gt;   password_pkg.password_tab(password_pkg.password_index) := :new.rowid;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;create or replace trigger password_aft_stm_all&lt;BR /&gt;after insert or update of password,expiretime,comments on password&lt;BR /&gt;begin&lt;BR /&gt;   for i in 1 .. password_pkg.password_index loop&lt;BR /&gt;      update password set passdate = to_date(to_char(sysdate)) where rowid = password_pkg.password_tab(i);&lt;BR /&gt;      dbms_output.put_line(password_pkg.password_tab(i));&lt;BR /&gt;   end loop;&lt;BR /&gt;   password_pkg.password_index := 0;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Tue, 02 Dec 2003 17:38:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sql-loader/m-p/3132888#M799714</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-12-02T17:38:55Z</dc:date>
    </item>
  </channel>
</rss>

