mysql event scheduler displays error: 'database not selected' - mysql

I apologize if this question seems mundane, but I couldn't find a suitable answer on the web. It's my first time working with event scheduler in phpmyadmin and I think I've got the syntax down:
CREATE EVENT `zero_my_column`
ON SCHEDULE EVERY
1 MINUTE STARTS '2017-07-21 19:02:00'
DO BEGIN
UPDATE
`runners`.`run`
SET
`weekly_total` = 0
WHERE
`weekly_total` <> 0
END;
However, when I run this query in my localhost/phpmyadmin page I get the following error: #1046 - No database selected. runners is my database and run is my table. I am trying to reset the weekly_total column to zero. I'm wondering if the error arises because I need to enter validation to access the database, but I'm unsure. Any tips/hints are much appreciated.

I finally figured it out:
To create an event
Go into phpmyadmin
go to the database you will schedule the event for
click on Events tab
Then enter the script to schedule the event

Related

Activate the zabbix trigger at a certain time

I want to make the zabbix trigger work strictly at a certain time.
I read in the zabbix documentation that the time() function can help with this.
{test.domain:web.test.fail[trigger].last()}=0 and time()>000000 and time()<060000
But when i save the trigger, I get an error:
Invalid parameter "/1/expression": incorrect trigger expression starting from " time()>000000 and time()<060000".
Zabbix 5.0.18
I will be grateful for your help.
Zabbix triggers are evaluated each time a new values is received.
You can check an item at cetain times using Custom Intervals.
See: https://www.zabbix.com/documentation/current/en/manual/config/items/item/custom_intervals

EditRecord failed because of the default alias Error

I have a simple form in access which contains a macro that saves the edit time and a flag after the current record is updated.
However when the macro attempts to execute I get an error that says:
EditRecord failed because the default alias represent a record which is read only
I have been searching over the internet for an answer but I haven't been able to find anything yet that helps.
This form only has one user on it at a time and none of the other forms using the same table are open while it's being used.
I have pk and it's an Auto Increment without duplicate values. Beside this I have changed the locking status to No Lock
I also get an error when I use DoCmd in my macro instead of openQuery.
The data mode in openQuery is "Edit" so it doesn't create any errors.
I'm using the Macro Tools in Access 2016. I'm not sure about the differences between an Access Macro and Access VBA but this is an Access Macro.
Here is the code I have so far:
SetWarning Off
Repeat Count:1
Open Query:
UPDATE table
SET editDate = now, reviewDate = now, flag = 0
WHERE ID=[Forms]![FormName].[ID];
view: Datasheet
Data Mode: Edit
GoToRecord: Next

"No database selected" when running procedures

Hello there I am new to all of this and recently took over my cricket teams website. I have been doing this procedure for 3 month without any problem but today this happened when I ran this query in the SQL section:
CALL refresh_batting_profile_snapshot(#rc);
CALL refresh_bowling_profile_snapshot(#rc);
CALL refresh_mvp_snapshot();
CALL refresh_mvp_derived_moms();
The error message I got back was this:
CALL refresh_batting_profile_snapshot(#rc)
);
MySQL said:
1046 - No database selected
You should have a database list in the left pane. Click on the one you want to use in order to select it:
One you do that, the SQL pane will reflect the currently selected database:

zabbix regex to trigger for wrong data type

I have an item of type float, but sometimes a string is received in case of error instead of a number. How can I make a trigger regexp to fire in this case?
I have no idea now to check for "wrong data type".
Actually this is by design and what I'm trying to do is this: if the data gathering fails, I send an error message in order to see it on zabbix end.
I tried with nodata(0), but this doesn't seem to work.
In you case zabbix will not store the "wrong" value for the item. And if you don't care what the string is then you can just setup a trigger for "nodata" for the period of your interval. Look in the triggers manual and search for the "nodata".
Edit: scratch that, didn't read the whole question ....
Edit2: if you are certain that this is not working by design and not because your trigger interval misses the data interval, then you can try to catch the unsupported status. There is an open request for the functionality, but you can setup a side script similar to this. Or you can wrap the monitored item on the node into a UserParameter script that reads the value and prints -1 or something if it is not a number. Then proceed with a normal numeric trigger.

NotInList script

I am trying to use Access and VBA to create a DB to store my library. I already posted a question and got a useful answer but I am still failing with the basics, so, after having checked this tutorial link I am starting from scratch and doing it in smaller steps (i.e. asking more basic questions...).
I have the following DB structure and relationship details:
DB structure and relationship details http://img195.imageshack.us/img195/8184/relationshipdetails.png
Using the Access AutoForm:Columnar wizard I created a Form based on the Table Libri, then I changed the field "Stanza" into a ComboBox, I entered the RowSource as follows:
ComboBox http://img560.imageshack.us/img560/160/comboboxdata.png
Then in the Event tab I selected the ... controls in the NotInList and in the VBA I entered the following code:
VBA code http://img689.imageshack.us/img689/1416/notinlistcode.png
Saved everithing, but when I open the Form Libri and try to enter a value in the ComboBox I get the following error message:
Error message http://img41.imageshack.us/img41/8937/errormsgt.png
All my tables are empty (no records).
So the VBA code seems not to be considered/executed at all, what am I doing wrong or missing?
Ok, I was completely blind.
The error is the option: "Limit to list" that I set to "NO" and instead, the NotInList event is only filred if such option is set to "yes".
I find this conter-intuitive, but at least now I know.
Sorry for bothering other. hope this is helpful some other newbe like me.