cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get a description of sa_diagnostic_hostvariable.hostvar_type?

Former Member
3,520

[SQL Anywhere 12.0.1.3769]

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?

Accepted Solutions (1)

Accepted Solutions (1)

jack_schueler
Product and Topic Expert
Product and Topic Expert

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.

Answers (2)

Answers (2)

justin_willey
Participant

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.

Former Member
0 Kudos

Thank-you for the replies. Looks like I'll just have to hardcode some descriptions for known values for now.

jack_schueler
Product and Topic Expert
Product and Topic Expert

and be prepared for them to change from one release to the next or even one build to the next.

Former Member
0 Kudos

Understood but it will do for now