Select the product you need help with
Getting values for setting Multi-select listboxes in SQL dataArticle ID: 867124 TechKnowledge ContentSUMMARY
This article describes how to interpret the binary values of a multi-select listbox in the SQL database. MORE INFORMATION Dexterity has provided a Multi-Select List Box with a binary(4) data type, therefore all 32 items can be selected using the hex value to mask the binary(4) data type. The values can be set in all stored procedures by using the bitwise operator OR (|). A stored procedure can test to see if a bit position is on by using the bitwise operator AND (&). In addition, there will be two store procedures in the DYNAMICS database one to turn/off the bit position, and one to check it a bit position is on. Important: Each of the possible 32 multi-select list items has been define as a constant in DYNAMICS..CONSTANTS. It is important to note that the constants define the exponent and not the hex value. This is because the CONSTANTS table store all content values as strings and smGetConstants procedures convert the string to the requested return value. The conversion of a hex string to a binary value is machine dependent and will be converted to different value on big endian and little endian machines. Therefore the smGetConstantMSItem stored procedure must be used to get the correct machine independent value for the bit MASK constant. DecimalHex MaskConstantExponent 1 0x01000000 MS_ITEM_1 24 2 0x02000000 MS_ITEM_2 25 3 0x04000000 MS_ITEM_3 26 4 0x08000000 MS_ITEM_4 27 5 0x10000000 MS_ITEM_5 28 6 0x20000000 MS_ITEM_6 29 7 0x40000000 MS_ITEM_7 30 8 0x80000000 MS_ITEM_8 31 9 0x00010000 MS_ITEM_9 16 10 0x00020000 MS_ITEM_10 17 11 0x00040000 MS_ITEM_11 18 12 0x00080000 MS_ITEM_12 19 13 0x00100000 MS_ITEM_13 20 14 0x00200000 MS_ITEM_14 21 15 0x00400000 MS_ITEM_15 22 16 0x00800000 MS_ITEM_16 23 17 0x00000100 MS_ITEM_17 8 18 0x00000200 MS_ITEM_18 9 19 0x00000400 MS_ITEM_19 10 20 0x00000800 MS_ITEM_20 11 21 0x00001000 MS_ITEM_21 12 22 0x00002000 MS_ITEM_22 13 23 0x00004000 MS_ITEM_23 14 24 0x00008000 MS_ITEM_24 15 25 0x00000001 MS_ITEM_25 0 26 0x00000002 MS_ITEM_26 1 27 0x00000004 MS_ITEM_27 2 28 0x00000008 MS_ITEM_28 3 29 0x00000010 MS_ITEM_29 4 30 0x00000020 MS_ITEM_30 5 31 0x00000040 MS_ITEM_31 6 32 0x00000080 MS_ITEM_32 7 Examples: In Dynamics C/S+ for SQL, the smGetConstantMSItem stored procedure can be used to get the value to update the ML List box. Here is an example of a call to this stored procedure: In addition, the actual source code for the stored procedure itself is shown below. From this, you can see that we use SQL constants to raise 2 to the appropriate power value. The exception case is a position of 8, so make sure and note that difference. This article was TechKnowledge Document ID: 9552 PropertiesArticle ID: 867124 - Last Review: July 21, 2011 - Revision: 2.0
|


Back to the top








