Oracle select inside an IF statement in a stored procedure -


coming sql server background, trying grasp of oracle syntax. trying return records stored procedure getting error:

create or replace procedure sp_getcustomers(username in varchar2)  begin      if username = 'all'         select *         customers c;     else         select *         customers c         c.created_by = username;     end if;  end; 

what missing?

you missing clause, @ stage better use function return values , procedure perform action.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -