Stored Procedure or what should be used ...

A

Anonymous

Guest
Hi there

I've got a table with columns ADDRESS, DOMAIN, AGENT ...

Now, at the moment the ADDRESS column contains all the information that needs to be at ADDRESS, DOMAIN, AGENT respectively .. like

ADDRESS
"me@server.com".SMTP_WESTROUTER

What I want to do is run a mysql script(if possible) to put the appropiate fields in the appropiate columns like ...

ADDRESS
me@server.com

DOMAIN
server.com

AGENT
SMTP_WESTROUTER

What would be the best way of doing this

All the fields are derived from the ADDRESS column

Kind Greetings
Pulse :D
 
MySQL has plenty of string manipulation functions, so you can just run an UPDATE query to take the value in the 'address' column (convention note: generally MySQL keywords are written upper-case, e.g. SELECT, so it is to your advantage to have lower-case column names, just so you can tell them apart more readily), and put its requisite parts into the appropriate columns.
 
Back
Top