Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Copy column

by Joost (Canon)
on Oct 01, 2007 at 21:24 UTC ( #642001=note: print w/replies, xml ) Need Help??


in reply to Copy column

Did you mean to put "" quotes around that statement?

I think you need to specify the columns explicitly for something like this to work. Also you may want to be careful about the kind of quotes you're using (and you may not need any, if your columns and tables aren't named after keywords). So how about

"INSERT INTO $db.$table SELECT '',category,''.'' FROM $db.$oldtable"
Note that I'm assuming you don't need anything BUT the category from the $oldtable.

update: usually if "things don't work" there are error messages. Check your database log and the output of your perl program. This is part of a perl program, yes?

update2: please don't just erase your question and replace it with an answer that doesn't even do what you're asking.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642001]
help
Chatterbox?
[perldigious]: Being the ignorant one, my initial reaction to that is, "that's sort of a dick move, a lot of people like me expect column names like that to stay the same, why the hell would you change them like that for seemingly no good reason?"
[perldigious]: Or is my irritation/ frustration well founded?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2017-05-25 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?