Re: Pro*C text insertion Question
From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: Tue, 28 Jun 1994 08:24:24 GMT
Message-ID: <Cs3M0o.IyG_at_uk.ac.brookes>
Date: Tue, 28 Jun 1994 08:24:24 GMT
Message-ID: <Cs3M0o.IyG_at_uk.ac.brookes>
Disclaimer: I've never tried this, so it'll probably go horribly wrong. I really dislike the way nothing sensible works on long fields. :)
Matthew J Carr (carr_at_ist.flinders.edu.au) wrote:
> exec sql update set text_is = :line
> where mess_id =:get_id;
EXEC SQL UPDATE SET text_is = text_is ||CHAR(10)||:line
WHERE mess_id = :get_id;
> I dont really want to create a huge array that will hold each line
> of text and do one insert at the end.
Yes, you do! Declare line to be char *, and then you can malloc enough memory to hold the string, reallocing as it gets longer. Finally you can insert the whole lot into the database in one go, without all having to multiple updates which will cripple your performance.
-- _________________________ _______________________________ / Tommy Wareing \ / \ | p0070621_at_brookes.ac.uk X 'Blobby, blobby, blobby!' | \ 0865-483389 / \ said Mr. Blobby / ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Received on Tue Jun 28 1994 - 10:24:24 CEST