The original reason for us using overriding the CreateParameterName predates me but this after investigating I have found out that the goal was to force some parameters in an Oracle query to be Date instead of DateTime.
Our generated SQL for our Oracle DB is:
WHERE ( ("START_TIME" < : p1 AND ("START_TIME" + "DURATION" / 24) > : p3))
Parameter: p1 : Date. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 3/3/2017 8:00:00 AM.
Parameter: p3 :** DateTime**. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 2017-03-02T08:00:00.0000000.
We would like p3 to be generated with a Date type … similar to p1.
In order to do this we used our own OracleSpecificCreator that grabbed all DB.DateTime types and switched them to Date. The CreateParameterName was used because our parameters where generated with our custom PredicateExpression which resulted in its own parameter numbering. The parameters we generated in our custom classes ended up reusing the p sequence – resulting in parameters named p1, p2, etc and a naming conflict with parameters generated outside of our custom classes. This was resolved by using the CreateParameterName to prefix the parameter with a unique string.
(Sorry for the long explanation)
But … I think I can throw all these custom classes away if I can figure out a fix to the original problem – How can we force a generated parameter from a predicate to be a certain type?
Our predicate for p3 is:
filter.AddWithAnd(new EntityField2("EndTime", ShapeFields.StartTime + new Expression(ShapeFields.Duration, ExOp.Div, 24)) > hourDateTime);
I have tried adding a dataType parameter to the EntityField2 constructor … but that made no difference.
Thanks,
WadeC