Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No SQL result unless i reopen

 
Lila Fowler
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi = )


//Using MySql

I have a replace statement that works, the only problem is if i run it, it does not display the change in the database unless i close mySql and re-open it. Any idea's on why this happens and how i could fix it? F5 does not refresh it, neither does ctrl + F5

Thanks

//This is my replace statement

UPDATE ACCESSCONTROLUSER
SET SU_RECENTJOBS = REPLACE(SU_RECENTJOBS, 'mwahahaha', '')
WHERE SU_USERNAME = 'Maja';

//Output

Query OK, 1 rows affected (0 ms)
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe it's cached. Try flush tables;
 
Lila Fowler
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um i always thought that the FLUSH command wipes the data from the table & only keep the architecture? There is other data in that column that has to be there, only that specific name/pattern should be deleted. Is there another way to use the flush then?

thanks.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no that's truncate. FLUSH clears or reloads the cache.
 
Lila Fowler
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, doesn't work, FLUSH TABLES or FLUSH TABLE ACCESSCONTROLUSER. Still have to close mySql to see the change =(
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't there a SQL setting that does not update the tables until the connection os closed but keeps it into a log and then flushs it all at once ?
 
Lila Fowler
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know but then shouldn't FLUSH LOGS solve the problem if that is the case but it doesn't & wouldn't that effect all update changes? I'm only having this problem with this particular statement that uses the replace. My other update, insert, delete statements i see the results without having to close sql
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lila,

Have you issued a commit after your update statement? By the way where do you execute these commands? In command line? In JDBC statements? It seems to me that you see the results after closing because it is not auto committed unless you close your session.

Regards,

Fatih.
 
Lila Fowler
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yay =) I used COMMIT & FLUSH together and it works Thanks Fatih & Sebastian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic