Connecting Tech Pros Worldwide Help | Site Map

Create Procedure Oracle Errors

Member
 
Join Date: Feb 2009
Location: Jersey
Posts: 35
#1: Jun 10 '09
Hello

I have 2 errors on the following procedure and none of the posts on Bytes or websites I have researched (e.g.: This One seem to be able to help me resolve them.

Error (1): SQL Statement ignored
Error (2): ORA-00907: missing right parenthesis

The errors are marked (1) and (2) where they appear in the code.

Expand|Select|Wrap|Line Numbers
  1. create or replace
  2. PROCEDURE SP_SELECTCATS (
  3.   "SearchItem" IN VARCHAR2,
  4.   "SearchCriteria" IN VARCHAR2,
  5.   "RESULTS" OUT SYS_REFCURSOR) AS
  6. BEGIN
  7.   OPEN RESULTS FOR
  8.   SELECT corporateactionnumber, (1)
  9.   sedolnumber,
  10.   isincode,
  11.   stockname,
  12.   corporateactiontype,
  13.   to_date(a.receiveddate, 'dd/mm/yyyy')
  14. FROM 
  15.  tblcorporateactions
  16. WHERE "SearchItem" = "SearchCriteria"
  17.  (
  18.     ("SearchItem" = 'CorporateActionNumber' AND a.corporateactionnumber = "SearchCriteria") (2)
  19.  );
  20.  
  21. END SP_SELECTCATS;
It may be something simple, but I don't understand what is causing the errors.

Many thanks
Matt
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 290
#2: Jun 28 '09

re: Create Procedure Oracle Errors


I'm just beggining int oracle but what do you thik does it mean
Expand|Select|Wrap|Line Numbers
  1.  WHERE "SearchItem" = "SearchCriteria"
  2.   (
  3.      ("SearchItem" = 'CorporateActionNumber' AND a.corporateactionnumber = "SearchCriteria")
  4.   );
  5.  
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#3: Jun 29 '09

re: Create Procedure Oracle Errors


Try this:

I have changed the code in oracle syntax. I would suggest you to let us know your exact requirement so that we can help better:

Expand|Select|Wrap|Line Numbers
  1. create or replace 
  2. PROCEDURE SP_SELECTCATS ( 
  3.   "SearchItem" IN VARCHAR2, 
  4.   "SearchCriteria" IN VARCHAR2, 
  5.   "RESULTS" OUT SYS_REFCURSOR) AS 
  6. BEGIN 
  7. IF ("SearchItem" = "SearchCriteria") THEN
  8.   OPEN RESULTS FOR 
  9.   SELECT corporateactionnumber,
  10.   sedolnumber, 
  11.   isincode, 
  12.   stockname, 
  13.   corporateactiontype, 
  14.   to_date(a.receiveddate, 'dd/mm/yyyy') 
  15. FROM  
  16.  tblcorporateactions a
  17. WHERE a.corporateactionnumber = "SearchItem"
  18. AND a.corporateactionnumber = "SearchCriteria";   
  19. END IF;
  20. END SP_SELECTCATS; 
  21.  
Reply