Subject | Re: [firebird-support] Error while trying to create stored procedure - invalid request BLR at offset 218 |
---|---|
Author | Martijn Tonies |
Post date | 2007-11-15T12:48:06Z |
Hi,
a : in front of it.
INTO :EMPRESA;
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I'm trying to create a stored procedure from a delphi application and I'mSounds like you're using the wrong message file at the client.
> getting this error:
>
> *invalid request BLR at offset 218
> undefined message number
> *This is my stored procedure's code:*Whenever you use (input/output) parameters or variables, you need to use
>
> CREATE PROCEDURE UPDATE_FATURA
> AS
> DECLARE VARIABLE EMPRESA CHAR(38);
> DECLARE VARIABLE USUARIO CHAR(38);
> DECLARE CONTA_PADRAO CHAR(38);
> DECLARE VARIABLE CATEGORIA_PADRAO CHAR(38);
> DECLARE VARIABLE PAGANTE_ID CHAR(38);
> DECLARE VARIABLE VENDA_ID CHAR(38);
> DECLARE VARIABLE DATA_VENDA DATE;
> DECLARE VARIABLE VALOR NUMERIC(15,2);
> DECLARE VARIABLE LOJA_ID CHAR(38);
> DECLARE VARIABLE VENDEDOR_ID CHAR(38);
> DECLARE VARIABLE FINANCEIRO_ID CHAR(38);
> BEGIN
> SELECT FIRST 1 ID FROM LOJA INTO EMPRESA;
a : in front of it.
INTO :EMPRESA;
> SELECT FIRST 1 ID FROM USUARIOS WHERE LOJA_ID = :EMPRESA ANDNIVEL_ACESSO
> = 'A' INTO USUARIO;Same here.
> SELECT VALOR FROM PARAM WHERE NOME = 'ContaPadrao' AND LOJA = :EMPRESASame here.
> INTO CONTA_PADRAO;
> SELECT VALOR FROM PARAM WHERE NOME = 'CategoriaFinanceiroPadrao' ANDLOJA
> = :EMPRESA INTO CATEGORIA_PADRAO;Guess what :-)
> FOR SELECT ID, FINANCEIRO_ID, LOJA_ID, VENDEDOR_ID, PAGANTE_ID,Lots of those here.
> DATA_VENDA, (TOTAL_PRODUTOS + TOTAL_TAXAS + TAXA_SERVICO - DESCONTO) VALOR
> FROM VENDAS WHERE FINANCEIRO_ID IS NOT NULL
> INTO VENDA_ID, FINANCEIRO_ID, LOJA_ID, VENDEDOR_ID, PAGANTE_ID,
> DATA_VENDA, VALOR DO
> BEGINCONTA_ID,
> INSERT INTO FINANCEIRO (ID, LOJA_ID, CATEGORIA_ID, PESSOA_ID,
> VENDA_ID, MOVIMENTO, DESCRICAO, VENCIMENTO, VALOR, DESCONTO, ACRESCIMO,See above, once fixed, let us know if it works.
> CADASTRADO_EM, CANCELADO, FORMA_PAGAMENTO, FATURA_ID) VALUES
> (SUBSTRING(:VENDA_ID FROM 1 FOR 16) || SUBSTRING(:FINANCEIRO_ID FROM
> 17), :LOJA_ID, :CATEGORIA_PADRAO, :PAGANTE_ID, :CONTA_PADRAO, :VENDA_ID,
> 'C', 'Faturar', :DATA_VENDA, :VALOR, 0, 0, CURRENT_TIMESTAMP ,'O', 'FA',
> :FINANCEIRO_ID);
> END
> END
>
>
>
> I trying googling for this error, but got no clues at all.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com