Hi, Please help me out to execute a MySQL Stored procedure in command line, where the procedure contains conditional statements..
+1
A:
$ mysql --user=user_name --password=your_password db_name
mysql> call stored_procedure_name();
or
$ mysql --user=user_name --password=your_password db_name < script.sql
where script.sql
contains your sql statement:
call stored_procedure_name();
dogbane
2010-09-30 08:38:02
A:
Or if you don't want to create a .sql file:
$ mysql -u your_username --password=your_password db_name <<!!
call stored_procedure_name();
!!
Andy Mc
2010-09-30 15:24:39