You may also find it more convenient to edit a text file with all of your data and 
table creation commands in it, then use the 'source' command inside an mysql session 
to execute them.  That way when you run into an error, you just edit the file and 
repeat.  

Another nicety about MySQL is a command that you could put in your edit file just 
prior to the create table command to delete the table, if it already exists.  Be 
careful though, not to delete a table that you intend on altering.  The syntax is like 
this:

delete table IF EXISTS tablexyz;
create table tablexyz (
   columnA     tinyint   auto_increment,
...

-----Original Message-----
From:   Paul DuBois [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, March 20, 2002 5:42 PM
To:     alan4100; [EMAIL PROTECTED]
Subject:        Re: Adding Columns to table

At 15:30 -0500 3/20/02, alan4100 wrote:
>I am creating a database called Meet_a_Geek at MS DOS prompt. The 
>customer table has about 30 fields..no time counting..but I noticed 
>that I cannot go beyond 9 fields without ending with a semicolon.

The mysql program does not require that you enter an entire query on a single
line.  Just enter it over the source of several lines, ending the last
one with a semicolon.


>  Also another problem crops up when I tried to recreate the customer 
>table with the remaining fields yet to be created. The error message 
>says "Customer Table existed".
>
>Is there a windows program that I can input all at once with ease? I 
>know more questions are keeping coming in...Please just refer me to 
>good tutorial sites so I can continue and finish this assignment.
>
>You may take a glance at my assignment below from cut and paste with 
>dos editor.
>==========================================
>==========================================
>
>mysql> use Meet_a_Geek;
>Database changed
>mysql> create table customers (Customer_ID INT NOT NULL PRIMARY KEY 
>AUTO_INCREME
>NT, First_Name VARCHAR(20) NOT NULL, LAst_Name VARCHAR(30) NOT NULL);
>Query OK, 0 rows affected (0.00 sec)
>
>mysql> show tables from Meet_a_Geek;
>+-----------------------+
>| Tables_in_Meet_a_Geek |
>+-----------------------+
>| customers             |
>+-----------------------+
>1 row in set (0.01 sec)
>
>mysql> create table customers (Customer_ID INT NOT NULL PRIMARY KEY 
>AUTO_INCREME
>NT, First_Name VARCHAR(20) NOT NULL, LAst_Name VARCHAR(30) NOT NULL, 
>address VAR
>CHAR(50), City VARCHAR(20), State VARCHAR(2), Zip VARCHAR(20), 
>E_Mail VARCHAR(20
>), Age INT);
>ERROR 1050: Table 'customers' already exists
>mysql> create table customers (Customer_ID INT NOT NULL PRIMARY KEY 
>AUTO_INCREME
>NT, First_Name VARCHAR(20) NOT NULL, LAst_Name VARCHAR(30) NOT NULL, 
>address VAR
>CHAR(50), City VARCHAR(20), State VARCHAR(2), Zip VARCHAR(20), 
>E_Mail VARCHAR(20
>), Age INT);


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to