[firebase-br] Unexpected end of command

Eduardo Bahiense eduardo em icontroller.com.br
Sex Maio 1 11:52:13 -03 2009


declare variable NOME varchar(30);
declare variable POSICAO integer;
DECLARE variable CAMPOS varchar(50);
BEGIN
FOR select a.RDB$FIELD_NAME, a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION
FROM   RDB$RELATION_FIELDS a
where a.RDB$FIELD_POSITION > 1 and
       a.RDB$RELATION_NAME = 'CLIENTE') <*************** sobrando
into :CAMPOS, :NOME, :POSICAO
DO
begin
    INSERT INTO CARACTERISTICAS (TABELAS, ORDEMCAMPOS, CAMPOS)
    values
    (:NOME, :POSICAO || 1, :CAMPOS) <************ Falta ";"
    suspend;
end

END!!


Rogerio Monteiro escreveu:
> Bom dia colegas.
> 
> Estou ficando cansado. Peguei a apostila onde ensina criar variáveis na 
> stored procedure mas não sei onde estou errando.
> 
> Está dando Unexpected end of command - line 8, column 34,
> que é logo no fim da primeria linha do declare variable na coluna do ")".
> 
> Eis o código:
> 
> CREATE PROCEDURE PREENCHE
> AS
> declare variable NOME varchar(30);
> declare variable POSICAO integer;
> DECLARE variable CAMPOS varchar(50);
> BEGIN
> FOR select a.RDB$FIELD_NAME, a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION
> FROM   RDB$RELATION_FIELDS a
> where a.RDB$FIELD_POSITION > 1 and
>       a.RDB$RELATION_NAME = 'CLIENTE')
> into :CAMPOS, :NOME, :POSICAO
> DO
> begin
>    INSERT INTO CARACTERISTICAS (TABELAS, ORDEMCAMPOS, CAMPOS)
>    values
>    (:NOME, :POSICAO || 1, :CAMPOS)
>    suspend;
> end
> 
> END!!
> 
> Desde já, agradeço a ajuda.
> 
> Rogerio 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use: http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa





Mais detalhes sobre a lista de discussão lista