Create Mysql Stored Procedure using in vb .NET - mysql

How do I create a stored procedure for mysql using VB .NET programmatically?
EDIT:
Apologize to be so brief. I have tried using ExecuteNonQuery provided by MySQL .NET Connector. It prompts me error. Maybe it's because I put "Delimiter $$"?
I know I can create using script (batch file) if I want to send it to my client (as commented below). But my objective is to keep MySQL password safe. So script is not the way.

Connect to the database.
Run the create procedure SQL command using ExecuteNonQuery

Related

DB Use gives problems... SP migrated by Flyway produces MySQL syntax error while corresponding raw script does not

Using Flyway to do mysql migration. I migrate a stored procedure, it successfully migrates/deploys but when running gives an error.
If I deploy the same stored procedure manually from MySQL Workbench or another tool, it runs fine.
I am wondering how other users are using Flyway with mysql without running into this problem
I tried removing comments etc from the stored procedure. No avail.

call mysql stored procedure through vba

I have created a stored procedure in mysql workbench located on server. I need to call this stored procedure through a vba application located on local machine. I am stuck on it unable to connect to mysql stored procedure. Thanks in advance for responses .
Have you setup a DSN with an ODBC connection yet?
Assuming so - check out simple examples at
It wasn't hard to find this on Google
DAO Examples

godaddy create stored procedure in mysql hosting

I have hosted a website in godaddy with php/mysql/apache. Now I want to create stored procedure in mysql but find that no options in cPanel for me to do. When I just paste the create sql in cPanel SQL window, it said it need super privileges to do that. After google in the website, it said I can remote connect to godaddy mysql and create in my mysql console workbench. But when I setup in the mysql console, it said it cannot connect after test connection. What should I do? What is the correct steps to do that??
Just make sure your stored procedures are labeled as DETERMINISTIC.
This is an example of an allowed stored procedure form Godaddy help pages :
DELIMITER $$
DROP PROCEDURE IF EXISTS `spGetSouls`$$
CREATE PROCEDURE `spGetSouls`()
DETERMINISTIC
BEGIN
SELECT * FROM soul;
END$$
DELIMITER ;
CALL spGetSouls();
There might be something wrong with your account- I was able to create stored procedures on mine. In cPanel, I picked phpMyAdmin and selected on of my databases. There'll be a "Routines" tab showing. I created a new routine (type of procedure) to create a stored procedure and it saved successfully. If this isn't working for you, I'd suggest opening a support ticket
Using MySQL work bench would be the best option. You should be able to connect with the same hostname/IP that shows in cPanel. Try opening a command prompt and running the following:
telnet <cpanel_account_ip> 3306
That should be working (just tested and mine works great). If it's not, you might have a firewall rule blocking it. When you use Workbench, make sure you connect with the database user defined under the MySQL databases. You may need to associate that user with the database (which you can also do from the MySQL databases page in cPanel).
Let us know how it works out!

MySQL: Can a stored procedure invoke a Java program?

I have a MySQL stored procedure. I would like to have a stored procedure run some statements, then call a Java program. Then when the java program is complete, the stored procedure should finish.
The java program will connect to the database, do some analysis and then insert rows into other tables.
Is this possible?
Yes. Take a look at The MySQL UDF Repository and the sys_exec function. You could use this to launch your Java code in a new JVM.
After you get that installed here is how you run it: https://dba.stackexchange.com/a/39547/14506

What steps are needed to use an Entity Framework model with a MySQL server?

I've added and designed an ADO.NET Entity Data Model (.edmx) and have generated the corresponding DDL Script (.edmx.sql). When I was using SQL Server 2008, all I had to do was connect to it via the Transact-SQL Editor toolbar and execute the SQL. When I try this method, however, it doesn't let me connect to the MySQL server, as it seems to be looking only for Microsoft SQL Servers. I have the latest version of Connector/Net, and can add the MySQL database as a Data Connection, but cannot execute the script I need. What steps are needed to use an Entity Framework model with my MySQL server?
I stumbled across this little property while editing my Data Model:
(This option was installed along side Connector/Net.)
After changing to SSDLToMySQL.tt, right-click and select Generate Database from Model... as you would normally. This will generate the .edmx.sql file, and should give you several errors (as .NET uses SQL Server to parse .sql files.) After generating the DDL script, I opened up MySQL Workbench and pasted the script in. You need to make sure that an appropriately-named schema already exists on the server, then run the script, and voila.