views:

47

answers:

2

the query is:

SET TERM ^ ;
ALTER PROCEDURE SALVARROTA (
    datahora timestamp,
    distancia double precision,
    custo double precision,
    capacidadelivre double precision,
    capacidadetotal double precision,
    nome varchar(50),
    depositox double precision,
    depositoy double precision,
    chegadax double precision,
    chegaday double precision,
    arquivoshp blob sub_type 0 segment size 80,
    arquivodbf blob sub_type 0 segment size 80,
    arquivoshx blob sub_type 0 segment size 80,
    veiculo varchar(50),
    placa varchar(8),
    valor double precision)
returns (
    id integer)
as
BEGIN     INSERT INTO ROTAS
        (DATAHORA, DISTANCIA, CUSTO, CAPACIDADELIVRE, CAPACIDADETOTAL, NOME, DEPOSITOX, DEPOSITOY, CHEGADAX, CHEGADAY, ARQUIVOSHP, ARQUIVODBF, ARQUIVOSHX, VEICULO, PLACA, VALOR)
VALUES (:DATAHORA, :DISTANCIA, :CUSTO, :CAPACIDADELIVRE, :CAPACIDADETOTAL, :NOME, :DEPOSITOX, :DEPOSITOY, :CHEGADAX, :CHEGADAY, :ARQUIVOSHP, :ARQUIVODBF, :ARQUIVOSHX, :VEICULO, :PLACA, :VALOR);
SELECT GEN_ID (GEN_ROTAS_ID,0) FROM RDB$DATABASE INTO ID;     SUSPEND;  END
^

SET TERM ; ^

I get the error:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, column 5.
TERM. 

I'm using IBExpert to execute it, and its a 2.1 firebird DB

A: 

IBExpert generate script automatically (use the store proc editor and click on flash button) and then press button "Copy script" I think they allways make CREATE OR ALTER PROCEDURE...

Hugues Van Landeghem
A: 

Don't use SET TERM directive in SQL Editor window of IBExpert. It is allowed only in Script Executive window.

Andrei K.