Hi Claus,
Gustav is right...
In your code you have
param1.buf = malloc(sizeof(buf1)); memcpy(param1.buf, buf1, sizeof(buf1));
param1.size = sizeof(buf1);
...
param2.buf = malloc(sizeof(buf2)); memcpy(param2.buf, buf2, sizeof(buf2));
param2.size = sizeof(buf2);
Try with
param1.buf = malloc(sizeof(buf1)+1);
memcpy(param1.buf, buf1, sizeof(buf1)+1);
param1.size = sizeof(buf1)+1;
...
param2.buf = malloc(sizeof(buf2)+1);
memcpy(param2.buf, buf2, sizeof(buf2)+1);
param2.size = sizeof(buf2)+1;
The +1 will get the \0 at the end of the array of characters and you will be
in business.
You can also replace the memcpy by a strcpy, e.g.
strcpy((param1.buf, buf1);
strcpy((param2.buf, buf2);
if it exist in the precompiler, note that I do not have experience with the
precompiler but I do have experience with C and C++.
Bernard
On Tuesday 27 January 2004 12:35, Claus-Thomas Buhl wrote:
> I am using the C/C++ precompiler of SAP DB 7.3.0.46 and want
> to update the data of a LONG column.
>
> I recognized that if the new value is shorter than the
> old value, the updated column has the length of the old value,
> and the value is the new value plus the part of the old value
> that is longer than the new value.
>
> I can reproduce this behaviour with the appended program.
> The program creates a table X with columns k INTEGER and
> f LONG BYTE. It then inserts a row with k=1 and f='HELLO' and
> finally updates the row with f='BELL'. If I query the table,
> I get the value 'BELLO' for column f.
>
> Regards,
>
> CTB
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]