It's the same issue as the thread linked: in the past the ADO.NET provider produced server errors when precision/scale was set for numeric parameters, so in RetrievalProcedures we added a method to produce parameters similar to how we do it in the runtime lib. As you can see, no precision/scale is set (as that should be retrieved from the value set, which does have a fraction). Anyway, this gives a problem in your query as well.
I'll see what we can do about it, as this same problem should be present when saving an entity with a decimal/numeric field and a scale.
(edit) Decimal and Numeric fields are saved properly with the parameters without precision/scale:
[Test]
public void DecimalFractionTest()
{
TestTabEntity t = new TestTabEntity();
t.NumericField = 13.133M;
t.DecimalField = 13.13M;
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
Assert.IsTrue(adapter.SaveEntity(t, true));
Assert.IsTrue(t.Id > 0);
TestTabEntity x = adapter.FetchNewEntity<TestTabEntity>(new RelationPredicateBucket(TestTabFields.Id == t.Id));
Assert.AreEqual(EntityState.Fetched, x.Fields.State);
Assert.AreEqual(13.133M, x.NumericField);
Assert.AreEqual(13.13M, x.DecimalField);
}
}
So it's not that parameters are the problem.
It's now a matter of whether ASE wants precision/scale to be set when it's a parameter of a proc. Will now test that too.
(edit) I can't reproduce it.
Proc:
CREATE PROCEDURE dbo.pr_GetTestTabRows
@numFieldValue Numeric(15, 3)
AS
BEGIN
SELECT TestTab.ID, TestTab.Name, TestTab.BlobField, TestTab.FloatRealField, TestTab.FloatDoubleField, TestTab.FloatField, TestTab.RealField, TestTab.MoneyField, TestTab.DateTimeField, TestTab.DecimalField, TestTab.DateField, TestTab.NCharField, TestTab.NVarCharField, TestTab.UniVarChar, TestTab.NumericField FROM TestTab WHERE NumericField = @numFieldValue
END
Test:
[Test]
public void NumericProcParameterCallTest()
{
DataTable results = RetrievalProcedures.GetTestTabRows(13.133M);
Assert.IsTrue(results.Rows.Count > 0);
}
runs fine without a problem.
However this is on sybase ASE 15. It might be this error is specific for ASE 12.
In that case, please alter the RetrievalProcedures template for ASE and add a couple of lines to the CreateAseParameter method at the bottom to set the precision/scale in the switch/case.