How to declare variable in mysql trigger?
Answer / Santosh Kumar Bhart
To declare a variable inside a MySQL trigger, you can use the DECLARE keyword followed by the variable name and data type. For example: 'CREATE TRIGGER my_trigger BEFORE INSERT ON my_table FOR EACH ROWn BEGINn DECLARE new_id INT;n SET new_id = (SELECT LAST_INSERT_ID());n END;'.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to use count function in mysql?
How can we know the number of days between two given dates using MySQL?
2 Answers Base2 Infotech, Webworks,
How do I show columns in mysql?
How to enable or disable a row of a table using MySQL in struts?
How do I start mysql in ubuntu?
what is a cursor? : Mysql dba
What are the different types of triggers in mysql?
Can we rename database in mysql?
In how many ways we can retrieve data in the result set of mysql using php?
How to insert html code into mysql database using php?
how to connect a php script with the mysql database?
Is mysql relational?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)