Existing table. Insert new Column with Data

[expired user #5003]'s profile image [expired user #5003] posted 12 years ago in General Permalink
Hi.
I have an existing table with 70 columns.
(Phrases in 70 different languages).

I would like to add a new column with data.
(Phrases in Punjabi).

The phrases must of course load in the proper place based on an index.

I am at a loss how to do this in Heid SQL.

As a side note: My server will not allow me to use the "Load Data File" function.

Any help would be greatly appreciated.

Regards,

David
ansgar's profile image ansgar posted 12 years ago Permalink
Try out the data tab on that table?
[expired user #5003]'s profile image [expired user #5003] posted 12 years ago Permalink
Anse,

I probably did not explain myself properly.

I have about 700 phrases to add to the new column.
Cannot do it by manual entry.
Looking for a way to import a text file.

My suggestion:
=============

The text could have 2 fields.
The first field would be the key and the second, the data.
That way, a new column can be uplodaded into a table.


Is there a better way?

David
jfalch's profile image jfalch posted 12 years ago Permalink
if you have text lines of the format

key,data

you can transform these by simple text editor search-and-replace (or a very simple program) to

UPDATE tablename SET new_column="data" WHERE keyfield=key;

then store the result as an .sql file and execute it against your database.
[expired user #6563]'s profile image [expired user #6563] posted 12 years ago Permalink
excel works great for doing these kinds of updates. Use the concatenate function to create the sql query. Don't forget to add a ; at the end of each line. copy the rows of sql you create in excel and paste into a query and run

Please login to leave a reply, or register at first.