List:General Discussion« Previous MessageNext Message »
From:Victor Pendleton Date:July 9 2004 12:34pm
Subject:RE: Scripts - ERROR
View as plain text  
Have you tried running this from the mysql monitor?

-----Original Message-----
From: Andre MATOS
To: Victor Pendleton
Cc: 'mysql@stripped '
Sent: 7/8/04 5:33 PM
Subject: RE: Scripts - ERROR

Hi,

I tried but didn't work. Here is my script:

#
------------------------------------------------------------------------
# @Name		: NTT_dbcreator.2004-06-07.v1-001.andre.sql
# @DESCRIPTION	: NTT Database Creator
# @CREATED    	: Jun 07, 2004 by Andre Matos - amatos@stripped
# @VERSION	: 1.01
#
------------------------------------------------------------------------

SET FOREIGN_KEY_CHECKS=0;

DROP DATABASE IF EXISTS `database1`;
CREATE DATABASE `database1`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;

DROP DATABASE IF EXISTS `database2`;
CREATE DATABASE `database2`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;


DROP DATABASE IF EXISTS `database3`;
CREATE DATABASE `database3`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;


DROP DATABASE IF EXISTS `database4`;
CREATE DATABASE `database4`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;


DROP DATABASE IF EXISTS `database5`;
CREATE DATABASE `database5`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;


DROP DATABASE IF EXISTS `database6`;
CREATE DATABASE `database6`;
commit;
SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql;
commit;


SET FOREIGN_KEY_CHECKS=0;


# end of the script


NB: "ntt_dbcreator.2004-06-07.v1-001.andre.sql" is another script that
is 
responsable for creating the tables, indexes, relations, etc...

This is the error when I tried to run the main script using phpMyAdmim:

 Database mysql  running on localhost

Error

SQL-query : 

SOURCE ntt_dbcreator.2004 -06 - 07.v1 - 001.andre.sql

MySQL said:

#1064 - 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 
'SOURCE ntt_dbcreator.2004-06-07.v1-001.andre.sql' at line 1


Thanks.

Andre



On Thu, 8 Jul 2004, Victor Pendleton wrote:

> Have you tried writing the script using the source command?
> drop database;
> create database;
> source populate_db;
> ....
> 
> -----Original Message-----
> From: Andre MATOS
> To: mysql@stripped
> Sent: 7/8/04 12:20 PM
> Subject: Scripts
> 
> Hi List,
> 
> Let's suppose that I have a script to create one database (tables, 
> indexes, etc).
> 
> How can I call another script from this script? For example:
> 
> DROP DATABASE test;
> CREATE DATABASE test;
> 
> (here call another script)
> 
> back to the previous script
> 
> 
> 
> Thanks.
> 
> Andre
> 
> 

-- 
Andre Matos
amatos@stripped

Thread
ScriptsAndre MATOS8 Jul
  • RE: Scriptsbruce8 Jul
RE: ScriptsVictor Pendleton8 Jul
  • RE: Scripts - ERRORAndre MATOS9 Jul
RE: Scripts - ERRORVictor Pendleton9 Jul