<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/File+Translator">File Translator</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        cleanup color tags<br />
    </div>
        <br/>
                         <h4>Changes (16)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1. {color:#000000}{*}File Translator{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1. *File Translator* <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> file translator, known by the type <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">name&amp;nbsp;{color}{color:#333333}{_}file{_}{color}{color:#333333},</span> <span class="diff-added-words"style="background-color: #dfd;">name&amp;nbsp;_file_,</span> exposes stored procedures to leverage file system resources exposed by the file resource adapter. It will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formatted <span class="diff-changed-words">data.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}{*}Execution Properties{*}{color} <br>|| {color:#000000}Name{color} || {color:#000000}Description{color} || {color:#000000}Default{color} || <br>| {color:#333333}Encoding{color} | {color:#333333}The encoding that should be used for CLOBs returned by the getTextFiles procedure{color} | {color:#333333}The system default encoding{color} | <br>| {color:#333333}ExceptionIfFileNotFound{color} | {color:#333333}Throw an exception in getFiles or getTextFiles if the specified file/directory does not exist.{color} | {color:#333333}true (false prior to 8.2){color} | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">*Execution Properties* <br>|| Name || Description || Default || <br>| Encoding | The encoding that should be used for CLOBs returned by the getTextFiles procedure | The system default encoding | <br>| ExceptionIfFileNotFound | Throw an exception in getFiles or getTextFiles if the specified file/directory does not exist. | true (false prior to 8.2) | <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >h3. <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#000000}{*}Usage{*}{color}</span> <span class="diff-added-words"style="background-color: #dfd;">*Usage*</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Retrieve</span> all files as BLOBs with an optional extension at the given <span class="diff-changed-words">path.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code:SQL}call getFiles(&#39;path/*.ext&#39;){code} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>If</span> the extension path is specified, then it will filter all of the file in the directory referenced by the base path. If the extension pattern is not specified and the path is a directory, then all files in the directory will be returned. Otherwise the single file referenced will be returned. If the path doesn&#39;t exist, then no results will be returned if ExceptionIfFileNotFound is false, otherwise an exception will be <span class="diff-changed-words">raised.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Retrieve</span> all files as CLOB(s) with the an optional extension at the given <span class="diff-changed-words">path.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code:SQL}call getTextFiles(&#39;path/*.ext&#39;){code} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>All</span> the same files a getFiles will be retrieved, the only difference is that the results will be CLOB values using the encoding execution property as the character <span class="diff-changed-words">set.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Save</span> the CLOB, BLOB, or XML value to given <span class="diff-changed-words">path<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code:SQL}call saveFile(&#39;path&#39;, value){code} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> path should reference a new file location or an existing file to overwrite <span class="diff-changed-words">completely.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{info:title=Native queries} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Native</span> or direct query execution is not supported on the File <span class="diff-changed-words">Translator.{<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">color}{</span>info}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. {color:#000000}{*}JCA Resource Adapter{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. *JCA Resource Adapter* <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> resource adapter for this translator provided through &quot;File Data Source&quot;, Refer to Admin Guide for configuration <span class="diff-changed-words">information.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="FileTranslator-FileTranslator"></a><b>File Translator</b></h1>

<p>The file translator, known by the type name&nbsp;<em>file</em>, exposes stored procedures to leverage file system resources exposed by the file resource adapter. It will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formatted data.</p>

<p><b>Execution Properties</b></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Default </th>
</tr>
<tr>
<td class='confluenceTd'> Encoding </td>
<td class='confluenceTd'> The encoding that should be used for CLOBs returned by the getTextFiles procedure </td>
<td class='confluenceTd'> The system default encoding </td>
</tr>
<tr>
<td class='confluenceTd'> ExceptionIfFileNotFound </td>
<td class='confluenceTd'> Throw an exception in getFiles or getTextFiles if the specified file/directory does not exist. </td>
<td class='confluenceTd'> true (false prior to 8.2) </td>
</tr>
</tbody></table>
</div>


<h3><a name="FileTranslator-Usage"></a><b>Usage</b></h3>

<p>Retrieve all files as BLOBs with an optional extension at the given path.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">call getFiles('path/*.ext')</pre>
</div></div>
<p>If the extension path is specified, then it will filter all of the file in the directory referenced by the base path. If the extension pattern is not specified and the path is a directory, then all files in the directory will be returned. Otherwise the single file referenced will be returned. If the path doesn't exist, then no results will be returned if ExceptionIfFileNotFound is false, otherwise an exception will be raised.</p>

<p>Retrieve all files as CLOB(s) with the an optional extension at the given path.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">call getTextFiles('path/*.ext')</pre>
</div></div>
<p>All the same files a getFiles will be retrieved, the only difference is that the results will be CLOB values using the encoding execution property as the character set.</p>

<p>Save the CLOB, BLOB, or XML value to given path</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">call saveFile('path', value)</pre>
</div></div>
<p>The path should reference a new file location or an existing file to overwrite completely.</p>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Native queries</b><br />Native or direct query execution is not supported on the File Translator.</td></tr></table></div>

<h3><a name="FileTranslator-JCAResourceAdapter"></a><b>JCA Resource Adapter</b></h3>

<p>The resource adapter for this translator provided through "File Data Source", Refer to Admin Guide for configuration information.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/File+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55477032&revisedVersion=2&originalVersion=1">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/File+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>