Aggregate of external tables error: can't cast System.Byte[] as System.IConvertible

I am working in OutSystems 11 on a Windows 10 machine and using an extension that connects to a sql server database.

I have created an aggregate that joins 3 tables and filters on one column. When I try to execute the aggregate in my application, I get the following error:

[2] Could not assign 'System.Byte[]' to 'myTable.ROW_VERSION'... Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.

The ROW_VERSION column type is timestamp in the database. Since OutSystems doesn't have a timestamp datatype, in the extension I am forced to cast it as another data type. I initially tried casting it as a datetime type, which produced the above error. I thought this may be the source of the error so I went back to the extension, re-cast it as several other types (integer, long integer, date, time), and re-published the extension and application module each time I changed the type. Every time I did this I still got the same error. 

Does anyone know what might be causing this error? The casting in the extension seems like a logical place to look for causing this error, but maybe it's somewhere else. Also, I don't actually ever reference this column in the query.

Solution

Hi Ryan,

According to this documentation containing all the mappings between External DB data types and OutSystems data types, the Rowversion or Timestamp datatype in SQL server has no mapping available in OutSystems. Therefore the attribute should be marked as “Ignored” in Integration Studio.

Did you experience the same while creating your extension?

Hope this information helps.

Regards,

Nordin


Solution

Hi Nordin,

Thanks for your advice. I marked your reply as a solution because, in this situation, I am not using the column, so ignoring it is acceptable. Suppose I did need to read from and/or write to this column. Is there a workaround you are aware of to read/write a ms sql timestamp column?


Nordin Ahdi wrote:

Hi Ryan,

According to this documentation containing all the mappings between External DB data types and OutSystems data types, the Rowversion or Timestamp datatype in SQL server has no mapping available in OutSystems. Therefore the attribute should be marked as “Ignored” in Integration Studio.

Did you experience the same while creating your extension?

Hope this information helps.

Regards,

Nordin




Hi Ryan,

AFAIK you cannot change the external table via an Extension. 

In the external SQL Database itself, you'd have to convert the timestamp column datatype to a datatype that can be mapped in OutSystems.

Regards,

Nordin