[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?

asked 10 Oct '12, 06:48

Luke's gravatar image

Luke
711152336
accept rate: 40%


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.

permanent link

answered 12 Oct '12, 09:11

JBSchueler's gravatar image

JBSchueler
3.2k31462
accept rate: 20%

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.

permanent link

answered 11 Oct '12, 10:14

Justin%20Willey's gravatar image

Justin Willey
7.6k136179248
accept rate: 19%

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

permanent link

answered 12 Oct '12, 12:24

Luke's gravatar image

Luke
711152336
accept rate: 40%

1

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

(12 Oct '12, 13:00) JBSchueler

Understood but it will do for now

(12 Oct '12, 13:06) Luke
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×13
×11
×6

question asked: 10 Oct '12, 06:48

question was seen: 2,973 times

last updated: 12 Oct '12, 13:06