0
I am trying to display the contents of the Postgressql database with the employee call table, using the Botton and Bdgrid components of Delphi to display, I entered the commands like this:
untDMPrincipal.DMPrincipal.UniQuery2.Close;
untDmPrincipal.DMPrincipal.UniQuery2.SQL.Add('Select * from funcionarios');
untDmPrincipal.DMPrincipal.UniQuery2.Open;
Data is normally displayed whenever I press the Botton, but when I click a second time on the "Show Data" button Delphi reports an error:
Sintax error at or near "Select"
the Add method must be called every click, causing the query to be
'Select * from funcionariosSelect * from funcionarios'
in the second... and successively... you have to add only once, or clear before adding to each click– Rovann Linhalis
If you put a
;
at the end of the commandSELECT
it will not give error but will repeat the display as many times as are the clicks.– anonimo
There is no way to do so: "untDmPrincipal.DMPrincipal.Uniquery2.SQL.Text := 'Select * from employees';"
– GabrielLocalhost
Ai instead of adding the string he subscribes it
– GabrielLocalhost
Put the ; Solved
– ShomeKing