2 Replies Latest reply: Oct 29, 2012 10:33 PM by 970843 RSS

    How to write procedure with multiple queries

    970843
      Hi,

      Table1
      1.Id
      2.Count

      I want to write a procedure to find 'Count' in the table with 'Id' as key.After getting 'count' i have to increment it and update back in the table for that 'Id', how can i handle this with procedure.Help me with solution.


      I want a simple procedure like below, BUT ITS NOT EXECUTING.IT SAYS PROCEDURE SUCCESSFUL WITH COMPILATION ERRORS.Help me out.

      create or replace PROCEDURE newpro( inId IN NUMBER, outcount OUT NUMBER) is
      select COUNT into outcount from Table1 WHERE ID= inId ;
      BEGIN
      outcount := outcount +1;
      update Table1 set COUNT = outcount WHERE ID = inId ;
      END;

      Edited by: im_asa on Oct 29, 2012 4:59 AM