forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
191 lines
24 KiB
HTML
191 lines
24 KiB
HTML
<a name="EN-US_TOPIC_0000001772536472"></a><a name="EN-US_TOPIC_0000001772536472"></a>
|
|
|
|
<h1 class="topictitle1">BTEQ Utility Command</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p164443717352">GaussDB(DWS) provides gsql meta-commands that can be used to replace common BTEQ tool commands. The mostly used replacements are as follows:</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section57838262517"><h4 class="sectiontitle">.QUIT | .EXIT | .RETURN</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p016381116423">The meta-command <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b545116319427">\q [</strong><em id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_i1297411594419">value</em><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b15451113154214">]</strong> can be used to exit the gsql program, and <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b7346103934215">value</strong> specifies the exit code. The .QUIT, .EXIT, and .RETURN commands can replace each other with the <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b11602185315441">\q</strong> command.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table1579232718401" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row16792112717409"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.3.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p18792152716401"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b3808164143312">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.3.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1879202710409"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b48833669731949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row177921727164011"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1361194791018">.QUIT 0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1879262754015">\q 0</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row279252754012"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p6792142714406">.EXIT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p127924272406">\q</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row07921527164011"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p679262794012">.RETURN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p19792172774011">\q</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section12154105915298"><h4 class="sectiontitle">.LABEL and .GOTO</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p46501248113620">The Teradata command .LABEL is used to create tags and is usually used together with .GOTO. .GOTO skips all intermediate BTEQ commands and SQL statements, instructs you to reach the specified label position, and performs corresponding restoration processing.</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p5892087162">gsql meta-command <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1477671815104">\goto LABEL...</strong> and <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b134811438141015">\label LABEL</strong> can be replaced with each other with no constraints.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table595124913416" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row199511849124111"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.4.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p69511249114110"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1589410321913">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.4.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p19511049144116"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b132669177031949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row1895110499410"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.4.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p45351155173920">.IF CHECK_PK='' THEN .GOTO NOCHECK</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p75357553399">${CHECK_PK};</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p6535955103916">.LABEL NOCHECK</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p25355553393">.QUIT 0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.4.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p981823964019">\if ${CHECK_PK} == ''</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1281883954016">\goto NOCHECK</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1681883912407">\endif</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p10818539104017">${CHECK_PK}</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p168181439204011">\label NOCHECK</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p48182393404">\q 0</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section62913118302"><h4 class="sectiontitle">.RUN FILE</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p131047484119">Executing the SQL request of a specified file can be implemented by the gsql meta-command <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1463782015113">\i</strong>.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table13511145213455" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row7511135264520"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p851110527456"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b16257184391111">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p35111252104520"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b16647408431949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row55111526450"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p55111752154518">.RUN FILE=sampfile</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p751105274512">\i 'sampfile'</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section1198119153015"><h4 class="sectiontitle">.EXPORT FILE</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p588681824715">Exporting the SQL statement execution result to a specified file can be implemented by the gsql meta-command <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1331379101217">\o</strong>.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table1682761411471" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row48287147472"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1582812141472"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1374591331214">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1182810148475"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b140468203531949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row1282871434716"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p9828191484715">.EXPORT REPORT FILE=resultfile</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p582817142479">\o 'resultfile'</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section1371511217304"><h4 class="sectiontitle">..SET ..END</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p20868105373219">To set a variable to specified value, both a single-line command or a multi-line command ended with ..END can be used. You can run the SELECT command to query a specified variable name or run the <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b1065683142216">\set</strong> command to convert the variable name.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table5369547439" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row23691847438"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p736954716314"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b4318954171215">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.6.3.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p936913472317"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b133540618531949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row123698471531"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p8641101114412">.SET SEPARATOR ' | '</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p14369647536">\set SEPARATOR '|'</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row1636912471839"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p143691147133">..SET NAME</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p0854151317516">'Jack'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p3275421451">..END</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.6.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p183695475312">SELECT 'Jack' AS "NAME";</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section1464832213518"><h4 class="sectiontitle">.IF</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p5917104517715">.IF is one of the important process control commands used to execute parts of an input script. It can be a single-branch command, which is used in pairs with the THEN clause. It can also be a multi-branch command. The multi-branch IF structure allows multiple nested layers, but each layer must start with the IF command and end with the ENDIF command.</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1880192911010">The flow control meta-commands <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b198641829192710">\if...</strong> \else ... <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b036813341278">\endif</strong> can be used to replace this BTEQ command.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table3542229101110" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row35432029121116"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.4.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p55431290115"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b128671315102913">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.7.4.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p205433296117"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b86193570631949">Output</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row14543162913110"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p754342913118">.IF ERRORCODE <> 0 THEN .QUIT 12;</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.7.4.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p142228133133">\if ${ERROR} != 'false'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p3222151351319">\q 12</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p122226138136">\endif</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_section42025374315"><h4 class="sectiontitle">..FOR</h4><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p192871744944">In the loop control command, when the loop condition is met, the script of the loop body can be executed continuously until .QUIT exits the loop. GaussDB(DWS) provides<strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b129349519577"> \for...</strong> \loop ... \exit-for ... <strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b13189121445715">\end-for</strong> structure command implements the loop logic.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_table184882317507" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row1349122312506"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.1.3.1.1"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p194913234503"><strong id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_b9594103034912">Input</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.8.3.1.3.1.2"><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1249152375018">Output</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_row1249162311508"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.1.3.1.1 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p109623319505">..IF ACTIVITYCOUNT > 0 THEN</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p4971633155014">..FOR</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p8708353833">SEL SqlStr AS V_SqlStr</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p870815531733">FROM ${ ETL_DATA}.TB_DWDATA_UPDATE</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p197089537315">WHERE JobName = '${JOB_NAME}'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p77081053839">AND TXDATE = ${ TX_DATE} - 19000000</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1070814531137">ORDER BY ExcuteSeq ASC;</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1997143375015">..DO</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p29718339503">${V_SqlStr}</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1097133145011">.IF ERRORCODE<>0 THEN .QUIT 12</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1297163345012">..END-FOR</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p129743316502">..END-IF</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.8.3.1.3.1.2 "><p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1499311145314">\if ${ERROR} != 'false'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p999320142319">\q 12</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1899312144317">\endif</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1199314141733">\if ${ACTIVITYCOUNT} != 0</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p19993151418314">\for</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p7993814939">SELECT</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p5993111414318">SqlStr AS V_SqlStr</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p139933142315">FROM</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p59931144319">${ETL_DATA}.TB_DWDATA_UPDATE</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1499315143315">WHERE</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p1599341418319">JobName = '${JOB_NAME}'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p099316141234">AND TXDATE = to_date( ${TX_DATE} ,'yyyymmdd' )</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p299312142319">ORDER BY</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p99931714238">ExcuteSeq ASC</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p119931014136">\loop</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p11993114734">${V_SqlStr} ;</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p19993171416316">\if ${ERROR} != 'false'</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p499313141934">\q 12</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p19993914839">\endif</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p9993111411316">\end-for</p>
|
|
<p id="EN-US_TOPIC_0000001772536472__en-us_topic_0000001658024930_en-us_topic_0000001449515369_p39938141438">\endif</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0036.html">Teradata Syntax Migration</a></div>
|
|
</div>
|
|
</div>
|
|
|