Release Automation

Expand all | Collapse all

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

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

    Posted Dec 18, 2013 04:41 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;


  • 2.  RE: Nolio KB: How do I use select and update  in a single action while runn

    Posted Dec 18, 2013 04:42 PM

    Can I use the same for Oracle and MySQL query?