Forum > Databases

How to add records to a TSQLQuery without inserting them in the database

(1/1)

Jvan:
Is it possible?

lucamar:
In theory yes: as long as you don't commit the transaction they should be kept just in the (updated) query dataset, waiting to be committed to the database.

However you should test it thoroughly, just in case ...

Jvan:

--- Quote from: lucamar on May 29, 2021, 12:51:16 am ---In theory yes: as long as you don't commit the transaction they should be kept just in the (updated) query dataset, waiting to be committed to the database.

However you should test it thoroughly, just in case ...

--- End quote ---


An example, please.

lucamar:

--- Quote from: Jvan on May 29, 2021, 12:58:06 am ---An example, please.
--- End quote ---

You'll have to wait till tomorrow; I'm off to bed (it's 1 a.m. here ;)).

Or you could try yourself; the normal flow when adding/deleting/modifying a record is:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---SQLQuery.Update;SQLTransaction.Commit;
Just leave out the "SQLTransaction.Commit" and the SQLQuery should update itself but not reflect the changes to the database.

Note, though, that I've never tried anything like this, so I might be completely wrong ... :-[

Navigation

[0] Message Index

Go to full version