Nelson, Erik - 2
Sat, 16 Dec 2017 11:54:06
For unfortunate reasons, I need a query that does an insert and also
least one row... for example, something along the lines of
Select 1 as value from (insert into table1 values(a, b, c))
Select coalesce((insert into table1 values(a, b, c)), 1) as value
I've tried a number of options but haven't been able to get anything to
Is it possible?
No. Data and schema modification operations return no data from the DB.
(Data modification operations return a count of affected rows, but even
that is not available as part of a query.)
What you probably want is to use a transaction. That's a guess because
you have not explained your real problem -- only how you imagine you might
solve it. You'll get better help, and viable alternatives, if you explain
what you are trying to do.