initial quantum version
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / doc / Custom Copy.html
1  
2 <p>Author: jparrai<br>
3   Date: 26-08-2003<br>
4   Subject: Using the Custom Copy facility<br>
5 </p>
6 <p> The "Custom Copy" feature is meant to allow the user to customize the copy 
7   format of tables and columns.</p>
8 <p><b>How to use </b>: You are in the Bookmarks View, or the Subset View. You 
9   select the tables, views and columns that you want to copy. Be sure that only 
10   tables, views and columns are selected. Then you select "Custom Copy" in the 
11   context menu. By default, a blank sub-menu will appear. You have to customize 
12   it to do something. </p>
13 <p><b>How to customize</b> : You go to the <b>Window->Preferences</b> , then <b>QuantumDB->Copy-&gt;Custom 
14   Copy 1</b>. You can have up to three different templates, that will appear in 
15   the sub-menu with the names you give to them. So you start the Custom Copy 1 
16   preferences page. </p>
17 <p>There you have some boxes to fill up. The idea is that you will have a list 
18   of tables (from now on, tables will mean "tables and views"). This list of tables 
19   is composed of the directly selected tables plus the implicitely selected (because 
20   a column of it is selected). You choose a general template format, and the formats 
21   of the lists and items. The possible variables you have to play are: </p>
22 <blockquote> 
23   <p><b>${schema}</b> The schema of the table or column. Valid in all format specifiers 
24     except Template. </p>
25   <p><b>${table}</b> The table name, without schema. Valid in all format specifiers 
26     except Template. </p>
27   <p><b>${qualified}</b> Same as ${schema}.${table} Valid in all format specifiers 
28     except Template. </p>
29   <p><b>${column}</b> The column name. Only valid for Column specifiers. </p>
30   <p><b>${column_list}</b> The list of all columns. Only valid for Table specifiers. 
31   </p>
32   <p><b>${table_list}</b> The list of all tables. Only valid in Template. This 
33     is the only variable that can be used in Template. </p>
34   <p><b>\n</b> Inserts a new line </p>
35   <p><b>\t</b> Inserts a tab character</p>
36 </blockquote>
37 <p>It's faster to explain by example. Suppose I select the columns ENAME and JOB 
38   from the table BONUS in schema SCOTT, and also the entire table DEPT from same 
39   schema. </p>
40 <blockquote> 
41   <p>&nbsp;</p>
42   <table width="75%" border="1">
43     <tr> 
44       <td>BONUS<i> (implicit)</i></td>
45       <td>ENAME<i> (selected)</i></td>
46     </tr>
47     <tr> 
48       <td>&nbsp;</td>
49       <td>JOB<i> (selected)</i></td>
50     </tr>
51     <tr> 
52       <td>DEPT <i>(selected)</i></td>
53       <td>DEPTO <i>(implicit)</i></td>
54     </tr>
55     <tr> 
56       <td>&nbsp;</td>
57       <td>DNAME <i>(implicit)</i></td>
58     </tr>
59     <tr> 
60       <td>&nbsp;</td>
61       <td>LOC<i> (implicit)</i></td>
62     </tr>
63   </table>
64 </blockquote>
65 <p>Now I have the specifiers : </p>
66 <ul>
67   <li><b>Name</b>: AnyName </li>
68   <li><b>Table Item</b>: Call_Func(${column_list}) </li>
69   <li><b>Table Separator</b>: \n </li>
70   <li><b>Column Item</b>:${column} </li>
71   <li><b>Column Separator</b>: , </li>
72   <li><b>Template</b>: //Generated code\n${table_list}\n//End of generated code 
73   </li>
74 </ul>
75 <p>The result will be: </p>
76 <blockquote> 
77   <blockquote> 
78     <p><i>// Generated code</i></p>
79     <p><i> Call_Func(ENAME, JOB)</i></p>
80     <p><i> Call_Func(DEPTNO, DNAME, LOC)</i></p>
81     <p><i> //End of generated code</i></p>
82   </blockquote>
83 </blockquote>
84 <p> If I want only a list of columns, I can set: </p>
85 <ul>
86   <li><b>Name</b>: AnyName </li>
87   <li><b>Table Item:</b> ${column_list} </li>
88   <li><b>Table Separator</b>:, </li>
89   <li><b>Column Item</b>:${qualified}.${column} </li>
90   <li><b>Column Separator</b>: , </li>
91   <li><b>Template</b>: (${table_list}) </li>
92 </ul>
93 <p>The result will be: </p>
94 <blockquote>
95   <blockquote> 
96     <p><i>(SCOTT.BONUS.ENAME, SCOTT.BONUS.JOB, SCOTT.DEPT.DEPTNO, SCOTT.DEPT.DNAME, 
97       SCOTT.DEPT.LOC) </i></p>
98   </blockquote>
99 </blockquote>