| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>BFILE SQL Objects and Functions</title> |
| 7 | <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> |
| 10 | <link rel="up" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> |
| 11 | <link rel="prev" href="bfile-extension.html" title="Appendix A. Using the BFILE Extension" /> |
| 12 | <link rel="next" href="bfile-c.html" title="BFILE C/C++ Objects and Functions" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">BFILE SQL Objects and Functions</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="bfile-extension.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Appendix A. Using the BFILE Extension</th> |
| 26 | <td width="20%" align="right"> <a accesskey="n" href="bfile-c.html">Next</a></td> |
| 27 | </tr> |
| 28 | </table> |
| 29 | <hr /> |
| 30 | </div> |
| 31 | <div class="sect1" lang="en" xml:lang="en"> |
| 32 | <div class="titlepage"> |
| 33 | <div> |
| 34 | <div> |
| 35 | <h2 class="title" style="clear: both"><a id="bfile-sql"></a>BFILE SQL Objects and Functions</h2> |
| 36 | </div> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="toc"> |
| 40 | <dl> |
| 41 | <dt> |
| 42 | <span class="sect2"> |
| 43 | <a href="bfile-sql.html#bfile_create_directory">BFILE_CREATE_DIRECTORY</a> |
| 44 | </span> |
| 45 | </dt> |
| 46 | <dt> |
| 47 | <span class="sect2"> |
| 48 | <a href="bfile-sql.html#bfile_replace_directory">BFILE_REPLACE_DIRECTORY</a> |
| 49 | </span> |
| 50 | </dt> |
| 51 | <dt> |
| 52 | <span class="sect2"> |
| 53 | <a href="bfile-sql.html#bfile_drop_directory">BFILE_DROP_DIRECTORY</a> |
| 54 | </span> |
| 55 | </dt> |
| 56 | <dt> |
| 57 | <span class="sect2"> |
| 58 | <a href="bfile-sql.html#bfile_name">BFILE_NAME</a> |
| 59 | </span> |
| 60 | </dt> |
| 61 | <dt> |
| 62 | <span class="sect2"> |
| 63 | <a href="bfile-sql.html#bfile_fullpath">BFILE_FULLPATH</a> |
| 64 | </span> |
| 65 | </dt> |
| 66 | <dt> |
| 67 | <span class="sect2"> |
| 68 | <a href="bfile-sql.html#bfile_open">BFILE_OPEN</a> |
| 69 | </span> |
| 70 | </dt> |
| 71 | <dt> |
| 72 | <span class="sect2"> |
| 73 | <a href="bfile-sql.html#bfile_read">BFILE_READ</a> |
| 74 | </span> |
| 75 | </dt> |
| 76 | <dt> |
| 77 | <span class="sect2"> |
| 78 | <a href="bfile-sql.html#bfile_close">BFILE_CLOSE</a> |
| 79 | </span> |
| 80 | </dt> |
| 81 | <dt> |
| 82 | <span class="sect2"> |
| 83 | <a href="bfile-sql.html#bfile_size">BFILE_SIZE</a> |
| 84 | </span> |
| 85 | </dt> |
| 86 | </dl> |
| 87 | </div> |
| 88 | <p> |
| 89 | When the BFILE extension is enabled, you can create a |
| 90 | <code class="literal">DIRECTORY</code> object. These objects are required |
| 91 | before you can store a pointer to a file in a |
| 92 | <code class="literal">BFILE</code> column. |
| 93 | </p> |
| 94 | <p> |
| 95 | <code class="literal">DIRECTORY</code> objects are stored |
| 96 | in a special table called <code class="literal">BFILE_DIRECTORY</code>. |
| 97 | This table is automatically created for you when it is needed. |
| 98 | You should <span class="emphasis"><em>not</em></span> manually create this table. |
| 99 | </p> |
| 100 | <p> |
| 101 | You manage <code class="literal">DIRECTORY</code> objects using the |
| 102 | following SQL functions: |
| 103 | </p> |
| 104 | <table class="simplelist" border="0" summary="Simple list"> |
| 105 | <tr> |
| 106 | <td> |
| 107 | <a class="xref" href="bfile-sql.html#bfile_create_directory" title="BFILE_CREATE_DIRECTORY">BFILE_CREATE_DIRECTORY</a> |
| 108 | </td> |
| 109 | </tr> |
| 110 | <tr> |
| 111 | <td> |
| 112 | <a class="xref" href="bfile-sql.html#bfile_replace_directory" title="BFILE_REPLACE_DIRECTORY">BFILE_REPLACE_DIRECTORY</a> |
| 113 | </td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td> |
| 117 | <a class="xref" href="bfile-sql.html#bfile_drop_directory" title="BFILE_DROP_DIRECTORY">BFILE_DROP_DIRECTORY</a> |
| 118 | </td> |
| 119 | </tr> |
| 120 | </table> |
| 121 | <p> |
| 122 | The following sections describe the SQL functions that you can |
| 123 | use when the BFILE extension is enabled. |
| 124 | </p> |
| 125 | <div class="sect2" lang="en" xml:lang="en"> |
| 126 | <div class="titlepage"> |
| 127 | <div> |
| 128 | <div> |
| 129 | <h3 class="title"><a id="bfile_create_directory"></a>BFILE_CREATE_DIRECTORY</h3> |
| 130 | </div> |
| 131 | </div> |
| 132 | </div> |
| 133 | <pre class="programlisting">BFILE_CREATE_DIRECTORY(directory, path)</pre> |
| 134 | <p> |
| 135 | Creates a <code class="literal">DIRECTORY</code> object as a path. |
| 136 | The specified path must not already exist, or |
| 137 | <code class="literal">Directory already exists</code> |
| 138 | is returned. |
| 139 | </p> |
| 140 | </div> |
| 141 | <div class="sect2" lang="en" xml:lang="en"> |
| 142 | <div class="titlepage"> |
| 143 | <div> |
| 144 | <div> |
| 145 | <h3 class="title"><a id="bfile_replace_directory"></a>BFILE_REPLACE_DIRECTORY</h3> |
| 146 | </div> |
| 147 | </div> |
| 148 | </div> |
| 149 | <pre class="programlisting">BFILE_REPLACE_DIRECTORY(directory, path)</pre> |
| 150 | <p> |
| 151 | Replaces the named <code class="literal">DIRECTORY</code> object using the specified path. |
| 152 | If the object does not exist, <code class="literal">Directory does not exist</code> |
| 153 | is returned. |
| 154 | </p> |
| 155 | </div> |
| 156 | <div class="sect2" lang="en" xml:lang="en"> |
| 157 | <div class="titlepage"> |
| 158 | <div> |
| 159 | <div> |
| 160 | <h3 class="title"><a id="bfile_drop_directory"></a>BFILE_DROP_DIRECTORY</h3> |
| 161 | </div> |
| 162 | </div> |
| 163 | </div> |
| 164 | <pre class="programlisting">BFILE_DROP_DIRECTORY(directory)</pre> |
| 165 | <p> |
| 166 | Drops the named <code class="literal">DIRECTORY</code> object. If |
| 167 | the object does not exist, |
| 168 | <code class="literal">Directory does not exist</code> is returned. |
| 169 | </p> |
| 170 | </div> |
| 171 | <div class="sect2" lang="en" xml:lang="en"> |
| 172 | <div class="titlepage"> |
| 173 | <div> |
| 174 | <div> |
| 175 | <h3 class="title"><a id="bfile_name"></a>BFILE_NAME</h3> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | <pre class="programlisting">BFILE_NAME(directory, filename)</pre> |
| 180 | <p> |
| 181 | Returns the BFILE locator. |
| 182 | </p> |
| 183 | </div> |
| 184 | <div class="sect2" lang="en" xml:lang="en"> |
| 185 | <div class="titlepage"> |
| 186 | <div> |
| 187 | <div> |
| 188 | <h3 class="title"><a id="bfile_fullpath"></a>BFILE_FULLPATH</h3> |
| 189 | </div> |
| 190 | </div> |
| 191 | </div> |
| 192 | <pre class="programlisting">BFILE_FULLPATH(column)</pre> |
| 193 | <p> |
| 194 | Returns the full path. |
| 195 | </p> |
| 196 | </div> |
| 197 | <div class="sect2" lang="en" xml:lang="en"> |
| 198 | <div class="titlepage"> |
| 199 | <div> |
| 200 | <div> |
| 201 | <h3 class="title"><a id="bfile_open"></a>BFILE_OPEN</h3> |
| 202 | </div> |
| 203 | </div> |
| 204 | </div> |
| 205 | <pre class="programlisting">BFILE_OPEN(column)</pre> |
| 206 | <p> |
| 207 | Extracts the directory and file names from the BFILE |
| 208 | locator, and then opens that file. On success, a BFILE |
| 209 | handle is returned. Otherwise, <code class="literal">0</code> |
| 210 | is returned. |
| 211 | </p> |
| 212 | </div> |
| 213 | <div class="sect2" lang="en" xml:lang="en"> |
| 214 | <div class="titlepage"> |
| 215 | <div> |
| 216 | <div> |
| 217 | <h3 class="title"><a id="bfile_read"></a>BFILE_READ</h3> |
| 218 | </div> |
| 219 | </div> |
| 220 | </div> |
| 221 | <pre class="programlisting">BFILE_READ(BFILE handle, amt, offset)</pre> |
| 222 | <p> |
| 223 | Reads at most <code class="literal">amt</code> data from the BFILE |
| 224 | handle, starting at <code class="literal">offset</code>. On success, |
| 225 | <code class="literal">Data</code> is returned. Otherwise, |
| 226 | <code class="literal">0</code> is returned to indicate that no more |
| 227 | valid data is available. |
| 228 | </p> |
| 229 | </div> |
| 230 | <div class="sect2" lang="en" xml:lang="en"> |
| 231 | <div class="titlepage"> |
| 232 | <div> |
| 233 | <div> |
| 234 | <h3 class="title"><a id="bfile_close"></a>BFILE_CLOSE</h3> |
| 235 | </div> |
| 236 | </div> |
| 237 | </div> |
| 238 | <pre class="programlisting">BFILE_CLOSE(BFILE handle)</pre> |
| 239 | <p> |
| 240 | Closes the BFILE handle. |
| 241 | </p> |
| 242 | </div> |
| 243 | <div class="sect2" lang="en" xml:lang="en"> |
| 244 | <div class="titlepage"> |
| 245 | <div> |
| 246 | <div> |
| 247 | <h3 class="title"><a id="bfile_size"></a>BFILE_SIZE</h3> |
| 248 | </div> |
| 249 | </div> |
| 250 | </div> |
| 251 | <pre class="programlisting">BFILE_SIZE(column)</pre> |
| 252 | <p> |
| 253 | Returns the size of the BFILE. On success, the size is |
| 254 | returned. Otherwise, -1 is returned. |
| 255 | </p> |
| 256 | </div> |
| 257 | </div> |
| 258 | <div class="navfooter"> |
| 259 | <hr /> |
| 260 | <table width="100%" summary="Navigation footer"> |
| 261 | <tr> |
| 262 | <td width="40%" align="left"><a accesskey="p" href="bfile-extension.html">Prev</a> </td> |
| 263 | <td width="20%" align="center"> |
| 264 | <a accesskey="u" href="bfile-extension.html">Up</a> |
| 265 | </td> |
| 266 | <td width="40%" align="right"> <a accesskey="n" href="bfile-c.html">Next</a></td> |
| 267 | </tr> |
| 268 | <tr> |
| 269 | <td width="40%" align="left" valign="top">Appendix A. Using the BFILE Extension </td> |
| 270 | <td width="20%" align="center"> |
| 271 | <a accesskey="h" href="index.html">Home</a> |
| 272 | </td> |
| 273 | <td width="40%" align="right" valign="top"> BFILE C/C++ Objects and Functions</td> |
| 274 | </tr> |
| 275 | </table> |
| 276 | </div> |
| 277 | </body> |
| 278 | </html> |