New token description (0x88 Compute Format description)

Scott C. Gray gray at voicenet.com
Thu Aug 10 11:29:34 EDT 2000



I lost the owner and URL of the person keeping track of the
latest TDS specifications, but I have one to add that I have
been hacking on.

This is the TDS 7.0 compute format (136/0x81) description column:

+------+-------+---+----+
| 136  | #cols | compid | ...
+------+-------+---+----+

|-------------------------- Repeat for each column ----------------------------|+----+----+  +----+----+  +--------+---+---+----+-----+--+--+------+-----+----+
| #bycols |..|  bycol# |..| optype | opcol | usertype | ??? | type | len | ?? |
+----+----+  +----+----+  +--------+---+---+----+-----+--+--+------+-----+----+

    #cols:    Number of columns in compute result
    compid:   id number of compute clause. Each compute clause in your
              select statement has an increasing id number.
    #bycols:  Number of columns in the BY clause
    bycol#:   Column # of column in BY clause. This is repeated #bycols
              times in data stream
    optype:   75 = COUNT(*)
              77 = SUM(...)
              79 = AVG(...)
              81 = MIN(...)
              82 = MAX(...)
    opcol:    column being computed
    usertype: user type number
    unknown:  2 unknown bytes [ 0x01 0x00 ]
    type:     TDS datatype
    len:      maxlength of datatype. The size of this fields varies
              upon the datatype between 0 and 4 bytes.
    unknown:  always seems to be one byte [ 0x00 ]

I think I also figured out some additional fields of the TDS 5.0
compute format token as well, I'll pass those on later.

-scott

--
Scott C. Gray <gray at voicenet.com>     "my keybard is brken"
       http://www.voicenet.com/~gray/sqsh.html




More information about the FreeTDS mailing list