The existing database I have to work with has all the PK and FK fields defined as numeric(19,0).
Here's a real table definition exported from our dev database using Sybase Central:
create table audit_log
(id numeric(19,0) identity not null,
version numeric(19,0) not null,
status varchar(40) null,
user_name varchar(10) null,
user_role varchar(2) null,
date_changed datetime null,
object_id varchar(255) null,
audit_type varchar(20) null,
primary key (id));
I am trying to load a record by primary key. I have verified that this PK exists in the database.
AuditLogEntity audit = new AuditLogEntity(1);
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
bool res = adapter.FetchEntity(audit);
Assert.IsTrue(res); //Always returns false
}
LLBL detects the primary key value (id) as an int (system.int32) and the version column as a numeric (system.decimal), despite them both having the same type.
I'm not sure if the two issues are related at all.
Please let me know if you require any further clarification. I am using the latest Sybase Developer Edition to test this.