Memory leak problem when using host variable with Pro*C 8.0
From: Thierry Toussaint <ttoussaint_at_eft.be>
Date: Wed, 05 Jan 2000 13:57:45 GMT
Message-ID: <38734FAE.12B32903_at_eft.be>
Hello everybody!
EXEC SQL END DECLARE SECTION; strcpy(tidFQ.arr,"02020000");
tidFQ.len=strlen(tidFQ.arr);
strcpy(partition.arr,"3");
partition.len=strlen(partition.arr);
}
Date: Wed, 05 Jan 2000 13:57:45 GMT
Message-ID: <38734FAE.12B32903_at_eft.be>
Hello everybody!
I have a memory leak problem when proceeding to UPDATE statements. The problem occurs when I use host variables, but does not occur when I use hardcoded values.
I use Pro*C version 8.0.4.0.0 and Borland C++5.01
In the example below the memory leak problem does not occur when replacing host variables with fixed values
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR tidFQ[9]; VARCHAR partition[2];
EXEC SQL END DECLARE SECTION; strcpy(tidFQ.arr,"02020000");
tidFQ.len=strlen(tidFQ.arr);
strcpy(partition.arr,"3");
partition.len=strlen(partition.arr);
for (long i = 0 ; i < 100000 ; i++)
{
EXEC SQL UPDATE FORMAT_QUEUE SET EVENTID = '007' WHERE TID = :tidFQ AND PARTITION = :partition; if (sqlca.sqlcode<0) { cout << "A problem occured"; } EXEC SQL COMMIT WORK; cout << i << endl;
}
Any hint would help.
Thanks! Received on Wed Jan 05 2000 - 14:57:45 CET