Exemplo
Procedure Existdatabase(TOKEN, CNPJ)
ok is boolean = False
Resultado, Msg is string = ""
IF TOKEN = GloToken AND CNPJ <> "" AND Length(CNPJ) = 14 AND IsNumeric(CNPJ) = True
OkConn is boolean = HConnectionOpen(ConnModel)
IF OkConn = True THEN
SQL_Exec is string = [
sp_roteiroinicial01_existdatabase '@CNPJ@'
]
SQL_Exec = Replace(SQL_Exec,"@CNPJ@",CNPJ,IgnoreCase+WholeWord) //Instrucao SQL
QryAdriano is Data Source
ok = HExecuteSQLQuery(QryAdriano, ConnModel,hQueryWithoutCorrection, SQL_Exec) // <---Obrigatorio ter hQueryWithoutCorrection
Resultado = ErrorInfo() + " " + HErrorInfo()
IF ok = True THEN
// Read the first record of the query
HReadFirst(QryAdriano)
WHILE NOT HOut()
// Process on the query record
Msg = QryAdriano.Existe
// Read the next record
HReadNext()
END
HFreeQuery(QryAdriano)
END
ELSE
Msg = "Erro de conexão com o servidor"
END
ELSE
Msg = "Token errado ou CNPJ errado"
END
RESULT (Msg)
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/Message modifié, 03 février 2017 - 10:45