Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2012
    Posts
    1

    Post Unanswered: In MySQL 5.5, I want to perform (b'param1' << 127 | b'param2' << 63 | b'param3'), whe

    In MySQL Server 5.5, I want to perform:

    (b'param1' << 127 | b'param2' << 63 | b'param3')

    where param1, param2, param3 = some 63-bit binary value and store result into a Decimal(65,0) column.

    My Procedure Call:

    CALL new_routine(b'111111111111111111111111111111111111 111111111111111111111111111',b'1111111111111111111 11111111111111111111111111111111111111111111',b'11 11111111111111111111111111111111111111111111111111 11111111111');

    My Stored Procedure:

    DELIMITER $$

    CREATE DEFINER=`root`@`localhost` PROCEDURE `new_routine`(IN first63bits DECIMAL(65,0), IN second63bits DECIMAL(65,0),
    IN third63bits DECIMAL(65,0))
    BEGIN

    DECLARE Pack DECIMAL(65,0);

    SET Pack = first63bits;
    SET Pack = Pack << 127;
    SET Pack = Pack | second63bits;
    SET Pack = Pack << 63;
    SET Pack = Pack | third63bits;

    INSERT INTO table_name(column_name) VALUES (Pack);

    END

    It works fine for 63-bits. I want to achieve for total 189 binary bits.

    Please help me.
    Last edited by Harsha H P; 06-08-12 at 06:37. Reason: display problem

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •