- This topic has 3 replies, 2 voices, and was last updated 17 years, 6 months ago by Riyad Kalla.
-
AuthorPosts
-
Anthony EstelitaMemberWe have about 10 or so SQL files that inserts test data into our mySQL database. Accoring to the mySQL specs we should be able to use the “source” command:
source <sql_file>
but when I create an sql file that has the following line in it:
/* FILE: insert_all.sql */
source c:\Projects\test\dbfiles\clean_data.sql
source c:\Projects\test\dbfiles\insert_data1.sql
source c:\Projects\test\dbfiles\insert_data2.sql
source c:\Projects\test\dbfiles\insert_data3.sql
source c:\Projects\test\dbfiles\insert_data4.sql
source c:\Projects\test\dbfiles\insert_data5.sql
source c:\Projects\test\dbfiles\insert_data6.sql
source c:\Projects\test\dbfiles\insert_data7.sql
source c:\Projects\test\dbfiles\insert_data8.sql
source c:\Projects\test\dbfiles\insert_data9.sql
source c:\Projects\test\dbfiles\insert_data10.sql
source c:\Projects\test\dbfiles\test_data.sql
I get the following error when running the the insert_all.sql file from within the SQL editor:
“You have an error in your SQL syntz; check the manual that corresponds to your MySQL server version for the right syntax…”Please advise if this is possible? My only other solution is to create a command/batch file to execute all the scripts (but that would require the mySQL binaries to be installed on the devopers machine) 🙁
Greatly appreciate any ideas. 🙂
Thank you,
Anthony
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is my info:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** Date:
Monday, June 25, 2007 2:01:10 PM PDT** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_11*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 5.5.0 Milestone 2
Build id: 20070409-5.5.0-Milestone2*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 5.5.0 Milestone 2
Build id: 20070409-5.5.0-Milestone2Eclipse Platform
Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
Build id: M20070212-1330Eclipse RCP
Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
Build id: M20070212-1330Eclipse Java Development Tools
Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
Build id: M20070212-1330Eclipse Plug-in Development Environment
Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
Build id: M20070212-1330Eclipse Project SDK
Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
Build id: M20070212-1330Eclipse Graphical Editing Framework
Version: 3.2.2.v20070208
Build id: 20070208-1315Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-launcher
C:\Program Files\MyEclipse 5.5 M2\eclipse\eclipse.exe
-name
Eclipse
-showsplash
600
-exitdata
7f4_7c
-nosplash
-showlocation
-vm
C:\Program Files\MyEclipse 5.5 M2\jre\bin\javaw.exe
Riyad KallaMemberAnthony,
The source command is supported to be used from the MySQL Console, and it does, I’ve used it a few times… but there is no garuntee that it will work from within the SQL Editor, which converts all the commands issued to it, into SQL that are passed through the JDBC driver for MySQL.You need to use “source” from the MySQL admin console.
Anthony EstelitaMemberYeah, I realized that, but I was really hoping to run all my SQL from within eclipse/myEclipse (hey, I am a lazy developer and I only want to run one tool on my pc, and since myEclipse practially provides all the bells and whistles to make my lazy bum happy). 🙂
Riyad KallaMember(hey, I am a lazy developer and I only want to run one tool on my pc, and since myEclipse practially provides all the bells and whistles to make my lazy bum happy). 🙂
No doubt, I understand what you want but the limitation here is actually the JDBC driver that all the “stuff” is getting funneled through. It won’t allow that command to be run…
… could you keep a console window open in the background that you could alt-tab to? I can’t really think of an easier/faster setup than that… but I can certainly appreciate the desire to have it all in one place.
-
AuthorPosts