Subject Re: [firebird-support] Text blob problems
Author Helen Borrie
At 02:54 PM 6/08/2003 +0000, you wrote:
>Hi all!
>
>This simple database cannot works.
>I'd like to execute my NEW_PROCEDURE, but always get error message
>about "internal error".
>
>If I change this line:
> EXECUTE PROCEDURE SP_TBL1 '1','2';
>to:
> EXECUTE PROCEDURE SP_TBL1 null,null;
>everything is ok.
>
>When found this problem I use D6, FB1.0, IBX, IBExpert.
>I made some try with FB1 and FB15 also without good results.
>I hope there is a simple solution.
>
>Thanks for any help
>Sandor
>
>***************************************************
>
>SET SQL DIALECT 3;
>
>SET NAMES WIN1250;
>
>CREATE DATABASE 'c:\Proba.gdb'
>USER 'SYSDBA' PASSWORD 'masterkey'
>PAGE_SIZE 4096
>DEFAULT CHARACTER SET WIN1250;
>
>CREATE DOMAIN DOM_BLOB_TEXT AS BLOB SUB_TYPE 1 SEGMENT SIZE 80;
>
>CREATE GENERATOR GEN_TBL1_ID;
>SET GENERATOR GEN_TBL1_ID TO 0;
>
>CREATE TABLE TBL1 (
> ID INTEGER NOT NULL,
> MODIF TIMESTAMP NOT NULL,
> NOTE1 DOM_BLOB_TEXT,
> NOTE2 DOM_BLOB_TEXT
>);
>
>CREATE PROCEDURE SP_TBL1 (
> IN_NOTE1 BLOB SUB_TYPE 1 SEGMENT SIZE 80,
> IN_NOTE2 BLOB SUB_TYPE 1 SEGMENT SIZE 80)
>AS
>BEGIN
> INSERT INTO TBL1 (ID,MODIF,NOTE1,NOTE2)
> VALUES (GEN_ID
>(GEN_TBL1_ID,1),CURRENT_TIMESTAMP,:IN_NOTE1,:IN_NOTE2);
>END;
>
>CREATE PROCEDURE NEW_PROCEDURE
>AS
>DECLARE VARIABLE ATM_KOD INTEGER;
>BEGIN
> EXECUTE PROCEDURE SP_TBL1 '1','2';
>END;

Your problem is that you defined the procedure SP_TBL1 with blobs as input
arguments but, in the second procedure, you pass strings as arguments to
it. A string isn't a blob.

With Firebird (but not IB) change SP_TBL1 to take varchars as
arguments. The INSERT statement will work just fine inserting strings into
blobs because the DSQL parser will convert them for DML operations.

heLen