Howto Q: Writing an Oracle Cursor in stead of select into
Posted on 2003-03-19
I am having an oracle table "Alfabet" with the columns A,B,D. The column D is a Long field. The table needs adjusted: the column C needs to be added. Because long fields needs to be at the end of the tabledefinition, a simple alter table won't do. I thought of creating a temp table, and Select into everything into the temptable, drop the original table, create the new table (with all A,B,C,D columns) and select everything back into it. NOT! The select into doesn't work with long fields (ora 997 error).
1) i've heard that a cursor can be used to select into the temp table and back (and ora997 won't show up) - is this true?
2) being unexperienced with cursor writing, can someone send me the code to do this?
3) Or is there some other way i can do the trick?