Release Automation

Nolio KB: How do I use select and update  in a single action while running 

Jul 08, 2014 05:01 PM

Nolio Official KB: How do I use select and update  in a single action while running a SQL query in Nolio?

In order to use both an Select query and update in a Nolio SQL query Script, you need to have as your first line SET NOCOUNT ON . This will allow you to process the update and the receive the outputs from the select query. Otherwise the script may update the Database but return an empty resultset.
Example:
set nocount on;
begin tran;
Update S
Set Last = 1
From [dbo].[nolio] S
Where First in  (Select Top 1 First
From dbo.nolio NL
WHERE NL.ID = 0);
select * from [dbo].[nolio]
commit;

 

Can I use the same for Oracle and MySQL query?

 

This document was generated from the following discussion: Nolio KB: How do I use select and update  in a single action while running

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.