Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

Query problem

saradhij2eesaradhij2ee EntrantCurrent User Role Beginner
I have a table called VOLUN_BMI_RESULT. when I update this table(autoCommit is false), trigger will get execute and it inserts data in the VOLUN_BMI_RESULT$AUD.Before commiting this I am performing some other operation in that, I used the following query

Oracle
*******
SELECT * FROM (SELECT RESULT,pkid FROM VOLUN_BMI_RESULT$AUD where VOLUN_ID = 'SY-0900004' ORDER BY pkid DESC, ROWNUM DESC) WHERE ROWNUM=1.

while debugging, when I execute above query from java API it is showing uncommited row(i.e row to be commited) as first row.which is correct and works fine.

MySQL
*******
SELECT p.RESULT,pkid FROM VOLUN_BMI_RESULT$AUD p ,(SELECT @rownum:=0) r where p.VOLUN_ID = 'SY-0900004' order by p.pkid desc limit 1

while debugging, when I execute above query from java API it is showing max among commited rows as first row.


My problem is, why MySQL query is not showing uncommited row as Max row like oracle query.

Comments

  • xaprbxaprb Mentor Inactive User Role Beginner
    Transaction isolation level.

    By the way, trigger-based auditing will not work with statement-based replication if there are auto-increment columns.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.