Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:00:22+00:00 2026-05-23T14:00:22+00:00

So I am having an issue with MySQL 5.5 that is about to drive

  • 0

So I am having an issue with MySQL 5.5 that is about to drive me insane. I have a few nested stored procedures and one of them inserts some data into a table and then selects the LAST_INSERT_ID() into an out-bound parameter. The following is my stored procedure:

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `createNewSession`(
    in inputIP varchar(15),
    in inputPostTime bigint,
    in inputPostInterval bigint,
    in inputPlatform varchar(45),
    out outSessionID int)
BEGIN
    insert into myDB.session (IP, StartTime, LastPost, Platform) 
        values (inputIP, inputPostTime - inputPostInterval, inputPostTime, inputPlatform);

    select LAST_INSERT_ID() into outSessionID;
END;$$

Now, if I pass the correct parameters (ie: parameters that I have tested against the insert statement and are properly working) and call the following I will get the correct ID back

CALL myDB.createNewSession('127.0.0.1', 1310062874228, 1310062894228, 'Platform', @outVar);
select LAST_INSERT_ID();

However if I call the following then I am returned a BLOB parameter with a ? value.

CALL myDB.createNewSession('127.0.0.1', 1310062874228, 1310062894228, 'Platform', @outVar);
select @outVar;

Why would this be happening? This stored procedure has been working for a month+ at this point and as far as I know nothing has changed to the DB settings. Why would I be receiving anything other than LAST_INSERT_ID() upon selecting the outbound parameter from the stored procedure?

Any help would be greatly appreciated. Going crazy over here…

EDIT

The error that I’m getting when calling the top-level stored procedure is as follows:

Error Code: 1264. Out of range value adjusted for column 'outSessionID' at row 68

EDIT 2

Here is the table structure

Field Type Null Key Extra
'SessionID', 'int(11)', 'NO', 'PRI', NULL, 'auto_increment'
'IP', 'varchar(15)', 'NO', '', NULL, ''
'StartTime', 'bigint(20)', 'NO', '', NULL, ''
'LastPost', 'bigint(20)', 'NO', '', NULL, ''
'Platform', 'varchar(45)', 'NO', '', NULL, ''

EDIT 3

So after messing around some more I have found that the following queries when called together will also select a BLOB parameter with value of ‘?’

set @tempVar = 25;
select @tempVar;

Shouldn’t this return 25?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:00:22+00:00Added an answer on May 23, 2026 at 2:00 pm

    Please try

    SET outSessionID := LAST_INSERT_ID();
    

    within the proc instead of doing the SELECT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The issue I am having is as follows: I have a MySQL table that
I'm designing a mySQL DB and I'm having the following issue: Say I have
I'm having an issue with MySQL . I have 2 Tables : Table A
I'm having an issue with MySQL and PHP. When I try to create a
Hi I am having an issue with a MySQL query not passing a string
I am having an issue with importing a large(60MB) CSV file in MYSQL DB.
I am having a difficult time sorting through this PHP/MySQL issue. Let me show
I'm having issues when trying to call a MySQL (5.0.77) stored procedure with parameters,
I having issue that content assistant / intellisense is working in methods such as
I have about ten amazon ec2 servers all constantly writing to my mysql database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.