sql - Procedure Syntax Issue -
pretty new pl/sql apologies in advance. concerned syntax procedure have made - using oracle sql devloper
here tables:
sale_head table - http://imgur.com/yufjyto
customer table - http://imgur.com/ulxzplc
create or replace procedure test2 ( x in integer ) begin select ((count(sale_num))/4) sale_head inner join customer using(customer_id) status = 's' , sale_date >= (add_months(sysdate, -12)) , customer_id= x; end; / execute test2(81);
syntax follows:
error(6,1): pl/sql: sql statement ignored error(6,8): pl/sql: ora-00936: missing expression
the syntax of select statement incorrect. clause used indicate variable receive result of select. try following:
create or replace procedure test2(x in integer) nvalue number; begin select ((count(sale_num))/4) nvalue sale_head inner join customer using(customer_id) status = 's' , sale_date >= (add_months(sysdate, -12)) , customer_id = x; end;
share , enjoy.
Comments
Post a Comment