SQL9x defines bit string constants with a format like

  B'101010'
and
  X'ABCD'

for binary and hexadecimal representations. But at the moment we don't
explicitly handle both of these cases as bit strings; the hex version is
converted to decimal in the scanner (*really* early in the parsing
stage) and then handled as an integer.

It looks like our current bit string type support looks for a "B" or "X"
embedded in the actual input string, rather than outside the quote as in
the standard.

I'd like to have more support for the SQL9x syntax, which requires a
little more invasive modification of at least the scanner and parser. I
have a couple of questions:

1) the SQL standard says what hex values should be translated to in
binary, which implies that all values may be *output* in binary format.
Should we do this, or should we preserve the info on what units were
used for input in the internal storage? Anyone interpret the standard
differently from this??

2) we would need to be able to determine the format style when a string
is output to be able to reconstruct the SQL shorthand representation (if
preserving binary or hex is to be done). So a column or value should
have a corresponding is_hex() function call. Any other suggestions??

                    - Thomas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to