Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call a function from result set in MySQL Workbench?

I want to insert a row in a table from the result set view.

I have to call the function "now" in one of the columns.

How can I tell mysql workbench to not insert the value "now()" but its result ?

like image 804
Antoine Avatar asked Dec 31 '25 02:12

Antoine


1 Answers

Okay I've finally found the manual page mentioning that feature:

https://dev.mysql.com/doc/workbench/en/wb-sql-editor-query-panel.html

It is possible to enter a function, or other expression, into a field. Use the prefix \func to prevent MySQL Workbench from escaping quotation marks. For example, for the expression md5('fred'), MySQL Workbench normally would generate the code md5(\'fred\'). To prevent this, enter the expression as \func md5('fred') to ensure that the quoting is not escaped.

like image 154
Antoine Avatar answered Jan 03 '26 09:01

Antoine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!