on 2012 Oct 10 7:48 AM
[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?
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank-you for the replies. Looks like I'll just have to hardcode some descriptions for known values for now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and be prepared for them to change from one release to the next or even one build to the next.
User | Count |
---|---|
75 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.