Hi all,
I have no idea how to go about this and any direction would be a great help.
I need to query a 4 byte raw data field in a table and convert the bits to string values. The db layout manual has a mapping for this field:
From the DB Manual:
field_name = day_of_week (RAW 4-bytes)
This field contains a bit mask where each bit
reflects what days of a week a calendar based
schedule will execute. The following is a list
of the bit patterns within this bit mask:
0 = Every Sunday
1 = Every Monday
2 = Every Tuesday
3 = Every Wednesday
4 = Every Thursday
5 = Every Friday
6 = Every Saturday
How would I query the schedule table for this field and map to the appropriate string(s). I would have to account for all bits set or only a few or 0 or 1 and output a string that would make sense like 'S-M-T-W-Th-F-Sa' or 'M-W-F' or 'T-Th'. I just have no idea how to code something like that up in sql.
Sample data in the day_of_week field for the schedule table is:
record1 = '00004001'
record2 = '00080020'
record3 = '04081020'
record4 = '0FFFFFFF'
Please, any direction would be a great help as I have never come across the need to do this before.
Thanks.
ls
I have no idea how to go about this and any direction would be a great help.
I need to query a 4 byte raw data field in a table and convert the bits to string values. The db layout manual has a mapping for this field:
From the DB Manual:
field_name = day_of_week (RAW 4-bytes)
This field contains a bit mask where each bit
reflects what days of a week a calendar based
schedule will execute. The following is a list
of the bit patterns within this bit mask:
0 = Every Sunday
1 = Every Monday
2 = Every Tuesday
3 = Every Wednesday
4 = Every Thursday
5 = Every Friday
6 = Every Saturday
How would I query the schedule table for this field and map to the appropriate string(s). I would have to account for all bits set or only a few or 0 or 1 and output a string that would make sense like 'S-M-T-W-Th-F-Sa' or 'M-W-F' or 'T-Th'. I just have no idea how to code something like that up in sql.
Sample data in the day_of_week field for the schedule table is:
record1 = '00004001'
record2 = '00080020'
record3 = '04081020'
record4 = '0FFFFFFF'
Please, any direction would be a great help as I have never come across the need to do this before.
Thanks.
ls