2
I have a loop that scans a table, I need each row a variable type string be incremented with the respective records.
Use FDQuery
and FDConnection
.
Follow an idea of what I need
var linhas : string;
while not eof do
begin
linhas := linhas + FieldByName('nome').AsString + ', ';
end;
Result I need:
Mary, Mark, Ezekiel, ...
Can you make this concatenation using a list or vector? And from a function that returns random names?
– Jefferson Quesado
@Jeffersonquesado I have no idea how to make a list or a vector. Using a Dbgrid it lists right. I need the "NAME" field of the table only. In PHP it was easier :(
– Ezequiel Tavares
You have several moving pieces here: string concatenation, talking to the bank, determining the end of the loop (maybe something else I can’t see). In these situations, try to isolate your problem. I am trying to suggest that you test in a more controlled environment. Try to go to the moving part that is not fitting. You’ve assumed you don’t know vectors in programming, so I strongly suggest studying more basic subjects before venturing into database information retrieval.
– Jefferson Quesado
@Jeffersonquesado as I mentioned the result of the consultation I made the impasse is in the increment of the variable to each line that the loop travels. For the sake of understanding, the only thing I’m not succeeding at is concatenation. Regarding not knowing vectors only in Delphi I am not familiar. thank you
– Ezequiel Tavares
Make this clear in the text of the question then ;-)
– Jefferson Quesado
@Jeffersonquesado thanks for trying to help. I believe the focus of the problem is well explained.
– Ezequiel Tavares