kathygriffin Posted April 19, 2014 Share Posted April 19, 2014 ok so I had this database of 20,000 items. My part numbers I had to add a gg in front of all them then add them into the same database. So I had the old part numbers that looked like this 33344 and new part numbers that looked like this gg33344. Now for some reason it is only totaling up the old numbers and not the new numbers. The same exact query with a recently new database was built and seems to have no issue with the letters being in front. So my guess is that if you insert new items into database you have to readd the event? Anyone have any ideas or input? example of new database after query ran for total my query is something like this total = (stock ny+ stock nc ) part number - stock ny - stock nc - total 33344 5 6 11 gg33344 5 6 0 34344 5 6 11 gg34344 5 6 0 36344 5 6 11 gg36344 5 6 0 thanks Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 19, 2014 Share Posted April 19, 2014 the answer is probably yes. you changed the structure of your data and it no longer matches what the query in the event is doing. Quote Link to comment Share on other sites More sharing options...
kathygriffin Posted April 19, 2014 Author Share Posted April 19, 2014 I went ahead and deleted the event then added in a new one... I will keep eveyone posted. Quote Link to comment Share on other sites More sharing options...
kathygriffin Posted April 20, 2014 Author Share Posted April 20, 2014 Wow thats exactly what it was. Turns out whenever you add more rows of data you have to go in and delete the old event then add it again. I am using 5.1 something i believe. Is this a bug or is this how mysql events are suppose to be ? Quote Link to comment Share on other sites More sharing options...
kicken Posted April 20, 2014 Share Posted April 20, 2014 Wow thats exactly what it was. Turns out whenever you add more rows of data you have to go in and delete the old event then add it again. I am using 5.1 something i believe. Is this a bug or is this how mysql events are suppose to be ? No, you do not have to re-add events for them to see newly inserted data. You re-adding the event probably just resolved some other issue such as the event maybe being disabled, or the event's query not being what you thought it was. Quote Link to comment Share on other sites More sharing options...
kathygriffin Posted April 21, 2014 Author Share Posted April 21, 2014 Its the same exact query that I am sure of. Its 5.1.73 For some reason when I added another 20,000 items it never queried everything. Only the old stuff. So I deleted the even then readded it. Any suggestions or ideas where to look or what to do besides upgrading mysql? Thanks Quote Link to comment Share on other sites More sharing options...
kicken Posted April 21, 2014 Share Posted April 21, 2014 Since re-creating the event, have you re-tested adding new rows and seeing if the event will then see them (without being re-created again)? I've not yet used the event system but prior to posting I did test it on my server by creating an event which periodically updated a table with the count of rows matching a pattern in another table, then I periodically added new rows both matching and non-matching and the count properly updated each time the event ran with the new information. What exactly does your event do and how is it defined? Are you sure it's even being run after the rows were added? Quote Link to comment Share on other sites More sharing options...
kathygriffin Posted April 22, 2014 Author Share Posted April 22, 2014 Well that still doesn't explain why it only queried half of the items. Because it did keep on querying.But on the old stuff..So that one I have yet to figure out. It works now and I am happy. Is there any log anywhere that might say? thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.