rss
SOATUBE
Oracle
Custom Search SOABYTE here

Wednesday, February 16, 2011

Working with dvm:lookupValue

















The dvm:lookupValue function returns a string by looking up the value for the target column in a domain value map, where the source column contains the given source value.
  • Use Case 1
    dvm:lookupValue(dvmMetadataURI as string, SourceColumnName as string,SourceValue as string, TargetColumnName as string, DefaultValue as string)as string
    
    
    Example:
    dvm:lookupValue('statecode.dvm','StateCodes','NL', 'StateNames','CouldNotBeFound')
    
    
    
    A domain value map containing state code to state name mapping may have multiple mappings from NL to Nagaland because Nagaland is a state in India as well as NL stands for Nuevo Leon in Mexico.
    
    
    
    
    
    
  • Use Case 2
    dvm:lookupValue(dvmMetadataURI as string, SourceColumnName as string,SourceValue as string, TargetColumnName as string, DefaultValue as string,(QualifierSourceColumn as string, QualifierSourceValue as string)*) as string
    
    
    Example:
    dvm:lookupValue ('statecode.dvm','StateCodes','NL', 'StateNames','CouldNotBeFound', 'Country', 'India')
    
    
    Setting a Source Column as Qualifier column
    
    
    Now the question is how to set a SourceColumn as Qualifier column. The answer is simple.
    
    
    All you need to do is to go to the already created DVM and slect the Source Column you want as Qualifier and click edit and select Qualifier as true. You can also select the order of Qualifier.
    <column name="domain1" qualifier="true" order="1"/>
    <column name="domain2" qualifier="true" order="2"/>
    
    
    If only one Qualifier Column is required then order is optional.
    <column name="domain1" qualifier="true"/>
    
    
    The lookup mechanism starts from the higher order qualifier and goes till lower order qualifier till exact match is found.
    
    
    
    
    
    
    
    

1 comments:

Post a Comment

 
Blogger Profile