Subject DECLARE SECTION STATEMENT ERROR
Author Hellen Huang
Hi All

I have table named personpict contains two fields i.e:
psno char(8)
pspicture blob sub_type 0 segment size 80

then I made a Stored Proc to insert row to personpict table as below :

set term ^;
create procedure SP_INSERT_TO_PERSONPICT
(
psno_cd char(8)
)
as
begin
begin declare section;
based on personpict.pspicture blod_id;
based on personpict.pspicture.segment blob_segment_buf;
unsigned short blob_seg_len
end declare section

declare bc cursor for insert Blob pspicture into personpict;

open bc into :blob_id
blob_segment_len = strlen( blob_segment_buf)

insert into bc values (:blob_segment_buf,:blob_segment_len)
close bc

insert into personpict(psno_cd,pspicture) values ('000140',:blob_id);
end ^
set term ;^

But I confused how to pass bitmap image into stored proc's parameter and I still couldn't execute this Stored Procedure because there was an error occured :

Dynamic SQL Error
SQL error code = -104
Token unknown - line 7, char 10
declare

Could anyone tell me how to make the correct Stored Procedure?

Thank's
Hellen



[Non-text portions of this message have been removed]