| Products | Download | Buy | About Us | ||||||
| |
Connect XML-2-DB User's Guide | |
5(h). Map Parameter Constant Rule - <map-param-const>
Sometimes, the constant value that has to be stored in a database column, can only be determined at run-time. In such a case, the constant value cannot be specified in the mapping file, and instead a paramater that is passed to the Connect XML-2-DB program at run-time, has to take the place of a constant value that is mapped to a database column. The <map-param-const> lets you specify which parameter is to be mapped to which database column. The format of the <map-param-const> element is as follows: <!ELEMENT map-param-const EMPTY>
<!ATTLIST map-param-const
element-name CDATA #REQUIRED
table-reference CDATA #IMPLIED
proc-reference CDATA #IMPLIED
column-name CDATA #IMPLIED
param-name CDATA #IMPLIED
input-param-posn CDATA #REQUIRED
source-datetime-format CDATA #IMPLIED>
In the map-param-const rule, both table-reference and column-name must be provided or both proc-reference and param-name must be provided. The <map-param-const> element can be used to
5(hi). Inserting a run-time input parameter into a column of a database tableIn this case, the <map-param-const> rule can be used, with the following conditions:
Examples of mapping rules that map input-parameters to database columns are provided below: <!-- "255" is stored in the REGION_ID column -->
<map-param-const
element-name="software-sale"
table-reference="SoftwareSales"
column-name="REGION_ID"
input-param-posn="1">
</map-param-const>
<!-- "Jan-10-2000" is stored in the DATE_CREATED column -->
<map-param-const
element-name="software-sale"
table-reference="SoftwareSales"
column-name="DATE_CREATED"
input-param-posn="2"
source-datetime-format="MMM-dd-yyyy">
</map-param-const>
5(hii). Passing a run-time input parameter as the parameter to a procedureIn this case, the <map-param-const> rule can be used, with the following conditions:
Examples of mapping rules that map input-parameters to parameters of procedures are provided below: <!-- Oracle example -->
<!-- "255" is passed as the value for the I_REGION_ID parameter of the procedure
AddSoftwareSale -->
<map-param-const
element-name="software-sale"
proc-reference="AddSoftwareSale"
param-name="I_REGION_ID"
input-param-posn="1">
</map-param-const>
<!-- SQL Server example -->
<!-- "Jan-10-2000" is passed as the value for the
@i_date_created parameter of the procedure AddSoftwareSale -->
<map-param-const
element-name="software-sale"
proc-reference="AddSoftwareSale"
param-name="@i_date_created"
input-param-posn="2"
source-datetime-format="MMM-dd-yyyy">
</map-param-const>
|
| Copyright © Skyhawk
Systems. All Rights Reserved. Send comments and questions to support@skyhawksystems.com. |
|