Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

PLS-00103: Encountered the symbol "DECLARE" when expecting one of the funct

846859Mar 12 2011 — edited Mar 12 2011
hi ,

i am getting error at line 9 ,when iam creating this function in oracle

**error cd: 9 1 PLS-00103: Encountered the symbol "DECLARE" when expecting one of the following:**

**begin function package pragma procedure subtype type use**
**<an identifier> <a double-quoted delimited-identifier> form**
**current cursor**

please help me in solving this .


CREATE OR REPLACE FUNCTION "SHWOWNER"."GET_COM_CURR_RATE"
(
V_date_Key INT,
V_sourceCurrKey INT,
V_targetCurrCD varchar2
)
RETURN FLOAT
IS CURR_RATE FLOAT;
DECLARE
CURR_RATE FLOAT;
BEGIN
SELECT CF.CONV_RATE
FROM
SHWOWNER.CURRENCY_FACT CF JOIN SHWOWNER.CRNCY_BGN_DT CBT ON CF.CRNCY_BGN_DT_KEY = CBT.CRNCY_BGN_DT_KEY
JOIN SHWOWNER.CRNCY_END_DT CET ON CF.CRNCY_END_DT_KEY = CET.CRNCY_END_DT_KEY
JOIN SHWOWNER.CURRENCY TGT_CR ON TGT_CR.CRNCY_KEY = CF.TARGET_CRNCY_KEY
WHERE CF.SOURCE_CRNCY_KEY = V_sourceCurrKey
AND TGT_CR.CRNCY_SYBL_CD = V_targetCurrCD
AND (COALESCE((SELECT WD.DATE_VALUE FROM STGOWNER.WARRANTY_DATE WD WHERE WD.DATE_KEY =V_date_Key ),SYSDATE) BETWEEN CBT.CRNCY_BGN_DT_VALUE AND CET.CRNCY_END_DT_VALUE);
CURR_RATE:=CF.CONV_RATE ;
RETURN CURR_RATE;
END;



thanks ,
rajesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 9 2011
Added on Mar 12 2011
2 comments
285 views