procedure - error
o que pode estar dando errado...
=============================================
CREATE PROCEDURE PROC_IMP_NOTAFISCAL(CONTROLE_DATA DATE, CONTROLE_NUMERO INTEGER)
AS
begin
SELECT Nfa_nota.NOTA_NUMERO, Nfa_nota.NOTA_DATA, Nfa_nota.NOTA_DTORGARREC,
Nfa_nota.NOTA_ALIQT, Nfa_itemnota.ITEM_QTDE, Nfa_itemnota.ITEM_UNIDADE,
Nfa_itemnota.ITEM_DISCRIM, Nfa_itemnota.ITEM_VALUNIT, Nfa_empresa.EMP_NOME,
Nfa_empresa.EMP_LOG, Nfa_empresa.EMP_ENDE, Nfa_empresa.EMP_BAIRRO,
Nfa_empresa.EMP_NUME, Nfa_empresa.EMP_INSCMUN, Nfa_empresa.EMP_CPF,
Nfa_empresa.EMP_CNPJ, Nfa_empresa.EMP_CIDADE, Nfa_empresa.EMP_UF,
Nfa_empresa.EMP_TELCONT, Nfa_prestserv.PSERV_NOME,
Nfa_prestserv.PSERV_ENDE, Nfa_prestserv.PSERV_NUME,
Nfa_prestserv.PSERV_INSCMUN, Nfa_prestserv.PSERV_CPF,
Nfa_prestserv.PSERV_CNPJ, Nfa_prestserv.PSERV_UF,
Nfa_prestserv.PSERV_TELCONT, Nfa_prestserv.PSERV_NIT,
Nfa_tplog.NFATPLOG_NOME, Nfa_bairro.NFABAIR_NOME,
Nfa_cidades.NFACID_NOME, Nfa_orgarrec.ORGARC_NOME
FROM NFA_NOTA Nfa_nota
INNER JOIN NFA_ITEMNOTA Nfa_itemnota
ON (Nfa_nota.NOTA_NUMERO = Nfa_itemnota.NOTA_NUMERO)
AND (Nfa_nota.NOTA_DATA = Nfa_itemnota.NOTA_DATA)
INNER JOIN NFA_EMPRESA Nfa_empresa
ON (Nfa_empresa.EMP_COD = Nfa_nota.NOTA_CODEMP)
INNER JOIN NFA_PRESTSERV Nfa_prestserv
ON (Nfa_prestserv.PSERV_COD = Nfa_nota.NOTA_CODPSERV)
INNER JOIN NFA_ORGARREC Nfa_orgarrec
ON (Nfa_orgarrec.ORGARC_COD = Nfa_nota.NOTA_ORGARREC)
INNER JOIN NFA_TPLOG Nfa_tplog
ON (Nfa_tplog.NFATPLOG_COD = Nfa_prestserv.PSERV_LOG)
INNER JOIN NFA_BAIRRO Nfa_bairro
ON (Nfa_bairro.NFABAIR_COD = Nfa_prestserv.PSERV_BAIRRO)
INNER JOIN NFA_CIDADES Nfa_cidades
ON (Nfa_cidades.NFACID_COD = Nfa_prestserv.PSERV_CIDADE)
end
===========================================
da erro no ´end´ :?
=============================================
CREATE PROCEDURE PROC_IMP_NOTAFISCAL(CONTROLE_DATA DATE, CONTROLE_NUMERO INTEGER)
AS
begin
SELECT Nfa_nota.NOTA_NUMERO, Nfa_nota.NOTA_DATA, Nfa_nota.NOTA_DTORGARREC,
Nfa_nota.NOTA_ALIQT, Nfa_itemnota.ITEM_QTDE, Nfa_itemnota.ITEM_UNIDADE,
Nfa_itemnota.ITEM_DISCRIM, Nfa_itemnota.ITEM_VALUNIT, Nfa_empresa.EMP_NOME,
Nfa_empresa.EMP_LOG, Nfa_empresa.EMP_ENDE, Nfa_empresa.EMP_BAIRRO,
Nfa_empresa.EMP_NUME, Nfa_empresa.EMP_INSCMUN, Nfa_empresa.EMP_CPF,
Nfa_empresa.EMP_CNPJ, Nfa_empresa.EMP_CIDADE, Nfa_empresa.EMP_UF,
Nfa_empresa.EMP_TELCONT, Nfa_prestserv.PSERV_NOME,
Nfa_prestserv.PSERV_ENDE, Nfa_prestserv.PSERV_NUME,
Nfa_prestserv.PSERV_INSCMUN, Nfa_prestserv.PSERV_CPF,
Nfa_prestserv.PSERV_CNPJ, Nfa_prestserv.PSERV_UF,
Nfa_prestserv.PSERV_TELCONT, Nfa_prestserv.PSERV_NIT,
Nfa_tplog.NFATPLOG_NOME, Nfa_bairro.NFABAIR_NOME,
Nfa_cidades.NFACID_NOME, Nfa_orgarrec.ORGARC_NOME
FROM NFA_NOTA Nfa_nota
INNER JOIN NFA_ITEMNOTA Nfa_itemnota
ON (Nfa_nota.NOTA_NUMERO = Nfa_itemnota.NOTA_NUMERO)
AND (Nfa_nota.NOTA_DATA = Nfa_itemnota.NOTA_DATA)
INNER JOIN NFA_EMPRESA Nfa_empresa
ON (Nfa_empresa.EMP_COD = Nfa_nota.NOTA_CODEMP)
INNER JOIN NFA_PRESTSERV Nfa_prestserv
ON (Nfa_prestserv.PSERV_COD = Nfa_nota.NOTA_CODPSERV)
INNER JOIN NFA_ORGARREC Nfa_orgarrec
ON (Nfa_orgarrec.ORGARC_COD = Nfa_nota.NOTA_ORGARREC)
INNER JOIN NFA_TPLOG Nfa_tplog
ON (Nfa_tplog.NFATPLOG_COD = Nfa_prestserv.PSERV_LOG)
INNER JOIN NFA_BAIRRO Nfa_bairro
ON (Nfa_bairro.NFABAIR_COD = Nfa_prestserv.PSERV_BAIRRO)
INNER JOIN NFA_CIDADES Nfa_cidades
ON (Nfa_cidades.NFACID_COD = Nfa_prestserv.PSERV_CIDADE)
end
===========================================
da erro no ´end´ :?
Duarteol
Curtidas 0
Respostas
Paulo_amorim
16/06/2004
Olá
Que banco é?
Tente colocar
Espero que ajude
Até+
Que banco é?
Tente colocar
end PROC_IMP_NOTAFISCAL;
Espero que ajude
Até+
GOSTEI 0
Omar Cury
16/06/2004
desscreva o erro
GOSTEI 0
Duarteol
16/06/2004
Invalid token.
SQL error code = -104.
Token unknown - line 34, char 1.
end.
SQL error code = -104.
Token unknown - line 34, char 1.
end.
GOSTEI 0
Emerson Nascimento
16/06/2004
que banco vc está utilizando?
GOSTEI 0
Duarteol
16/06/2004
firebird
GOSTEI 0
Emerson Nascimento
16/06/2004
tente assim:
CREATE PROCEDURE PROC_IMP_NOTAFISCAL(CONTROLE_DATA DATE, CONTROLE_NUMERO INTEGER)
AS
begin
    SELECT Nfa_nota.NOTA_NUMERO, Nfa_nota.NOTA_DATA, Nfa_nota.NOTA_DTORGARREC,
        Nfa_nota.NOTA_ALIQT, Nfa_itemnota.ITEM_QTDE, Nfa_itemnota.ITEM_UNIDADE,
        Nfa_itemnota.ITEM_DISCRIM, Nfa_itemnota.ITEM_VALUNIT, Nfa_empresa.EMP_NOME,
        Nfa_empresa.EMP_LOG, Nfa_empresa.EMP_ENDE, Nfa_empresa.EMP_BAIRRO,
        Nfa_empresa.EMP_NUME, Nfa_empresa.EMP_INSCMUN, Nfa_empresa.EMP_CPF,
        Nfa_empresa.EMP_CNPJ, Nfa_empresa.EMP_CIDADE, Nfa_empresa.EMP_UF,
        Nfa_empresa.EMP_TELCONT, Nfa_prestserv.PSERV_NOME,
        Nfa_prestserv.PSERV_ENDE, Nfa_prestserv.PSERV_NUME,
        Nfa_prestserv.PSERV_INSCMUN, Nfa_prestserv.PSERV_CPF,
        Nfa_prestserv.PSERV_CNPJ, Nfa_prestserv.PSERV_UF,
        Nfa_prestserv.PSERV_TELCONT, Nfa_prestserv.PSERV_NIT,
        Nfa_tplog.NFATPLOG_NOME, Nfa_bairro.NFABAIR_NOME,
        Nfa_cidades.NFACID_NOME, Nfa_orgarrec.ORGARC_NOME
    FROM NFA_NOTA Nfa_nota
    INNER JOIN NFA_ITEMNOTA ON (Nfa_itemnota.NOTA_NUMERO = Nfa_nota.NOTA_NUMERO)
        AND (Nfa_nota.NOTA_DATA = Nfa_itemnota.NOTA_DATA)
    INNER JOIN NFA_EMPRESA ON (Nfa_empresa.EMP_COD = Nfa_nota.NOTA_CODEMP)
    INNER JOIN NFA_PRESTSERV ON (Nfa_prestserv.PSERV_COD = Nfa_nota.NOTA_CODPSERV)
    INNER JOIN NFA_ORGARREC ON (Nfa_orgarrec.ORGARC_COD = Nfa_nota.NOTA_ORGARREC)
    INNER JOIN NFA_TPLOG ON (Nfa_tplog.NFATPLOG_COD = Nfa_prestserv.PSERV_LOG)
    INNER JOIN NFA_BAIRRO ON (Nfa_bairro.NFABAIR_COD = Nfa_prestserv.PSERV_BAIRRO)
    INNER JOIN NFA_CIDADES ON (Nfa_cidades.NFACID_COD = Nfa_prestserv.PSERV_CIDADE);
    suspend; // pra retornar os dados
end
CREATE PROCEDURE PROC_IMP_NOTAFISCAL(CONTROLE_DATA DATE, CONTROLE_NUMERO INTEGER)
AS
begin
    SELECT Nfa_nota.NOTA_NUMERO, Nfa_nota.NOTA_DATA, Nfa_nota.NOTA_DTORGARREC,
        Nfa_nota.NOTA_ALIQT, Nfa_itemnota.ITEM_QTDE, Nfa_itemnota.ITEM_UNIDADE,
        Nfa_itemnota.ITEM_DISCRIM, Nfa_itemnota.ITEM_VALUNIT, Nfa_empresa.EMP_NOME,
        Nfa_empresa.EMP_LOG, Nfa_empresa.EMP_ENDE, Nfa_empresa.EMP_BAIRRO,
        Nfa_empresa.EMP_NUME, Nfa_empresa.EMP_INSCMUN, Nfa_empresa.EMP_CPF,
        Nfa_empresa.EMP_CNPJ, Nfa_empresa.EMP_CIDADE, Nfa_empresa.EMP_UF,
        Nfa_empresa.EMP_TELCONT, Nfa_prestserv.PSERV_NOME,
        Nfa_prestserv.PSERV_ENDE, Nfa_prestserv.PSERV_NUME,
        Nfa_prestserv.PSERV_INSCMUN, Nfa_prestserv.PSERV_CPF,
        Nfa_prestserv.PSERV_CNPJ, Nfa_prestserv.PSERV_UF,
        Nfa_prestserv.PSERV_TELCONT, Nfa_prestserv.PSERV_NIT,
        Nfa_tplog.NFATPLOG_NOME, Nfa_bairro.NFABAIR_NOME,
        Nfa_cidades.NFACID_NOME, Nfa_orgarrec.ORGARC_NOME
    FROM NFA_NOTA Nfa_nota
    INNER JOIN NFA_ITEMNOTA ON (Nfa_itemnota.NOTA_NUMERO = Nfa_nota.NOTA_NUMERO)
        AND (Nfa_nota.NOTA_DATA = Nfa_itemnota.NOTA_DATA)
    INNER JOIN NFA_EMPRESA ON (Nfa_empresa.EMP_COD = Nfa_nota.NOTA_CODEMP)
    INNER JOIN NFA_PRESTSERV ON (Nfa_prestserv.PSERV_COD = Nfa_nota.NOTA_CODPSERV)
    INNER JOIN NFA_ORGARREC ON (Nfa_orgarrec.ORGARC_COD = Nfa_nota.NOTA_ORGARREC)
    INNER JOIN NFA_TPLOG ON (Nfa_tplog.NFATPLOG_COD = Nfa_prestserv.PSERV_LOG)
    INNER JOIN NFA_BAIRRO ON (Nfa_bairro.NFABAIR_COD = Nfa_prestserv.PSERV_BAIRRO)
    INNER JOIN NFA_CIDADES ON (Nfa_cidades.NFACID_COD = Nfa_prestserv.PSERV_CIDADE);
    suspend; // pra retornar os dados
end
GOSTEI 0