Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
208 views
in Technique[技术] by (71.8m points)

oracle - 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;

Error Thrown:

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

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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: 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

I have assigned one value to str_id variable and rechecked by executing the code and it worked properly.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...