Re: Using PRO*C to update a long column
Date: 1997/12/31
Message-ID: <68e5ln$hjc$1_at_svr-c-02.core.theplanet.net>#1/1
Noodles
Just a short example:
#define MAXBUF 20000
void main()
{
FILE* fp;
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR vcLongBuffer[20000];
EXEC SQL END DECLARE SECTION;
fp = fopen("C:\ascii_file.txt","r" );
while (fgets(vcLongBuffer.arr, MAXBUF,fp) != (char*)NULL) {
vcLongBuffer.len = strlen(vcLongBuffer.arr); EXEC SQL INSERT INTO testtab (long_column) VALUES (:vcLongBuffer)
}
EXEC SQL COMMIT WORK; }
Obviously in realityyou would try and make the above code a bit more elegant by introducing a commit could i.e commit after a ceratin number of inserts.
Regards
Lawrence Simela
MAHALINI CONSULTING LIMITED
Noodles wrote in message <19971231010000.UAA17795_at_ladder02.news.aol.com>...
>We're running Oracle 7.1 on OpenVMS 6.2. I'm a newbie to Pro*C but I know SQL
>and ANSI C very well. Can someone please point me to some docs or outline the
>procedure for updating a long column using Pro*C from an ASCII file.
>
>TIA,
>Cliff
>
Received on Wed Dec 31 1997 - 00:00:00 CET