| Author |
No SQL result unless i reopen
|
Lila Fowler
Ranch Hand
Joined: Jul 31, 2009
Posts: 84
|
|
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)
|
Courage is not the absence of fear but rather the judgment that something is more important then fear. ~ Ambrose Redmond
|
 |
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
|
|
|
Maybe it's cached. Try flush tables;
|
JDBCSupport - An easy to use, light-weight JDBC framework -
|
 |
Lila Fowler
Ranch Hand
Joined: Jul 31, 2009
Posts: 84
|
|
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
Joined: Feb 23, 2009
Posts: 1183
|
|
|
no that's truncate. FLUSH clears or reloads the cache.
|
 |
Lila Fowler
Ranch Hand
Joined: Jul 31, 2009
Posts: 84
|
|
|
Nope, doesn't work, FLUSH TABLES or FLUSH TABLE ACCESSCONTROLUSER. Still have to close mySql to see the change =(
|
 |
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
|
|
|
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
Joined: Jul 31, 2009
Posts: 84
|
|
|
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
Joined: Sep 01, 2005
Posts: 182
|
|
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
Joined: Jul 31, 2009
Posts: 84
|
|
Yay =) I used COMMIT & FLUSH together and it works Thanks Fatih & Sebastian
|
 |
 |
|
|
subject: No SQL result unless i reopen
|
|
|