Difference between revisions of "Pdm deref"
m |
m (Reverted edits by Agegeleruvy (Talk); changed back to last version by Jc.oakgov) |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
[[Category:Commands]] | [[Category:Commands]] | ||
| − | + | {{Global Header}} | |
| − | + | {{Global Announcement}} | |
== Overview == | == Overview == | ||
| − | Use this command to | + | Use this command to replace data with data found in another table. |
For example, lets say you performed the following extract: | For example, lets say you performed the following extract: | ||
'''pdm_extract -f "SELECT id,category FROM Call_Req" > output.txt.''' | '''pdm_extract -f "SELECT id,category FROM Call_Req" > output.txt.''' | ||
The resulting extract would have the category entries displayed in their persid format such as pcat:400001. If you wanted to replace the category persid with the sym, the pdm_deref can perform that function. | The resulting extract would have the category entries displayed in their persid format such as pcat:400001. If you wanted to replace the category persid with the sym, the pdm_deref can perform that function. | ||
| − | |||
== Usage == | == Usage == | ||
| Line 63: | Line 62: | ||
|- | |- | ||
|} | |} | ||
| − | |||
== Specfile Example== | == Specfile Example== | ||
| Line 81: | Line 79: | ||
rule = "SELECT sym FROM Prob_Category WHERE persid=?" | rule = "SELECT sym FROM Prob_Category WHERE persid=?" | ||
}</source> | }</source> | ||
| − | |||
== Examples == | == Examples == | ||
* Deref of a basic text file | * Deref of a basic text file | ||
pdm_deref -s specfile.txt < input.txt > output.txt | pdm_deref -s specfile.txt < input.txt > output.txt | ||
Latest revision as of 05:28, 30 November 2010
To discuss or ask questions about this article, select the discussion tab above.
Overview
Use this command to replace data with data found in another table.
For example, lets say you performed the following extract: pdm_extract -f "SELECT id,category FROM Call_Req" > output.txt. The resulting extract would have the category entries displayed in their persid format such as pcat:400001. If you wanted to replace the category persid with the sym, the pdm_deref can perform that function.
Usage
pdm_extract [-s] specfile [-c|-e|-r] [-d] [-h] [-n] [-p] [-u] [-v 1|2] <filename
| Command | Description | Remarks |
|---|---|---|
| -s specfile | file containing SQL statement | |
| -c | csv output | |
| -e | csv output with double double quotes | |
| -r | informal report output | |
| -d | diagnostics | |
| -h | Help | |
| -p | preserve whitespace | |
| -u | no headers | |
| -v [1|2] | verbose. 1 is brief and 2 prints to a log file. | |
| filename | file to be processed |
Specfile Example
A pdm_extract in the following format: <source lang=text>TABLE Call_Req id category { "499998" ,"pcat:400001" } { "499999" ,"pcat:400001" }</source>...will be change to this format: <source lang=text>TABLE Call_Req id category.sym { "499998" ,"Sofware.Adobe Reader" }
{ "499999" ,"Softtware.Adobe Writer" }</source>...by running a specfile containing the following SQL Statement:
<source lang=sql>Deref { input = category output = category.sym rule = "SELECT sym FROM Prob_Category WHERE persid=?" }</source>
Examples
- Deref of a basic text file
pdm_deref -s specfile.txt < input.txt > output.txt