GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Call sql script from sql script

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Call sql script from sql script

    I need to split my sql script into several files.
    Logic: master sql file calling several other sql files.
    How is this possible with MySQL 5.0.51 + MS Win?
    THX!
    Jan

  • #2
    Hmm, doesn't it work?


    \. /path/to/script1
    \. /path/to/script2
    \. /path/to/script3

    Comment


    • #3
      Unfortunatelly not.
      Details:
      -I have DB with table quals_TBL
      -master script "master.sql" should call 2 slave scripts "slave1.sql", "slave2.sql"
      -running master.sql generates error:
      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\. /ABC/slave1.sql
      \. /ABC/slave2.sql' at line 1
      -I have tried also c:\ABC\slave1.sql with the same result

      -server: MySQL 5.0.51a-community-nt via TCP/IP
      -client: MySQL Client Version 5.1.11
      -to manage DB I use MySQL Administrator 1.2.12
      -to run master.sql I use MySQL Query Browser 1.2.12

      File c:\ABC\master.sql:
      \. /ABC/slave1.sql
      \. /ABC/slave2.sql

      File c:\ABC\slave1.sql:
      INSERT INTO quals_TBL (contacts_id_INT, qualTypes_id_INT, number_STR, valid_DT)
      VALUES (2,2,'hello','1.1.2008');

      File c:\ABC\slave2.sql:
      INSERT INTO quals_TBL (contacts_id_INT, qualTypes_id_INT, number_STR, valid_DT)
      VALUES (4,4,'hello','1.1.2008');

      Comment

      Working...
      X