[SQL Anywhere 18.104.22.16869]
I'm writing a query against the diagnostic tracing tables and I want to include a description of the datatypes used by the host variables involved.
The help file describes sa_diagnostic_hostvariable.hostvar_type as The domain number of the host variable, typically a string, integer, or a float. I thought that joining to SYSDOMAIN on domain_id might do it but when I tried this it was obviously wrong e.g.
select hostvar_type, max(hostvar_value) as example_value, sysdomain.domain_name from sa_diagnostic_hostvariable inner join sysdomain on sa_diagnostic_hostvariable.hostvar_type = sysdomain.domain_id group by hostvar_type, sysdomain.domain_name order by hostvar_type
Gave the following results:
3 0 numeric 5 90 double 6 884 date 12 7 long binary 19 'this is a string' tinyint 21 0x1f8b08000 unsigned int 27 2012-10-31 00:00:00.000000 decimal
I also tried using SYSDOMAIN.type_id rather than domain_id but that was even worse, with the join failing for most of the rows.
Is there any way to get a suitable description or should I just resort to hardcoding a set of descriptions for the values I find in sa_diagnostic_hostvariable.hostvar_type?
asked 10 Oct '12, 06:48
These columns should have been described in the documentation as "internal use only". The values that you see in these columns are subject to change and are not related to the domain ID that you find in the SYSDOMAIN system view.
answered 12 Oct '12, 09:11
The documentation certainly implies the relationship you are looking for. Interestingly the documentation for sa_diagnostic_internatvariable has a variabledomain column of data type UNSIGNED SMALLINT (rather than TINYINT as in hostvariables) that it describes as "The data type of the internal variable".
It's probably worth putting your question into the page on dcx asking for the docs team to clarify what is meant.
answered 11 Oct '12, 10:14
Thank-you for the replies. Looks like I'll just have to hardcode some descriptions for known values for now.
answered 12 Oct '12, 12:24