Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i call a shell app from SQL storedprocedure?

Im trying to call a notepad or calculator from a stored procedure. can anyone help?

like image 488
user278672 Avatar asked Dec 30 '25 00:12

user278672


1 Answers

For what database will this be?

For MySql you can write a UDF (User Defined Function - See http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html) to to this or use the ready made one from the UDF repository guys. See http://www.mysqludf.org/lib_mysqludf_sys/index.php. See the sys_exec function and also the section labelled 'A Note of Caution' ;-)

For Microsoft SQL see the xp_cmdshell command here: http://msdn.microsoft.com/en-us/library/aa260689%28SQL.80%29.aspx

like image 131
Hannes de Jager Avatar answered Jan 01 '26 16:01

Hannes de Jager