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

r - how do you merge two data frames the best way? -

How to debug "expected android.widget.TextView but found java.lang.string" in Android? -

php - mySQL problems with this code? -