There is a stored procedure that firstly returns the result of a sample of data , and secondly it updates the fields .
There are two kinds of internal procedure calls and both are not suitable:

1) A selective call (via “select”), which in principle allows me to get a sample, but in this case there is no “commit” for “update”.
2) Through “EXECUTE PROCEDURE”, in this case, it will be “commit” for “update”, but instead of sampling there will be only one line ..

  • Is it possible to call the procedure in such a way that both “commit” for “update” and sampling?
  • Or should the procedure be divided into “update” and “sample”?
  • Or from another procedure, call another (for example, divide it into 2 procedures: “sampling” and “update” - thus, call “sampling” from delphi, and “update” from it)? But I wanted to have one procedure.
  • Give the text of the stored procedure and tell which components you are using. Then I will write to you how to cause through select - because it is necessary to cause just through select. - user308670 7:43 pm

3 answers 3

  1. Explicitly start a transaction, and not read only.
  2. Execute SELECT with reading all records to the client.
  3. Explicitly commit.

Details depend on the components you use.

  • one
    Commit does not immediately help. You must first all the records prophet. And then the commit. - user308670 7:44 pm
  • Prefet all the records can and DataSet itself, without additional action by the programmer, but it really needs to be borne in mind. - German Borisov
  • one
    As a rule, not all records, but a buffer are fetched in access components, so if you do not force fetchAll or while not query.eof do query.next, there will be a floating error. While the records are few, everything is OK, and if it returns more than it is placed in the buffer, the procedure for them will simply not be performed. You need to know what components are used, but the author does not say. - user308670 pm
  • Corrected the answer. - German Borisov

Not, I used another way, the function "list".
The fact is that I have this parameter can be made of the type "string", so you can output the entire result in one line separated by commas:

select list (DEVICE_ID, ',') from ...

but thanks for the answer.

    Use a selective procedure and do not worry. Your assumptions that 'no' can be wrong. The main thing to remember is to call fetch for each return value. More precisely, I would tell you if you indicated the components used.