HexecuteSqlQuery
// If it's a new record
IF cadastro_geral..NewRecord = True THEN
nProximo_codigo is numeric
nGnNumeroconexao is int = SQLConnect("localhost","postgres","matos","matos","PostgreSQL")
ds is Data Source
sQuery is string = [
SELECT Max(id_cadastro_geral) FROM cadastro_geral
]
SQLExec(sQuery,ds)
WHILE SQLFetch(ds) = 0
nProximo_codigo=SQLGetCol(ds,1)
END
nProximo_// Read the information entered
ScreenToFile()
codigo++
cadastro_geral.id_cadastro_geral=nProximo_codigo
HAdd(cadastro_geral)
ELSE
// Modify it
HModify(cadastro_geral)
END
// Return value of the window
MyWindow..ReturnedValue = True