Subject Re: [IBO] INSERT BLOB
Author Ronan van Riet
Hello Helen,

I am experiencing problems with your suggestions.

1)- setting up TIB_DSQL: statement failed to prepare;

I have put a TIB_DSQL on my datamodule and in the SQL property I have

EXECUTE PROCEDURE SP_ADD_PROJECT(:pCON_ID, :pPROJECT, :PPROJECTTYPE,
:PERROR_CODE)

The parameters I have added (copied directly from the VALUES predicate?)
here are all the input parameters, followed by the output parameter.

My SP_ADD_PROJECT looks like

CREATE PROCEDURE SP_ADD_PROJECT(
PCON_ID VARCHAR(15),
PPROJECTTYPE VARCHAR(255),
PPROJECT BLOB SUB_TYPE 0 SEGMENT SIZE 80)
RETURNS (
PERROR_CODE INTEGER)
AS
BEGIN
SELECT count(*)
FROM E_PROJECT prj
WHERE DESC_TEXT = :pDESC_TEXT
AND prj.cst_con_id = :pCON_ID
AND prj.projecttype = :pprojecttype
into :PERROR_CODE;

if (PERROR_CODE = 0) then
INSERT INTO E_PROJECT (CREATED_BY, PROJECT, PROJECTTYPE)
VALUES (:pCON_ID, :pPROJECT, :PPROJECTTYPE);
else PERROR_CODE = -1;
END

This is correct?

2)- You made some errors with using the assigned functions, should be
assigned( const p ) instead of p.assigned - but no problem;

3)- Incompatible types 'TIB_ColumnBlob' and 'TIBColumn' in
StreamThisBlob(a1, ParamByName('BlobParam'));

Can I simple typecase ParamByName to TIB_ColumnBlob?

StreamThisBlob(a1, TIB_ColumnBlob(ParamByName('BlobParam')));


I hope you will get back to me so I can finish and move on the retrieving
the blob.

Kind regards,
Ronan van Riet