facebook

any way to execute other .sql files?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #272053 Reply

    We 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 Workbench

    Version: 5.5.0 Milestone 2
    Build id: 20070409-5.5.0-Milestone2

    Eclipse Platform

    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330

    Eclipse RCP

    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20070212-1330

    Eclipse Java Development Tools

    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20070212-1330

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20070212-1330

    Eclipse Project SDK

    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330

    Eclipse Graphical Editing Framework

    Version: 3.2.2.v20070208
    Build id: 20070208-1315

    Eclipse 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

    #272078 Reply

    Riyad Kalla
    Member

    Anthony,
    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.

    #272079 Reply

    Yeah, 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). 🙂

    #272112 Reply

    Riyad Kalla
    Member

    (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.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: any way to execute other .sql files?

You must be logged in to post in the forum log in