Page 1 of 1
Editing mysql script inside rad studio
Posted: Wed 19 May 2010 12:18
by NoComprende
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?
Posted: Thu 20 May 2010 07:47
by Tyro
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?
Posted: Thu 20 May 2010 08:28
by NoComprende
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.
Posted: Thu 20 May 2010 09:42
by Tyro
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.
Posted: Thu 20 May 2010 09:51
by Tyro
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.
Posted: Thu 20 May 2010 11:44
by NoComprende
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).
Posted: Thu 20 May 2010 12:15
by Tyro
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.
Posted: Thu 20 May 2010 13:53
by NoComprende
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.
Posted: Fri 21 May 2010 08:58
by NoComprende
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.
Posted: Fri 21 May 2010 09:51
by Tyro
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.