Marco:

You want to use the ALTER TABLE command
(http://www.mysql.com/doc/A/L/ALTER_TABLE.html)

G Jensen

----- Original Message -----
From: "Marco Kammerer" <[EMAIL PROTECTED]>
To: "MYSQL" <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 6:34 AM
Subject: inserting a colum into a existing table


> Hello
>
> I am writing a programm in java that is checking my mysql db if
> everything is correct, so that I can you that db later in my java
> programm to write datas into it!
>
> I am fresh to mysql, but I got everything so fare, that the prog is
> able to make a no root user with the appr. rights, creates, drops
> db, creates tables, drops tables but i need one more thing!
>
> How can i add to an existing table - called t1 - in the database db1
> some more columes?
>
> I just need the mysql syntax like it will be entered :
>
> local:~ # mysql -u root -p
> Enter password:
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 1617 to server version: 3.22.32
>
> Type 'help' for help.
>
> mysql> use db1;
> Database changed
> mysql> show tables;
> +---------------+
> | Tables in db1 |
> +---------------+
> | t1                   |
> +---------------+
> 1 row in set (0.00 sec)
>
> mysql> select * from t1;
> +-----------+------------+
> | id_t1         | t1_text        |
> +-----------+------------+
> |         1 |      NULL |
> +-----------+------------+
> 1 row in set (0.00 sec)
>
> mysql> command to add colum for example t1_info!
>
> mysql> select * from t1;
> +-----------+------------+------------+
> | id_t1         | t1_text        | t1_text       |
> +-----------+------------+------------+
> |         1 |      NULL |         NULL |
> +-----------+------------+------------+
> 1 row in set (0.00 sec)
>
> Sorry if this stuff is to easy for you, i am working hard to get
> better :-)
>
> Thanks Marco
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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