Subject | Re: [IBO] INSERT BLOB |
---|---|
Author | Helen Borrie |
Post date | 2004-01-07T21:28:50Z |
At 08:30 PM 7/01/2004 +0100, you wrote:
Did you check whether its ib_transaction was running? (.InTransaction)
thread isn't about your SQL code...)
anyway. You should probably just take it out, and call Clear on the
parameter *before* you call the streamer procedure.
It won't work if you can't prepare the statement, though. What exception
message comes back from the Prepare call?
Helen
>Hello Helen,Did you attach its ib_connection property to your ibodatabase?
>
>I am experiencing problems with your suggestions.
>
>1)- setting up TIB_DSQL: statement failed to prepare;
Did you check whether its ib_transaction was running? (.InTransaction)
>I have put a TIB_DSQL on my datamodule and in the SQL property I haveLogically it should work OK. Are you aware of EXISTS()? (still, this
>
>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?
thread isn't about your SQL code...)
>2)- You made some errors with using the assigned functions, should beTrue. But, actually, with hindsight, this test isn't meaningful
>assigned( const p ) instead of p.assigned - but no problem;
anyway. You should probably just take it out, and call Clear on the
parameter *before* you call the streamer procedure.
>3)- Incompatible types 'TIB_ColumnBlob' and 'TIBColumn' inYes, of course you can. I just didn't think of it.
>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 retrievingLet's know how you get on.
>the blob.
It won't work if you can't prepare the statement, though. What exception
message comes back from the Prepare call?
Helen