Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in August and this forum will be retired.

[SQL Anywhere]

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.

    hostvar_type, max(hostvar_value) as example_value, sysdomain.domain_name
sa_diagnostic_hostvariable inner join sysdomain
on sa_diagnostic_hostvariable.hostvar_type = sysdomain.domain_id
group by 
    hostvar_type, sysdomain.domain_name
order by 

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

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

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
accept rate: 20%

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

accept rate: 40%


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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 10 Oct '12, 06:48

question was seen: 3,266 times

last updated: 12 Oct '12, 13:06