Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 8a57a30ed75c07795d304e1f9d96f5df > files > 53

libfreetds0-doc-0.82-5mdv2009.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>FreeTDS API: Bulk copy functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>Bulk copy functions<br>
<small>
[<a class="el" href="a00274.html">The db-lib API</a>]</small>
</h1>Functions to bulk-copy (a/k/a <em>bcp</em>) data to/from the database.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00278.html">Internal bcp functions</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static functions internal to the bcp library. <br></td></tr>

<p>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">DBINT&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga14">bcp_batch</a> (DBPROCESS *dbproc)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Commit a set of rows to the table.  <a href="#ga14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga16">bcp_bind</a> (DBPROCESS *dbproc, BYTE *varaddr, int prefixlen, DBINT varlen, BYTE *terminator, int termlen, int vartype, int table_column)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bind a program host variable to a database column.  <a href="#ga16"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga3">bcp_colfmt</a> (DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, const BYTE *host_term, int host_termlen, int table_colnum)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify the format of a datafile prior to writing to a table.  <a href="#ga3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga4">bcp_colfmt_ps</a> (DBPROCESS *dbproc, int host_colnum, int host_type, int host_prefixlen, DBINT host_collen, BYTE *host_term, int host_termlen, int table_colnum, DBTYPEINFO *typeinfo)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify the format of a host file for bulk copy purposes, with precision and scale support for numeric and decimal columns.  <a href="#ga4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga1">bcp_collen</a> (DBPROCESS *dbproc, DBINT varlen, int table_column)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the length of a host variable to be written to a table.  <a href="#ga1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga7">bcp_colptr</a> (DBPROCESS *dbproc, BYTE *colptr, int table_column)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Override <a class="el" href="a00277.html#ga16">bcp_bind()</a> by pointing to a different host variable.  <a href="#ga7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga2">bcp_columns</a> (DBPROCESS *dbproc, int host_colcount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Indicate how many columns are to be found in the datafile.  <a href="#ga2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga5">bcp_control</a> (DBPROCESS *dbproc, int field, DBINT value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set BCP options for uploading a datafile.  <a href="#ga5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">DBINT&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga15">bcp_done</a> (DBPROCESS *dbproc)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Conclude the transfer of data from program variables.  <a href="#ga15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga10">bcp_exec</a> (DBPROCESS *dbproc, DBINT *rows_copied)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write a datafile to a table.  <a href="#ga10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">DBBOOL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga8">bcp_getl</a> (LOGINREC *login)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">See if <a class="el" href="a00274.html#ga4">BCP_SETL()</a> was used to set the LOGINREC for BCP work.  <a href="#ga8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga0">bcp_init</a> (DBPROCESS *dbproc, const char *tblname, const char *hfile, const char *errfile, int direction)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Prepare for bulk copy operation on a table.  <a href="#ga0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga13">bcp_moretext</a> (DBPROCESS *dbproc, DBINT size, BYTE *text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write some text or image data to the server. Not implemented, sadly.  <a href="#ga13"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga6">bcp_options</a> (DBPROCESS *dbproc, int option, BYTE *value, int valuelen)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set "hints" for uploading a file. A FreeTDS-only function.  <a href="#ga6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga11">bcp_readfmt</a> (DBPROCESS *dbproc, char *filename)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read a format definition file.  <a href="#ga11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga9">bcp_sendrow</a> (DBPROCESS *dbproc)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write data in host variables to the table.  <a href="#ga9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RETCODE&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00277.html#ga12">bcp_writefmt</a> (DBPROCESS *dbproc, char *filename)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write a format definition file. Not Implemented.  <a href="#ga12"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Functions to bulk-copy (a/k/a <em>bcp</em>) data to/from the database. 
<p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga14" doxytag="bcp.c::bcp_batch"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DBINT bcp_batch           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>dbproc</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Commit a set of rows to the table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>If not called, <a class="el" href="a00277.html#ga15">bcp_done()</a> will cause the rows to be saved. </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>Count of rows saved, or -1 on error. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga16" doxytag="bcp.c::bcp_bind"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_bind           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>varaddr</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>prefixlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>varlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>terminator</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>termlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>vartype</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>table_column</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Bind a program host variable to a database column. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>varaddr</em>&nbsp;</td><td>address of host variable </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>prefixlen</em>&nbsp;</td><td>length of any prefix found at the beginning of <em>varaddr</em>, in bytes. Use zero for fixed-length datatypes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>varlen</em>&nbsp;</td><td>bytes of data in <em>varaddr</em>. Zero for NULL, -1 for fixed-length datatypes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>terminator</em>&nbsp;</td><td>byte sequence that marks the end of the data in <em>varaddr</em> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>termlen</em>&nbsp;</td><td>length of <em>terminator</em> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>vartype</em>&nbsp;</td><td>datatype of the host variable </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>table_column</em>&nbsp;</td><td>Nth column, starting at 1, in the table.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>The order of operation is:<ul>
<li><a class="el" href="a00277.html#ga0">bcp_init()</a> with <em>hfile</em> == NULL and <em>direction</em> == DB_IN.</li><li><a class="el" href="a00277.html#ga16">bcp_bind()</a>, once per column you want to write to</li><li><a class="el" href="a00277.html#ga14">bcp_batch()</a>, optionally, to commit a set of rows</li><li><a class="el" href="a00277.html#ga15">bcp_done()</a> </li></ul>
</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, <a class="el" href="a00277.html#ga13">bcp_moretext()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="bcp.c::bcp_colfmt"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_colfmt           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_colnum</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_type</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_prefixlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>host_collen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>host_term</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_termlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>table_colnum</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Specify the format of a datafile prior to writing to a table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_colnum</em>&nbsp;</td><td>datafile column number (starting with 1, not zero). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_type</em>&nbsp;</td><td>dataype token describing the data type in <em>host_colnum</em>. E.g. SYBCHAR for character data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_prefixlen</em>&nbsp;</td><td>size of the prefix in the datafile column, if any. For delimited files: zero. May be 0, 1, 2, or 4 bytes. The prefix will be read as an integer (not a character string) from the data file, and will be interpreted the data size of that column, in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_collen</em>&nbsp;</td><td>maximum size of datafile column, exclusive of any prefix/terminator. Just the data, ma'am. Special values:<ul>
<li><b>0</b> indicates NULL.</li><li><b>-1</b> for fixed-length non-null datatypes</li><li><b>-1</b> for variable-length datatypes (e.g. SYBCHAR) where the length is established by a prefix/terminator. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_term</em>&nbsp;</td><td>the sequence of characters that will serve as a column terminator (delimiter) in the datafile. Often a tab character, but can be any string of any length. Zero indicates no terminator. Special characters:<ul>
<li><b>'\0'</b> terminator is an ASCII NUL.</li><li><b>'\t'</b> terminator is an ASCII TAB.</li><li><b>'\n'</b> terminator is an ASCII NL. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_termlen</em>&nbsp;</td><td>the length of <em>host_term</em>, in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>table_colnum</em>&nbsp;</td><td>Nth column, starting at 1, in the table that maps to <em>host_colnum</em>. If there is a column in the datafile that does not map to a table column, set <em>table_colnum</em> to zero.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd><a class="el" href="a00277.html#ga3">bcp_colfmt()</a> is called once for each column in the datafile, as specified with <a class="el" href="a00277.html#ga2">bcp_columns()</a>. In so doing, you describe to FreeTDS how to parse each line of your datafile, and where to send each field.</dd></dl>
When a prefix or terminator is used with variable-length data, <em>host_collen</em> may have one of three values:<ul>
<li><b>positive</b> indicating the maximum number of bytes to be used</li><li><b>0</b> indicating NULL</li><li><b>-1</b> indicating no maximum; all data, as described by the prefix/terminator will be used.</li></ul>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga4">bcp_colfmt_ps()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, <a class="el" href="a00277.html#ga0">bcp_init()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga4" doxytag="bcp.c::bcp_colfmt_ps"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_colfmt_ps           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_colnum</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_type</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_prefixlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>host_collen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>host_term</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_termlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>table_colnum</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBTYPEINFO *&nbsp;</td>
          <td class="mdname" nowrap> <em>typeinfo</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Specify the format of a host file for bulk copy purposes, with precision and scale support for numeric and decimal columns. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_colnum</em>&nbsp;</td><td>datafile column number (starting with 1, not zero). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_type</em>&nbsp;</td><td>dataype token describing the data type in <em>host_colnum</em>. E.g. SYBCHAR for character data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_prefixlen</em>&nbsp;</td><td>size of the prefix in the datafile column, if any. For delimited files: zero. May be 0, 1, 2, or 4 bytes. The prefix will be read as an integer (not a character string) from the data file, and will be interpreted the data size of that column, in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_collen</em>&nbsp;</td><td>maximum size of datafile column, exclusive of any prefix/terminator. Just the data, ma'am. Special values:<ul>
<li><b>0</b> indicates NULL.</li><li><b>-1</b> for fixed-length non-null datatypes</li><li><b>-1</b> for variable-length datatypes (e.g. SYBCHAR) where the length is established by a prefix/terminator. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_term</em>&nbsp;</td><td>the sequence of characters that will serve as a column terminator (delimiter) in the datafile. Often a tab character, but can be any string of any length. Zero indicates no terminator. Special characters:<ul>
<li><b>'\0'</b> terminator is an ASCII NUL.</li><li><b>'\t'</b> terminator is an ASCII TAB.</li><li><b>'\n'</b> terminator is an ASCII NL. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_termlen</em>&nbsp;</td><td>the length of <em>host_term</em>, in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>table_colnum</em>&nbsp;</td><td>Nth column, starting at 1, in the table that maps to <em>host_colnum</em>. If there is a column in the datafile that does not map to a table column, set <em>table_colnum</em> to zero. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>typeinfo</em>&nbsp;</td><td>something </td></tr>
  </table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>Not implemented.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, <a class="el" href="a00277.html#ga0">bcp_init()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="bcp.c::bcp_collen"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_collen           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>varlen</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>table_column</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set the length of a host variable to be written to a table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>varlen</em>&nbsp;</td><td>size of the variable, in bytes, or<ul>
<li><b>0</b> indicating NULL</li><li><b>-1</b> indicating size is determined by the prefix or terminator. (If both a prefix and a terminator are present, bcp is supposed to use the smaller of the two. This feature might or might not actually work.) </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>table_column</em>&nbsp;</td><td>the number of the column in the table (starting with 1, not zero).</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga7" doxytag="bcp.c::bcp_colptr"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_colptr           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>colptr</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>table_column</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Override <a class="el" href="a00277.html#ga16">bcp_bind()</a> by pointing to a different host variable. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>colptr</em>&nbsp;</td><td>The pointer, the address of your variable. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>table_column</em>&nbsp;</td><td>The 1-based column ordinal in the table. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Use between calls to <a class="el" href="a00277.html#ga9">bcp_sendrow()</a>. After calling <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, subsequent calls to <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> will bind to the new address. </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="bcp.c::bcp_columns"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_columns           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>host_colcount</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Indicate how many columns are to be found in the datafile. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>host_colcount</em>&nbsp;</td><td>count of columns in the datafile, irrespective of how many you intend to use. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>This function describes the file as it is, not how it will be used.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. It's hard to see how it could fail. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga3">bcp_colfmt()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="bcp.c::bcp_control"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_control           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>field</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>value</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set BCP options for uploading a datafile. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>field</em>&nbsp;</td><td>symbolic constant indicating the option to be set, one of:<ul>
<li><b>BCPMAXERRS</b> Maximum errors tolerated before quitting. The default is 10.</li><li><b>BCPFIRST</b> The first row to read in the datafile. The default is 1.</li><li><b>BCPLAST</b> The last row to read in the datafile. The default is to copy all rows. A value of -1 resets this field to its default?</li><li><b>BCPBATCH</b> The number of rows per batch. Default is 0, meaning a single batch. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>The value for <em>field</em>.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>These options control the behavior of <a class="el" href="a00277.html#ga10">bcp_exec()</a>. When writing to a table from application host memory variables, program logic controls error tolerance and batch size.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, <a class="el" href="a00277.html#ga6">bcp_options()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga15" doxytag="bcp.c::bcp_done"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DBINT bcp_done           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>dbproc</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Conclude the transfer of data from program variables. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Do not overlook this function. According to Sybase, failure to call <a class="el" href="a00277.html#ga15">bcp_done()</a> "will result in unpredictable errors". </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>As with <a class="el" href="a00277.html#ga14">bcp_batch()</a>, the count of rows saved, or -1 on error. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga13">bcp_moretext()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga10" doxytag="bcp.c::bcp_exec"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_exec           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT *&nbsp;</td>
          <td class="mdname" nowrap> <em>rows_copied</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write a datafile to a table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>rows_copied</em>&nbsp;</td><td>bcp_exec will write the count of rows successfully written to this address. If <em>rows_copied</em> is NULL, it will be ignored by db-lib.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga0">bcp_init()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga8" doxytag="bcp.c::bcp_getl"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">DBBOOL bcp_getl           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">LOGINREC *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>login</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See if <a class="el" href="a00274.html#ga4">BCP_SETL()</a> was used to set the LOGINREC for BCP work. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>login</em>&nbsp;</td><td>Address of the LOGINREC variable to be passed to dbopen().</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>TRUE or FALSE. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00274.html#ga4">BCP_SETL()</a>, <a class="el" href="a00277.html#ga0">bcp_init()</a>, <a class="el" href="a00275.html#ga1">dblogin()</a>, dbopen() </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga0" doxytag="bcp.c::bcp_init"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_init           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>tblname</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>hfile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>errfile</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>direction</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Prepare for bulk copy operation on a table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tblname</em>&nbsp;</td><td>the name of the table receiving or providing the data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>hfile</em>&nbsp;</td><td>the data file opposite the table, if any. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>errfile</em>&nbsp;</td><td>the "error file" captures messages and, if errors are encountered, copies of any rows that could not be written to the table. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>direction</em>&nbsp;</td><td>one of<ul>
<li><b>DB_IN</b> writing to the table</li><li><b>DB_OUT</b> writing to the host file</li></ul>
</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd><a class="el" href="a00277.html#ga0">bcp_init()</a> sets the host file data format and acquires the table metadata. It is called before the other bulk copy functions.</dd></dl>
When writing to a table, bcp can use as its data source a data file (<em>hfile</em>), or program data in an application's variables. In the latter case, call <a class="el" href="a00277.html#ga16">bcp_bind()</a> to associate your data with the appropriate table column. <dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00274.html#ga4">BCP_SETL()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga13" doxytag="bcp.c::bcp_moretext"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_moretext           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>DBINT&nbsp;</td>
          <td class="mdname" nowrap> <em>size</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>text</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write some text or image data to the server. Not implemented, sadly. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>How much to write, in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>Address of the data to be written. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>For a SYBTEXT or SYBIMAGE column, <a class="el" href="a00277.html#ga16">bcp_bind()</a> can be called with a NULL varaddr parameter. If it is, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a> will return control to the application after the non-text data have been sent. The application then calls <a class="el" href="a00277.html#ga13">bcp_moretext()</a> -- usually in a loop -- to send the text data in manageable chunks. </dd></dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000006">Todo:</a></b></dt><dd>implement <a class="el" href="a00277.html#ga13">bcp_moretext()</a>.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga9">bcp_sendrow()</a>, <a class="el" href="a00275.html#ga83">dbmoretext()</a>, <a class="el" href="a00275.html#ga81">dbwritetext()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga6" doxytag="bcp.c::bcp_options"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_options           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>option</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>BYTE *&nbsp;</td>
          <td class="mdname" nowrap> <em>value</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>valuelen</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set "hints" for uploading a file. A FreeTDS-only function. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>option</em>&nbsp;</td><td>symbolic constant indicating the option to be set, one of:<ul>
<li><b>BCPLABELED</b> Not implemented.</li><li><b>BCPHINTS</b> The hint to be passed when the bulk-copy begins. </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>The string constant for <em>option</em> a/k/a the hint. One of:<ul>
<li><b>ORDER</b> The data are ordered in accordance with the table's clustered index.</li><li><b>ROWS_PER_BATCH</b> The batch size</li><li><b>KILOBYTES_PER_BATCH</b> The approximate number of kilobytes to use for a batch size</li><li><b>TABLOCK</b> Lock the table</li><li><b>CHECK_CONSTRAINTS</b> Apply constraints </li></ul>
</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>valuelen</em>&nbsp;</td><td>The strlen of <em>value</em>.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, </dd></dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>Simplify. Remove <em>valuelen</em>, and dbproc-&gt;bcpinfo-&gt;hint = strdup(hints[i]) </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga11" doxytag="bcp.c::bcp_readfmt"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_readfmt           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Read a format definition file. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name that will be passed to fopen(3).</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Reads a format file and calls <a class="el" href="a00277.html#ga2">bcp_columns()</a> and <a class="el" href="a00277.html#ga3">bcp_colfmt()</a> as needed.</dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga4">bcp_colfmt_ps()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga12">bcp_writefmt()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga9" doxytag="bcp.c::bcp_sendrow"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_sendrow           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>dbproc</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write data in host variables to the table. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Call <a class="el" href="a00277.html#ga16">bcp_bind()</a> first to describe the variables to be used. Use <a class="el" href="a00277.html#ga14">bcp_batch()</a> to commit sets of rows. After sending the last row call <a class="el" href="a00277.html#ga15">bcp_done()</a>. </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga14">bcp_batch()</a>, <a class="el" href="a00277.html#ga16">bcp_bind()</a>, <a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga1">bcp_collen()</a>, <a class="el" href="a00277.html#ga7">bcp_colptr()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga5">bcp_control()</a>, <a class="el" href="a00277.html#ga15">bcp_done()</a>, <a class="el" href="a00277.html#ga10">bcp_exec()</a>, <a class="el" href="a00277.html#ga0">bcp_init()</a>, <a class="el" href="a00277.html#ga13">bcp_moretext()</a>, <a class="el" href="a00277.html#ga6">bcp_options()</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga12" doxytag="bcp.c::bcp_writefmt"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RETCODE bcp_writefmt           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">DBPROCESS *&nbsp;</td>
          <td class="mdname" nowrap> <em>dbproc</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap> <em>filename</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Write a format definition file. Not Implemented. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbproc</em>&nbsp;</td><td>contains all information needed by db-lib to manage communications with the server. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>filename</em>&nbsp;</td><td>Name that would be passed to fopen(3).</td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Reads a format file and calls <a class="el" href="a00277.html#ga2">bcp_columns()</a> and <a class="el" href="a00277.html#ga3">bcp_colfmt()</a> as needed. <em>FreeTDS</em> includes freebcp, a utility to copy data to or from a host file.</dd></dl>
<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>For completeness, <em>freebcp</em> ought to be able to create format files, but that functionality is currently lacking, as is <a class="el" href="a00277.html#ga12">bcp_writefmt()</a>.</dd></dl>
<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>See the vendors' documentation for the format of these files. </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>SUCCEED or FAIL. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00277.html#ga3">bcp_colfmt()</a>, <a class="el" href="a00277.html#ga4">bcp_colfmt_ps()</a>, <a class="el" href="a00277.html#ga2">bcp_columns()</a>, <a class="el" href="a00277.html#ga11">bcp_readfmt()</a> </dd></dl>
    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Wed May 7 19:22:10 2008 for FreeTDS API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.1 </small></address>
</body>
</html>