0
votes

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
1
Are you sure this is the actual code which generated this error?Tim Biegeleisen
Did the procedure compile without any errors?Jacob
Yes it runs without error when executed at Database level but when I execute it via ADODB code in vb script it throws error like above, Procedure is also compiled without any errorsAudumbar
@Audumbar Try executing the procedure from backend in order to make sure it is foolproof.Jacob
I am still skeptic about the error message. The error message you pasted says encountered the symbol >` but there is no > in anywhere in your code.Utsav

1 Answers

0
votes

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.