[prog] mysql

Jenn Vesperman jenn at anthill.echidna.id.au
Thu Nov 6 18:52:01 EST 2003


On Thu, 2003-11-06 at 10:55, Saint-Wolfe wrote:
> Hi,
> 
> I'm trying to add some information to a table that already exists in a 
> database, the table I wish to add
> the info to is called address
> 
> I have a file called info.sql which contains the following:
> 
> select "INSERT INTO address (p_code, addr_type, city, state) VALUES (", 
> f_code, ",'", 'Current', "','", 'Albany', "','", 'NY', "');" from 
> faculty
> 
> 
> I have a second file called info2.sql which contains:
> 
> select "UPDATE address SET email = '", 
> lower(concat(left(f_name,1),concat(l_name,"@nyu.edu'"))) AS "2", "where 
> email = '' and p_code = ", f_code from faculty


Are you trying to run a select command, or an insert/update command?

If you're trying to do the insert, your command should be in the format
INSERT INTO your_table (optional fields) VALUES (your_values)

You DON'T need or want the select in the start, that's just confusing
mySQL into thinking you're doing a select command, not an insert.





Jenn V.
-- 
    "Do you ever wonder if there's a whole section of geek culture 
        	you miss out on by being a geek?" - Dancer.
   My book 'Essential CVS': published by O'Reilly in June 2003.
jenn at anthill.echidna.id.au     http://anthill.echidna.id.au/~jenn/




More information about the Programming mailing list