Forum OpenACS Q&A: Response to alter column type problem.

Collapse
Posted by Janine Ohmer on
What could I do differently?

Wrap your code in pre tags? :)

Seriously, I've had similar problems with Oracle so I think I know what the problem is. This technique does the insert by position rather than by column name. So if you create the new table with columns in different order than the source table, you'll get mismatches like this.

It's hard to tell exactly what went wrong here since the columns it's complaining about don't appear in your new table. But, I'm guessing that you're trying to drop columns (the last example on the page you mentioned). In that case your first select should only include the columns you want to keep. You're doing a "select *" and then (I think) trying to stuff the result into a table that doesn't contain all the columns you selected. But it doesn't know that, since it doesn't look at the column names at all, and just ends up trying to stuff data into columns that are not the right type.