<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Retrieving Field Data by Index</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Database Independent Abstraction Layer for C" HREF="index.html"><LINK REL="UP" TITLE="libdbi API Reference" HREF="reference.html"><LINK REL="PREVIOUS" TITLE="Retrieving Field Data by Name" HREF="reference-field.html"><LINK REL="NEXT" TITLE="GNU Free Documentation License" HREF="copying-fdl.html"></HEAD ><BODY CLASS="SECTION" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Database Independent Abstraction Layer for C: libdbi Programmer's Guide</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="reference-field.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 4. libdbi API Reference</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="copying-fdl.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECTION" ><H1 CLASS="SECTION" ><A NAME="REFERENCE-FIELD-IDX" >4.9. Retrieving Field Data by Index</A ></H1 ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-CHAR-IDX" >4.9.1. dbi_result_get_char_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3162" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >signed char <B CLASS="FSFUNC" >dbi_result_get_char_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a character (a 1-byte signed integer). This is the default for the "char" type on the x86 platform, as well as on Mac OS X.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-UCHAR-IDX" >4.9.2. dbi_result_get_uchar_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3186" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned char <B CLASS="FSFUNC" >dbi_result_get_uchar_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains an unsigned character (1-byte unsigned integer). This is the default for the "char" type on Linux for PowerPC.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-SHORT-IDX" >4.9.3. dbi_result_get_short_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3210" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >short <B CLASS="FSFUNC" >dbi_result_get_short_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a short integer (2-byte signed integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-USHORT-IDX" >4.9.4. dbi_result_get_ushort_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3234" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned short <B CLASS="FSFUNC" >dbi_result_get_ushort_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains an unsigned short integer (2-byte unsigned integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-INT-IDX" >4.9.5. dbi_result_get_int_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3258" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >int <B CLASS="FSFUNC" >dbi_result_get_int_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains an integer (4-byte signed integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-UINT-IDX" >4.9.6. dbi_result_get_uint_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3282" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned int <B CLASS="FSFUNC" >dbi_result_get_uint_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains an unsigned integer (4-byte signed integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-LONG-IDX" >4.9.7. dbi_result_get_long_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3306" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >int <B CLASS="FSFUNC" >dbi_result_get_long_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Same as <A HREF="reference-field-idx.html#DBI-RESULT-GET-INT-IDX" >dbi_result_get_int_idx</A >. This function is deprecated as the name implies the wrong return type on 64bit platforms.</P ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-ULONG-IDX" >4.9.8. dbi_result_get_ulong_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3318" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned int <B CLASS="FSFUNC" >dbi_result_get_ulong_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Same as <A HREF="reference-field-idx.html#DBI-RESULT-GET-UINT-IDX" >dbi_result_get_uint_idx</A >. This function is deprecated as the name implies the wrong return type on 64bit platforms.</P ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-LONGLONG-IDX" >4.9.9. dbi_result_get_longlong_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3330" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >long long <B CLASS="FSFUNC" >dbi_result_get_longlong_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a long long integer (8-byte signed integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-ULONGLONG-IDX" >4.9.10. dbi_result_get_ulonglong_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3354" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned long long <B CLASS="FSFUNC" >dbi_result_get_ulonglong_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains an unsigned long long integer (8-byte unsigned integer).</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-FLOAT-IDX" >4.9.11. dbi_result_get_float_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3378" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >float <B CLASS="FSFUNC" >dbi_result_get_float_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a floating-point number.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-DOUBLE-IDX" >4.9.12. dbi_result_get_double_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3402" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >double <B CLASS="FSFUNC" >dbi_result_get_double_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a double-precision fractional number.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field, or 0 (zero) if an error occurs. In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE or DBI_ERROR_BADIDX.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-STRING-IDX" >4.9.13. dbi_result_get_string_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3426" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >const char *<B CLASS="FSFUNC" >dbi_result_get_string_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a zero-terminated string.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field. If the field contains a NULL value, the function returns a NULL pointer. The string may not be modified, and may not necessairly persist between row fetches. In case of an error, this function returns the string "ERROR". In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, or DBI_ERROR_BADNAME.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-STRING-COPY-IDX" >4.9.14. dbi_result_get_string_copy_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3450" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >char *<B CLASS="FSFUNC" >dbi_result_get_string_copy_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains a zero-terminated string, and return it in an allocated buffer.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field. If the field contains a NULL value, the function returns a NULL pointer, and no memory is allocated. The newly allocated string may be modified by the host program, but the program is responsible for freeing the string. In case of an error, this function returns an allocated string reading "ERROR". In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, or DBI_ERROR_BADNAME.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-BINARY-IDX" >4.9.15. dbi_result_get_binary_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3474" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >const unsigned char *<B CLASS="FSFUNC" >dbi_result_get_binary_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains binary data. The data may not be modified, and may not necessarily persist between row fetches. If the field contains a NULL value, the function returns a NULL pointer. In case of an error, this function returns the string "ERROR".</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field. The binary data may contain zero bytes and non-printable characters. Use <A HREF="reference-field-meta.html#DBI-RESULT-GET-FIELD-LENGTH" >dbi_result_get_field_length</A > or <A HREF="reference-field-meta.html#DBI-RESULT-GET-FIELD-LENGTH-IDX" >dbi_result_get_field_length_idx</A > to determine the number of bytes contained in the resulting binary string. The data may not be modified, and may not necessarily persist between row fetches. If the field contains a NULL value, the function returns a NULL pointer. In case of an error, this function returns the string "ERROR". In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, or DBI_ERROR_BADNAME.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-BINARY-COPY-IDX" >4.9.16. dbi_result_get_binary_copy_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3500" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >unsigned char *<B CLASS="FSFUNC" >dbi_result_get_binary_copy_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the speficied field, which contains binary data, and return it in an allocated buffer. The newly allocated memory may be modified by the host program, but the program is responsible for freeing the data. If the field contains a NULL value, the function returns a NULL pointer. In case of an error, this function returns the string "ERROR".</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field. The newly allocated memory may be modified by the host program, but the program is responsible for freeing the data. If the field contains a NULL value, the function returns a NULL pointer. In case of an error, this function returns the string "ERROR". In the latter case the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, or DBI_ERROR_BADNAME.</P ></DD ></DL ></DIV ></DIV ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="DBI-RESULT-GET-DATETIME-IDX" >4.9.17. dbi_result_get_datetime_idx</A ></H2 ><DIV CLASS="FUNCSYNOPSIS" ><P ></P ><A NAME="AEN3524" ></A ><P ><CODE ><CODE CLASS="FUNCDEF" >time_t <B CLASS="FSFUNC" >dbi_result_get_datetime_idx</B ></CODE >(dbi_result <VAR CLASS="PDPARAM" >Result</VAR >, unsigned int <VAR CLASS="PDPARAM" >fieldidx</VAR >);</CODE ></P ><P ></P ></DIV ><P >Fetch the data stored in the specified field, which contains a DATE and/or TIME value.</P ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT >Arguments</DT ><DD ><P ><TT CLASS="LITERAL" >Result</TT >: The target query result.</P ><P ><TT CLASS="LITERAL" >fieldidx</TT >: The index of the target field (starting at 1).</P ></DD ><DT >Returns</DT ><DD ><P >The data stored in the specified field as a time_t value. To convert this into human-readable dates or times, use the C library functions gmtime (3) and localtime (3). In case of an error this function returns 0 (zero) which resolves to the Unix epoch when converted. In case of an error the <A HREF="errornumbers.html" >error number</A > is DBI_ERROR_BADTYPE, DBI_ERROR_BADIDX, or DBI_ERROR_BADNAME.</P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="reference-field.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="copying-fdl.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Retrieving Field Data by Name</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="reference.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >GNU Free Documentation License</TD ></TR ></TABLE ></DIV ></BODY ></HTML >