MySQL错误pls-00103

时间:2014-11-26 12:24:42

标签: mysql

我正在制作一个MySQL并收到错误我不知道如何修复它。该函数应该做的是询问用户输入,这个输入应该存储在相应的变量中并返回一个变量。但是当我尝试运行该函数时,我在存储变量的行上出现错误。我对mySQL很新,所以我可能会做一些愚蠢的事情。任何帮助都会非常感谢你

这是mysql函数

create or replace FUNCTION AD_AGENCY_INFO(agency_id in agency_id%type)
RETURN agency_id

DECLARE

  v_no_of_runs AD_AGENCY.NO_OF_AD_RUNS%TYPE = '&enter_number_of_Runs';
  v_credit_worthy AD_AGENCY.CREDIT_WORTHY%TYPE = '&enter_credit_worthy';
  v_available_slots AD_AGENCY.AVAILABLE_SLOTS%TYPE = '&enter_available_slots';
  v_status AD_AGENCY.STATUS%TYPE = '&enter_status';

BEGIN

  insert into ad_agency values (agency_id, v_no_of_runs, v_credit_worthy,v_available_slots, v_status);
  insert into ad (agency_id) values (agency_id);

 commit;

RETURN (agency_id));
 END AD_AGENCY_INFO;

我得到的错误如下,对于第7,8,9行

是相同的
Error(6,45): PLS-00103: Encountered the symbol "=" when expecting one of the following:     := ( ; not null range default character The symbol ":= was inserted before "=" to continue. 

1 个答案:

答案 0 :(得分:0)

尝试将声明语句更改为

v_no_of_runs AD_AGENCY.NO_OF_AD_RUNS%TYPE := '&enter_number_of_Runs'