From: Manasi Save
Date: August 9 2010 7:10am
Subject: MySQL data get and set problem
List-Archive: http://lists.mysql.com/mysql/222462
Message-Id: <20100809031010.psykfw0htr4084sg@mail.artificialmachines.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_4z198t8o41s0"
Content-Transfer-Encoding: 7bit
--=_4z198t8o41s0
Content-Type: text/plain;
charset=UTF-8
Content-Description: Plaintext Version of Message
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Dear All,
Table values are getting rollback without calling rollback.
I have a table Test with some columns in it.
Here's the Table Structure:-
Create Table TestID
(
TestID int not null,
MyID int
);
I am calling two procedures one is get the value of MyID column and one is to set the value after that.
FirstProc :-
Create procedure SP_GetMyID(TestID int)
Begin
Select MyID From Test Where TestID = TestID;
End;
Call SP_GetMyID(1);
[OUTPUT = 1]
If suppose the above proc returns me 1 as MyID then below proc will set MyID as 2 (incrementing by one)
Call SP_SetMyID(1,2);
Create Procedure SP_SetMyID(TestID int, NewMyID int)
Begin
Update Test
Set MyID = NewMyID
Where TestID = TestID;
End;
After setting the value I am again calling get procedure
Call SP_GetMyID(1);
[OUTPUT = 2]
and if after some time say after 10 seconds if I m calling SP_GetMyID again. It gives me OUTPUT as 1.
--
Regards,
Manasi Save
Artificial Machines Private Limited
manasi.save@stripped
Ph:-9833537392
--=_4z198t8o41s0
Content-Type: multipart/related;
boundary="=_5dr28fsoji0w";
start="5dsd0vrcehvk@stripped"
Content-Transfer-Encoding: 7bit
This message is in MIME format.
--=_5dr28fsoji0w
Content-Type: text/html;
charset=UTF-8
Content-Description: HTML Version of Message
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-ID: 5dsd0vrcehvk@stripped
Dear All,
Table values are getting rollback without calling rollback.
I have a table Test with some columns in it.
Here's the Table Structure:-
Create Table TestID
(
TestID int not null,
MyID int
);
I am calling two procedures one is get the value of MyID column and one is to
set the value after that.
FirstProc :-
Create procedure SP_GetMyID(TestID int)
Begin
Select MyID From Test Where TestID =
TestID;
End;
Call SP_GetMyID(1);
[OUTPUT = 1]
If suppose the above proc returns me 1 as MyID then below proc will set MyID as
2 (incrementing by one)
Call SP_SetMyID(1,2);
Create Procedure SP_SetMyID(TestID int, NewMyID int)
Begin
Update Test
Set MyID = NewMyID
Where TestID = TestID;
End;
After setting the value I am again calling get procedure
Call SP_GetMyID(1);
[OUTPUT = 2]
and if after some time say after 10 seconds if I m calling SP_GetMyID again. It
gives me OUTPUT as 1.
--
Regards,
Manasi Save
Artificial Machines Private
Limited
manasi.save@stripped
Ph:-9833537392
--=_5dr28fsoji0w--
--=_4z198t8o41s0--