Whenconverting a typed value to a string as the result of the getAsString operation on a
NameValueRecordor a QueryResultSet operation
Whenparsing a literal value as described in “Literals for 5800 System Data Types” on
page119 to create a typed query value from a string representation of that value.

TheCanonical String Decode Operation

Theinverse of the canonical string encoding is used in the following places:
Itis always allowed to store a string value into any metadata eld, no matter what the type
ofthe eld is. The actual data stored is the result of applying the canonical string decode
operationto the incoming string value.
Ona virtual view lookup operation, the canonical string decode operation is used on the
suppliedlename to derive the actual metadata values to look up, given their string
representationsin the lename.
Thedecode operation is allowed to accept incoming string values that would never be a
legaloutput for an encode operation. Some examples of this include:
decodeBinaryof an odd number of hex digits. The convention is to left-justify the
supplieddigits in the binary value. For example, the string "b0a"corresponds to the
binaryliteral [b0a0].
decodeDateof a non-standard date format.
–Adoublevalue encoded with a non-canonical number of digits. For example,
.00145E20instead of 1.45E17.
EXAMPLE4–1 VirtualView Lookup Operation
Ifyou take a value Vand encode it into a string S, and then perform the canonical decode
operationon Sto get a new value V. Does Valways equal V? The answer is yes in most cases, but
notalways.
Whatis actually guaranteed is the weaker statement that if encode(V) = S and if decode(S)=V,
thenencode(V)is also equal to S.
JDBC and HADB Dateand Time Operations
Usethe 5800 system literal format for all the Date and Time operations, for example, {date
’12-31-2007’}.
TheJDBC standard escape sequences for date ({d YYYY-mm-dd}) and time ({t
hh:mm:ss})literals are available. However, usage of JDBC format date and time literals
mayproduce inconsistent results. In particular, when JDBC format is used, the literal
formatis interpreted as being relative to the local time zone, and the time zone usually
diersbetween a 5800 system cluster and client machine.
JDBCand HADB Dateand Time Operations
SunStorageTek5800 System Client API Reference Manual • June 2008120