Friday 16 April 2021

Bit Byte and Binary

Ref: https://www.quora.com/What-is-the-relationship-between-binary-and-bytes

Binary is a numbering system. Bytes is an arbitrary grouping of digits.

In particular: Binary is a numbering system where each digit can hold one of two values (0 or 1). As opposed to the normal numbering system we humans tend to use, decimal where each digit can hold one of ten values (0123…9). It works pretty similar in all positional numbering systems, it’s just the base which differ. E.g. the position means the digit is multiplied by a power of the base, position 0 is base^0, position 1 (2nd) is base^1, and so on. Thus the 5th position in decimal is multiplied by 10^4 = 10000, similarly the 3rd position in binary is multiplied by 2^4 = Bx10000 = 16. Same can happen with other bases too, e.g. in octal the base is 8 (012..7), hexadecimal (sometimes just called hex) it’s 16 (012..89AB..EF).

In computers binary is used because it maps onto the way a computer works very nicely. I.e. each electrical signal can be either on or off - mapping onto a 1 or a 0.

A byte is just grouping consecutive signals so they can be seen as individual values with more possibilities than two. There used to be computers with bytes ranging from 6 through 20, but since around the 1960s the 8bit long byte started to become popular and has since become the standard.  

This means each byte contains 8 binary digits (bits)

capable of holding values ranging from Bx00000000 = 0 through to Bx11111111 = 255 (i.e. 2^8=256 possible values).

Usually a byte maps onto a character used in text. Depending on what encoding the computer (and the operating system) uses, each of those values could mean a different character glyph. E.g. ascii decimal binary hex conversion chart

It’s thus become a useful way of defining sizes. Meaning the number of bytes maps pretty closely to the number of characters you can store. Not always, since some encodings use more than one byte per character (e.g. UTF8 can use one byte or it could use several). Also, not all data is in character form, e.g. storing a number is more efficient to store it directly in binary instead of just the characters which would represent each digit - so you get integer values which could be 16bits (2 bytes), 32bits (4 bytes), 64bits (8 bytes) or many other combinations. Also fractional numbers as in a double precision floating point using 32bits (4 bytes) to hold a sign, exponent and value to define the number.


Monday 12 April 2021

How to attach or assign request set to responsibility



DECLARE
l_request_set_code VARCHAR2(40) := 'XX_REQ_SET_CODE';
l_appl_short_name VARCHAR2(3) := 'XXCOM';
l_request_group VARCHAR2(40) := 'XXCOM Receivables Billing';
l_req_appl_short_name VARCHAR2(40) := 'AR';
 

BEGIN

IF NOT fnd_set.set_in_group(request_set => l_request_set_code,
set_application => l_appl_short_name, --REQUEST SET APPLICATION SHORT NAME
request_group => l_request_group,---REQUEST GROUP NAME
group_application => l_req_appl_short_name--REQUEST GROUP APPLICATION SHORT NAME
) then

DBMS_OUTPUT.PUT_LINE ('Request Set not found, adding..');

fnd_set.add_set_to_group(request_set => l_request_set_code,
set_application => l_appl_short_name, --REQUEST SET APPLICATION SHORT NAME
request_group => l_request_group,---REQUEST GROUP NAME
group_application => l_req_appl_short_name--REQUEST GROUP APPLICATION SHORT NAME
);
else
dbms_output.put_line('"XX_REQ_SET_CODE" already added to request group ');
END IF;
dbms_output.put_line('"XX_REQ_SET_CODE" attached to request group Succesfully ');
COMMIT;

EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error in attaching "XX_REQ_SET_CODE" to Request Group ' || sqlerrm);
END;