Subject RE: [ib-support] DECLARE SECTION STATEMENT ERROR
Author Martijn Tonies
Hi Hellen,

that explains it - Embedded SQL is not Stored Procedure & Trigger SQL.
Check the Language Reference for the exact SP & Trigger language.

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com



I found it in EmbedSQL Chapter 8 Working With BLOB Data page 199-200

Regards
Hellen





> Hellen,
>
> Where did you find this declare section stuff? Have you read the
chapter
> Stored Procedure and Trigger Language in the Language Reference? I
> cannot find such a clause there...
>
> That probably explains your problem.
>
> As for making the correct procedure, read the above mentioned chapter
> and have a look at the examples in the chapter and the example
database
> that comes with IB (EMPLOYEE).
>
>
> Hope this helps,
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
>
>
> 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
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>
>
>


Yahoo! Groups Sponsor
ADVERTISEMENT




To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.