Unanswered: During Insert: Long to Varchar2(4000) conversion
Can anyone help me out with the sytax?
I keep getting the following error: "ORA-00997: illegal use of LONG datatype"
I'm trying to insert many rows (from a query) which includes 2 Long fields inserting into 2 VARCHAR2 fields.
INSERT INTO MyTable
(XX, YY, ZZ, VARCHAR2, AA, VARCHAR2, BB)
SELECT X,Y,Z, LONG, A, LONG_AGAIN, B
FROM TABLE Result, Person
WHERE Person.ID = Result.PersonID
for p in (select * from person)
for r in (select * from result where result.personid = person.id)
insert into mytable (x, y, z, a, b)
values (p.x, p.y, r.z, p.longval, r.longval);
However, this is only good if your LONG columns contain no more than 32K of data. If there is more than 32K than you need to use Pro*C to get it in chunks, but I'm afraid I don't know the details for that.