Creating and editing procedures

(2 posts) (2 voices)
  1. dimoco, Member

    I just created my first two reports and what I've seen so far looks very promising. I use Navicat to manage my local database and I could create a simple procedure with it, but Navicat returned an error message when I tried to introduce variables. I then found MySQL Query Browser, which allowed use of variables, but it failed to execute a script that contained the additional code generated by the MyDBR Report Wizard (e.g., select 'dbr.sum', 5;). What's the best method to create procedures that include the special notation for MyDBR? I'm fairly new to writing procedures, so any pointers in the right direction would be greatly appreciated. (My system: MAMP on MacBook running OSX 10.5.7)

    Thanks,
    dimoco

  2. myDBR Team, Key Master

    Stored procedures are a powerful way of encapsulating complex queries behind a single call. Stored procedures can contain more that simple queries (control of flow language) and they can return more than one result set (query result).

    myDBR's commands are normal SQL queries with special notation for myDBR application. The issue with MySQL Query Browser is that it can handle only procedures that return a single result set. MySQL Query Browser is a capable tool for editing procedures, but not really executing them.

    Easiest way of working is a setup where you first create the procedure using MySQL Query Browser, attach it to myDBR as a report and then gradually start adding features to your report. Once the report is attached to myDBR, you are free to make any modifications to the procedure without the need to reattach it. You can simply press the browsers reload button in myDBR to see the changes you have made in MySQL Query Browser to your report.

    There is quite many articles on net how to write stored procedures in MySQL. We hope to put some sample code available to show how to utilize the full potential of stored procedures in MySQL.

    --
    myDBR Team


Reply

You must log in to post.