Editing mysql script inside rad studio

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Editing mysql script inside rad studio

Post by NoComprende » Wed 19 May 2010 12:18

If I edit a script (procedure) I created using the MySQL Query Browser within rad studio why does the text in the original script not change? Also, where does the mydac developer studio store the edited text?

Tyro
Devart Team
Posts: 20
Joined: Wed 12 Sep 2007 07:12

Post by Tyro » Thu 20 May 2010 07:47

Could you explain what exactly you do please?
I consider the following steps:
1. Open the 'Database Explorer' tool window.
2. Choose a particular connection and unfold nodes through 'Procedures' node.
3. Right-click (or 'App' key) on a desired procedure to show a popup menu.
4. Choose 'Open' to edit procedure's script.
5. Make some changes and press 'Save' button (or Ctrl+S).
6. Nothing happens.
Am I right?
And what is the name of the product you talking about? 'dbForge Fusion for MySQL' or 'DAC for MySQL'? What is the version of that product?

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Thu 20 May 2010 08:28

That's what I did Tyro. I then closed rad studio, opened MySQL query browser, opened the script and the text was unchanged from the original. I then restarted rad studio and opened the file in that and the text contained the changes I had made. As I said, I'm confused as to where the changed file has been stored. It's dbForge fusion for MySQL v3.50.332 I'm using.

Tyro
Devart Team
Posts: 20
Joined: Wed 12 Sep 2007 07:12

Post by Tyro » Thu 20 May 2010 09:42

OK, you said "opened the file". Are you sure that you open a procedure editor, but not a script from a file on a disk? Are you sure that you are open the same connection (and schema) both in 'Database Explorer' and 'MySQL Query Browser'? Hint: right click on a connection node in the 'Database Explorer' and press 'Properties' to verify the connection string.
Please try again to open a procedure editor from the 'Database Explorer', made some changes and save it. BUT, before save, please open options dialog from main menu 'Tools->Devart Tools->Options...', then choose 'Environment->Output' node at the left of the dialog, and make sure that 'Schema Object Editor' option (under 'SQL Log' group) is set. Thus, when you save the procedure, a message will be added to 'Devart - Sql Log' output pane in the RAD Studio's 'Messages' tool window. That message contain the whole update script for the procedure, smth. like that:
------- Saving ``.`` to server -------

DROP PROCEDURE ``.``;
CREATE DEFINER = ...
PROCEDURE ``.``(...)
BEGIN
...
END;
---------------- Done: ``.`` ----------------
You must see this message to make sure that your changes were successfully applied to that procedure.

Tyro
Devart Team
Posts: 20
Joined: Wed 12 Sep 2007 07:12

Post by Tyro » Thu 20 May 2010 09:51

BTW, let us recommend you to download the latest version 3.60.380 of 'dbForge Fusion for MySQL' which has several new features, improvements and bug-fixes.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Thu 20 May 2010 11:44

Hi Tyro, I downloaded and installed 3.60.380. Didn't make any difference. When I say "opened the file" in rad studio I mean I right clicked the procedure in database explorer window and selected "Open". In MySQL query browser I selected 'File | Open Script" from main menu and then clicked on the .sql file containing the procedure script. Im using the same connection in both and everything else tallies (Schema Object Editor is ticked etc).

Tyro
Devart Team
Posts: 20
Joined: Wed 12 Sep 2007 07:12

Post by Tyro » Thu 20 May 2010 12:15

It seems I've got your scenario.
Using MySQL Query Browser you've created a script of a procedure definition and saved it to a file on a disk. Then you open the same procedure via 'Database Explorer' in RAD Studio. Now, when you change it's body and save you expect to see these changes in your previously saved file.
If so, you'll never see any changes in that file on a disk, because you saved a copy of a procedure definition to a file, but your original procedure definition is still stored on a database. And dbForge Fusion's procedure editor interacts directly with that database, i.e. it fetches a procedure definition from a database, and when you edit it and save, it is saved directly back to that database, and don't use any temporary or intermediate file.
In this case, if you want to update your script in a file, you have to regenerate it again via 'MySQL Query Browser' or 'dbForge Fusion'. Or you can open that file with dbForge Fusion's SQL Editor, which has lot of useful features. Just select 'Tools->Devart Tools->Open file...' and choose the saved file.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Thu 20 May 2010 13:53

I get it now Tyro. Thanks for your help and apologies for wasting your time. I've no need of the mysql query browser now anyway. The dbForge fusion is brilliant compared to it. You've no idea the time the debugger has saved me since I started using it.

NoComprende
Posts: 135
Joined: Tue 09 Jan 2007 13:44

Post by NoComprende » Fri 21 May 2010 08:58

Tyro, can I just ask you where this database that the editor is storing the definitions is on the hard drive? I can't find any files in the folder that contain my tables that don't belong to me.

Tyro
Devart Team
Posts: 20
Joined: Wed 12 Sep 2007 07:12

Post by Tyro » Fri 21 May 2010 09:51

It depends on the MySQL server location and its configuration. If you have a local server installed, the databases are stored in "%ProgramFiles%\MySQL Datafiles" directory by default. The database file has a binary format, so you'll not be able to look inside it and find your procedure's definition.
Please refer to MySQL Reference to find out more.

Post Reply