create table users (
oid INT not null,
given_names VARCHAR(30) not null,
paternal_name VARCHAR(30) not null,
maternal_name VARCHAR(30),
user_name VARCHAR(20) not null,
user_pass VARCHAR(20) not null,
title VARCHAR(7),
home_phone VARCHAR(20),
mobile_phone VARCHAR(20),
email VARCHAR(30),
birthday DATE,
business_phone VARCHAR(20),
rank INT,
created DATETIME YEAR TO SECOND default CURRENT YEAR TO SECOND not
null,
createdby INT not null,
lastmodified DATETIME YEAR TO SECOND,
modifiedby INT,
lockedby INT,
disabled_date DATETIME YEAR TO SECOND,
ops_data blob default NULL,
picture blob default NULL,
icon blob default NULL,
thumb blob default NULL,
rights BLOB default NULL
)
And the following is the BLOB I try to update:
procedure UpdatePicture;
var
M:TMemoryStream;
Pic:TJPEGImage;
Par:TParams;
begin
InformixLob := True; //Doesnt appear to do anything
M := TMemoryStream.Create;
Pic := TJPEGImage.Create;
Par := TParams.Create(nil);
try
Pic.LoadFromFile('C:\MyPic.jpg');
Pic.SaveToStream(M);
Par.Clear;
Par.CreateParam(ftBlob, 'BlobParam', ptInput);
Par.ParamByName('BlobParam').LoadFromStream(M, ftBlob);
M.Free;
M := nil;
SQLConnection.Execute('UPDATE USERS SET THUMB = :BlobParam WHERE
OID = 4823',Par);
finally
Pic.Free;
if Assigned(M) then M.Free;
Par.Free;
end;
end;
What am I doing wrong or what parameter am I missing?
Thanks...