Stored Procedures

4,134 views
Skip to first unread message

Isabelle Lanini

unread,
Jun 14, 2013, 9:01:26 AM6/14/13
to seque...@googlegroups.com
I am new to Sequel Pro but did a lot of sql work in the early 90s. I am trying to create a stored procedure but keep getting syntax errors on even a very simple test procedure. Are stored procedures supported or not? I don't see anything clear in the documentation, yet can see that it's been a feature request for a long time. What am I missing? And is there some hidden documentation somewhere? I don't find the DOCS section of the Sequel Pro website terribly useful. Help? 

Rowan Beentje

unread,
Jun 14, 2013, 12:50:27 PM6/14/13
to seque...@googlegroups.com, Isabelle Lanini
Hi Isabelle,

There's no explicit GUI support for stored procedures, so there's no easy way to create or edit procedures in the UI. About the only thing Sequel Pro will do at the moment is show you when you have stored procedures, and support import and export.

However, that shouldn't affect procedure creation or editing via the Custom Query view, which it sounds like you're trying to do. Providing that you're using DELIMITER statements correctly, it should all work...

What kind of syntax errors are you getting?

For example, the following is a valid simple procedure using a prepared statement:

delimiter ;;
CREATE PROCEDURE unsafecountrows(IN tablename VARCHAR(200))
BEGIN
SET @query = CONCAT('SELECT COUNT(*) FROM ', tablename);
PREPARE astatement FROM @query;
EXECUTE astatement;
DEALLOCATE PREPARE astatement;
END;;
delimiter ;

CALL unsafecountrows('avalidtablename');

Rowan

On 14 Jun 2013, at 06:01, Isabelle Lanini <lan...@verizon.net> wrote:

> I am new to Sequel Pro but did a lot of sql work in the early 90s. I am trying to create a stored procedure but keep getting syntax errors on even a very simple test procedure. Are stored procedures supported or not? I don't see anything clear in the documentation, yet can see that it's been a feature request for a long time. What am I missing? And is there some hidden documentation somewhere? I don't find the DOCS section of the Sequel Pro website terribly useful. Help?
>
> --
> You received this message because you are subscribed to the Google Groups "Sequel Pro" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sequel-pro+...@googlegroups.com.
> To post to this group, send email to seque...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sequel-pro.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Jean-Yves

unread,
Jul 23, 2013, 7:50:10 AM7/23/13
to seque...@googlegroups.com
Hi Isabelle,

What I do is use a combination of Sequel Pro for creating tables, relationships and triggers etc, and for entering queries and editing data in the data grid views.

Alongside this I also have MySQL Workbench open to fill in the gaps, including Stored Procs and Stored Functions.  It has a pretty good stored routine editor that has such things as syntax checking and syntax colouring. Workbench also has visual data modelling (can be a little flakey though) and a good set of admin tools, although where available I prefer the Sequel Pro equivalents (eg backups, imports, user management) as these are clearer in SP than MWB, in my opinion.

I find this combination of tools to be pretty comprehensive.

Reply all
Reply to author
Forward
0 new messages