PLS-00103遇到符号“>".执行存储过程时出错 [英] PLS-00103 Encountered symbol ">" error while executing stored prcedure
问题描述
我有下面的存储过程,当我尝试执行时会抛出错误.所有的事情都是正确的,但不知道为什么会引发此错误.有人可以帮我解决这个问题吗?
I am having below stored procedure, when I try to execute it throws error. All the things are proper but don't know why this error it throws. can anybody help me to sort out this.
create or replace PROCEDURE FR_Notes_Mng (
P_STR_ID IN VARCHAR2,
p_Ref_no in VARCHAR2,
P_UserId in VARCHAR2,
P_Note IN VARCHAR2,
P_datestamp IN VARCHAR2,
p_Request_ID in varchar2,
p_WrittenDate IN VARCHAR2
) AS
numSqlCode Number := 0;
RecCounter Number :=0;
strTable varchar2(30) := 'FR_Notes';
strAction varchar2(30) := 'Insert';
vSQLERM VARCHAR2(200) :=SUBSTR(SQLERRM, 1, 85);
BEGIN
Select Count(*) into RecCounter From FR_Notes where str_id=P_str_ID and ref_no=P_Ref_No and user_id=P_UserId and notes=P_note and datestamp=P_Datestamp and to_date(writtendate,'YYYYMMDDHH24MISS')=to_Date(p_WrittenDate,'YYYYMMDDHH24MISS') and request_id=p_request_id;
If RecCounter=0 then
insert into Fr_Notes Values
(p_str_ID,p_ref_no,p_UserId,P_note,p_Datestamp,to_date(p_WrittenDate,'YYYYMMDDHH24MISS'),p_Request_ID,'FR',sysdate);
commit;
end if;
EXCEPTION
WHEN OTHERS THEN
numSqlCode := SQLCODE;
INSERT INTO FR_UNEXPECTED_ERRORS (TABLE_NAME, KEY, ACTION, ERR_CODE)
VALUES (strTable, vSQLERM, strAction, numSqlCode);
END;
引发错误:
ORA-06550:第1行,第47列:PLS-00103:在预期以下情况之一时遇到了符号>". (),* @%& =-+< />在in是 模余数不是rem<>或!=或〜=> =< =<> 或||之间的like2 like4 likec多集成员submultiset
ORA-06550: line 1, column 47: PLS-00103: Encountered the symbol ">" when expecting one of the following: . ( ) , * @ % & = - + < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
当我在数据库级别执行它时,它可以正确执行,但在vbscript代码中失败.以下是我用来执行且引发此错误的vb脚本代码
When I execute it at database level its executed properly but failed in vbscript code. Below is the vb-script code I used to execute and which is throwing this error
function InsertNotes(str_id,ref_no,userId,Note,strdatestamp,writtenDates)
Dim strcon2: set strcon2=server.CreateObject("ADODB.Connection")
Dim sql2
Dim strcmd2
strcon2.open "Provider=MSDAORA;Data Source="&Application("DBDsn")&";User Id="&Application("DBUserName")&"; Password="&Application("DBPassword")&";"
sql2 = "rep2.FR_Notes_Mng"
Set strcmd2 = Server.CreateObject("ADODB.Command")
Set strcmd2.ActiveConnection = strCOn2
strcmd2.CommandText = sql2
strcmd2.CommandType = 4
strcmd2.Parameters.Append strcmd2.CreateParameter("p_str_id", 200,1,50,str_id)
strcmd2.Parameters.Append strcmd2.CreateParameter("p_ref_no", 200,1,50,ref_no)
strcmd2.Parameters.Append strcmd2.CreateParameter("p_UserId", 200,1,50,userId)
strcmd2.Parameters.Append strcmd2.CreateParameter("p_note", 200,1,200,Note)
strcmd2.Parameters.Append strcmd2.CreateParameter("p_Datestamp", 200,1,50,strdatestamp)
strcmd2.Parameters.Append strcmd2.CreateParameter("p_Request_id", 200,1,50,"012")
strcmd2.Parameters.Append strcmd2.CreateParameter("p_WrittenDate", 200,1,50,writtenDates)
strcmd2.Execute
end function
推荐答案
实际上,我已经检查了在VB脚本调用中将哪些值传递给该存储过程,并发现未传递str_id的值,因此该过程正在执行失败并抛出错误.
Actually I have checked what values are getting passed in VB script call to that stored procedure and found that value for str_id is not getting passed hence the procedure execution was getting failed and throwing above error.
ORA-06550:第1行,第47列:PLS-00103:在预期以下情况之一时遇到了符号>". (),* @%& =-+< />在in是 模余数不是rem<>或!=或〜=> =< =<> 和|或||之间的like2 like4 likec多集成员submultiset
ORA-06550: line 1, column 47: PLS-00103: Encountered the symbol ">" when expecting one of the following: . ( ) , * @ % & = - + < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
我已经为str_id变量分配了一个值,并通过执行代码进行了重新检查,并且它可以正常工作.
I have assigned one value to str_id variable and rechecked by executing the code and it worked properly.
我从此错误中了解到的一件事是,当我们不传递必需的参数值或将参数传递为null时,即使强制生成该类型的错误的时间也是如此.
One thing I came to know here by this error which is, when we don't pass required parameter value or we pass the parameter as null even if it is mandatory that time this type of error get generated.
感谢所有帮助我解决这个问题的人.
Thanks for all who helped me over this ask.
这篇关于PLS-00103遇到符号“>".执行存储过程时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!