What are the challenges you face when working across database platforms? Take the survey
Options

Weighted List Custom Generator

CraigOttleyCraigOttley Posts: 19
Hi!

Has anyone every happened to create a Custom Generator for a weighted list?

I'm struggling to find the right properties I need to set.

So far i've got the following...
<generators>
	<generator type="RedGate.SQLDataGenerator.Generators.List.WeightedListGenerator" 
	                name="Yes|No" 
	                description="95 | 5%..." 
	                category="Weighted Lists">
		<property name="Seed">0</property>
		<property name="NullsAllowed">False</property>
		<property name="NullProportion">0.01</property>
		<property name="">ListItems</property>
		<!--<element>
								<key type="string">ListItems</key>
								<value version="1" type="WeightedListItems">
									<WeightedListOfItems type="WeightedListOfItems" version="1">
										<value version="1" type="WeightedListItem">
											<Name>Yes</Name>
											<Weight>95</Weight>
										</value>
										<value version="1" type="WeightedListItem">
											<Name>No</Name>
											<Weight>5</Weight>
										</value>
									</WeightedListOfItems>
								</value>
							</element>-->
		<matches field="*Option*" score="70"/>
		<type type="string"/>
	</generator>
</generators>

Comments

  • Options
    I have sent you a PM with some amended code.
  • Options
    Thanks Linda.

    For everyone else this code works for me :o)
    <generators>
    	<generator type="RedGate.SQLDataGenerator.Generators.List.WeightedListGenerator" 
    	                name="Yes|No" 
    	                description="95 | 5%..." 
    	                category="Weighted Lists">
    		<property name="Seed">0</property>
    		<property name="NullsAllowed">False</property>
    		<property name="NullProportion">0.01</property>
    		<property name="ListItems">
    			<WeightedListOfItems type="WeightedListOfItems" version="1">
    				<value version="1" type="WeightedListItem">
    					<Name>Yes</Name>
    					<Weight>95</Weight>
    				</value>
    				<value version="1" type="WeightedListItem">
    					<Name>No</Name>
    					<Weight>5</Weight>
    				</value>
    			</WeightedListOfItems>
    		</property>
    		<matches field="*Option*" score="70"/>
    		<type type="Object"/>
    		<type sqlType="Char"/>
    		<type sqlType="Varchar"/>
    		<type sqlType="NChar"/>
    		<type sqlType="NVarchar"/>
    		<type sqlType="NText"/>
    	</generator>
    </generators>
    
Sign In or Register to comment.