Database Reference
In-Depth Information
comments (#), but the one by the Free Software Foundation does). Here's the output of a bc
session, which accomplished the conversion:
$ bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
obase=16 # ask for hexadecimal output, i.e. output base 16
1415053318 # convert name and mode to hexadecimal
54580006
# lock mode is 6 (exclusive) and enqueue name is hex 5458, let's
# convert that to decimal
obase=10 # ask for output in decimal, i.e. base 10
ibase=16 # input will be hexadecimal
54 # hex
84
# is 84 decimal
58 # hex
88
# is 88 decimal
Now we can use the function CHR in SQL*Plus to convert from decimal to ASCII.
SQL> SELECT chr(84)||chr(88) AS name FROM dual;
NAME
----
TX
Alternatively, a SELECT statement, that incorporates the function BITAND , may be used to
extract the information from the decimal name and mode.
SQL> VARIABLE p1 NUMBER
SQL> EXEC :p1:=1415053318
SQL> SELECT chr(to_char(bitand(:p1,-16777216))/16777215)||
chr(to_char(bitand(:p1, 16711680))/65535) "Name",
to_char( bitand(:p1, 65535) ) "Mode"
FROM dual;
Name Mode
---- ----
TX 6
Let's go back to session 1 and hit the return key, such that it can continue.
23:41:04 SQL> SELECT tab.msgid
FROM "NDEBES"."POST_OFFICE_QUEUE_TABLE" tab
WHERE q_name=:q_name and (state=:state)
FOR UPDATE;
Hit return to continue
34F01D98AF0444FF91B10C6D00CB5826
Hit return to continue
Search WWH ::




Custom Search