<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/styles/XMLStylesDoc_xhtml11_en.xsl"?><!DOCTYPE document SYSTEM "/schemas/XMLStyles10.dtd">
<document xmlns="http://XMLStyles.com/namespaces/styles" xmlns:xst="http://XMLStyles.com/namespaces/styles" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:date="http://exslt.org/dates-and-times">
   <noxml>
      <p xmlns="http://www.w3.org/1999/xhtml"/>
      <!-- You are viewing the source.  The following message should be ignored if you did "View Source" in your browser. -->
      <p xmlns="http://www.w3.org/1999/xhtml">
ATTENTION: XML WEB PAGES NOT SUPPORTED
   If you see this message, your current browser does not support the
   1999 XSLT 1.0 (or later) standard for XML web pages such as this one.
   Please upgrade your browser to a newer version
   that supports 1999 or later standards such as:
      Mozilla Firefox version 1.0.2 or later (GetFirefox -&gt; http://www.GetFirefox.com/)
      Netscape version 8 or later
      Safari version 1.3 or later
      Opera version 9 or later
      Microsoft Internet Explorer (MSIE) version 5 or later
   For further assistance, contact the software vendor for your browser.
   To go to the X<!-- extended HTML -->HTML version of this page click the following link:
<a href="index.html">index.html</a>
      </p>
      <p xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
   </noxml>
   <path>/computers/databases/ibmdb2/</path>
   <site>How To Guides</site>
   <logo xlink:type="simple" xlink:href="/images/howtohome.jpg" media="screen" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguides.jpg" media="print" width="240" height="34">How To Guides</logo>
   <logo xlink:type="simple" xlink:href="/images/howtoguidesmobile.jpg" media="handheld" width="150" height="17">How To Guides</logo>
   <navigation where="sections">
      <label>How To Guides</label>
      <link xlink:type="simple" xlink:href="/business/index.xml">Business</link>
      <link xlink:type="simple" xlink:href="/computers/index.xml">Computers</link>
      <link xlink:type="simple" xlink:href="/computers/databases/index.xml">Databases</link>
      <link xlink:type="simple" xlink:href="/internet/index.xml">Internet</link>
      <link xlink:type="simple" xlink:href="/mobile/index.xml">Mobile</link>
      <link xlink:type="simple" xlink:href="/money/index.xml">Money</link>
      <link xlink:type="simple" xlink:href="/movies/index.xml">Movies</link>
      <link xlink:type="simple" xlink:href="/computers/os/index.xml">Operating Systems</link>
   </navigation>
   <navigation where="up">
      <link xlink:type="simple" xlink:href="../../">Computers</link>
      <link xlink:type="simple" xlink:href="../">Databases</link>
   </navigation>
   <navigation where="subsections">
      <link xlink:type="simple" xlink:href="/computers/databases/design.xml">Design</link>
      <link xlink:type="simple" xlink:href="/computers/databases/tuning.xml">Tuning</link>
      <link xlink:type="simple" xlink:href="/computers/databases/derby/">Apache Derby</link>
      <link xlink:type="simple" xlink:href="index.xml">IBM DB2</link>
      <link xlink:type="simple" xlink:href="/computers/databases/mysql/">MySQL</link>
      <link xlink:type="simple" xlink:href="/computers/databases/oracle/">Oracle</link>
      <link xlink:type="simple" xlink:href="/computers/databases/sqlserver/">SQL Server</link>
   </navigation>
   <section id="body" type="body">
      <pages name="index">
         <title>How To Guides for IBM DB2 UDB Databases</title>
         <label>DB2 UDB</label>
         <navigation where="pages">
            <label>DB2 UDB</label>
            <link xlink:type="simple" xlink:href="index.xml">Summary</link>
            <link xlink:type="simple" xlink:href="ftp.xml">FTP</link>
            <link xlink:type="simple" xlink:href="jdbc.xml">JDBC</link>
            <link xlink:type="simple" xlink:href="routines.xml">Routines</link>
            <link xlink:type="simple" xlink:href="software.xml">Software</link>
         </navigation>
         <h1>"How To" Guides for IBM DB2 UDB Databases</h1>
         <page id="ftp" name="ftp">
            <title>FTP Access to DB2</title>
            <label>FTP</label>
            <description>Data can be extracted remotely from DB2 and easily loaded into spreadsheets or other applications.</description>
            <navigation where="up">
               <link xlink:type="simple" xlink:href="index.xml">IBM DB2</link>
            </navigation>
            <h1>Extracting data from DB2 using FTP</h1>
            <subpage id="N1009E" name="ftp">
               <p>Data can be extracted remotely from DB2 and easily loaded into spreadsheets or other applications.
               </p>
               <ol>
                  <li>Create a file containing the SQL to be used for extracting the data.
                  </li>
                  <li>Use FTP to connect to the system where DB2 is running and upload the SQL file.
                     <blockcode>
                        <l>site filetype=seq</l>
                        <l>put <i>myquery</i>.sql</l>
                     </blockcode>
                  </li>
                  <li>Extract the data to a different file name.
                     <blockcode>
                        <l>site filetype=sql</l>
                        <l>site db2=<i>db2x</i>​</l>
                        <l>site spread</l>
                        <l>get <i>myquery</i>.sql <i>myquery</i>.dat</l>
                     </blockcode>
                     <code>
                        <i>db2x</i>
                     </code> is the DB2 system that the data is to be extracted from.
                     With <code>site spread</code>, the downloaded file will be in tab-delimited format,
                     which makes it easier to load into most applications, such as Microsoft Excel.
                     <code>site nospread</code> can be used for applications that do not support tab-delimited files.
                  </li>
               </ol>
               <p>Note that some FTP clients do not support the <code>site</code> command, but
                  may allow the command to be executed by preceding it with <code>quote</code>.
               </p>
               <blockcode>
                  <l>quote site ...</l>
               </blockcode>
               <p>If the system that the data is to be downloaded to has an FTP server running,
                  the data can be sent from an FTP client running on the host system.
                  This allows the data to be sent automatically by scheduling the transfer as a batch job.
                  In this case, the <code>locsite</code> command is used to set
                  parameters on the local system where the FTP client is running.
               </p>
               <blockcode>
                  <l>locsite filetype=sql</l>
                  <l>locsite db2=<i>db2x</i>​</l>
                  <l>locsite spread</l>
                  <l>put <i>myquery</i>.sql <i>myquery</i>.dat</l>
               </blockcode>
            </subpage>
            <updated local="2006-11-16">Friday November 16, 2006</updated>
         </page>
      </pages>
   </section>
   <copyright>Copyright © 2006 How To Guides .com. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.</copyright>
   <disclaimer>All information, links, forms, applications and other items on this site or obtained from it are provided <b>AS IS</b>, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</disclaimer>
   <ids urchin="UA-779578-2"/>
</document>

