Home » Performance » MySQL » Call sql script from sql script
Call sql script from sql script [message #3194] Wed, 18 June 2008 03:56 Go to next message
jcernik  is currently offline jcernik
Messages: 2
Registered: June 2008
Junior Member
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
Re: Call sql script from sql script [message #3202 is a reply to message #3194 ] Thu, 19 June 2008 03:15 Go to previous messageGo to next message
debug  is currently offline debug
Messages: 122
Registered: March 2008
Senior Member

Hmm, doesn't it work?


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


Mikhail Solovyev, MySQL Performance Expert
MySQL Performance Blog
MySQL Consulting
Re: Call sql script from sql script [message #3206 is a reply to message #3202 ] Thu, 19 June 2008 04:23 Go to previous message
jcernik  is currently offline jcernik
Messages: 2
Registered: June 2008
Junior Member
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');
Previous Topic:How to avoid security violation at table level
Next Topic:UNION question
Goto Forum:
  



Current Time: Fri Nov 21 01:09:16 EST 2008

Total time taken to generate the page: 0.02819 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge