Why can't I execute this alter procedure firebird query?
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 it's a 2.1 Firebird database.
Don't use SET TERM directive in SQL Editor window of IBExpert. It is allowed only in Script Executive window.
IBExpert generate script automatically (use the stored procedure editor and click on flash button) and then press button "Copy script"
I think they always make CREATE OR ALTER PROCEDURE...
精彩评论