Home » SQL & PL/SQL » SQL & PL/SQL » Procedure or Function (Oracle 109, Windows Server / 7)
Procedure or Function [message #638417] Thu, 11 June 2015 06:34 Go to next message
roni_a180
Messages: 45
Registered: October 2007
Member
my db is oracle 10g and nls_lang is 'UTF8'. but problem is when i create a function or procedure with
input parameter no sql error show. but when i compile every time show in is not valid integer.

----****

CREATE OR REPLACE FUNCTION HOUSE_SAL (GROSSSAL NUMBER, workertype varchar2)RETURN NUMBER IS


v_medical number;
v_convance number;
v_fdallow number;

v_basic number:= 0;

v_house_sal number;



BEGIN

v_basic := BASIC_CAL(GROSSSAL,workertype);
v_medical := MEDICAL_SAL(GROSSSAL,workertype);
v_convance := CONVANCE_CAL(GROSSSAL,workertype);
v_fdallow := FOODALLOW_CAL(GROSSSAL,workertype);

v_house_sal:= GROSSSAL - (v_basic + v_medical + v_convance + v_fdallow);

return v_house_sal;


exception
when others then null;

END;
/
  • Attachment: Untitled.jpg
    (Size: 46.67KB, Downloaded 593 times)

[Updated on: Thu, 11 June 2015 06:36]

Report message to a moderator

Re: Procedure or Function [message #638418 is a reply to message #638417] Thu, 11 June 2015 06:48 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>exception
>when others then null;

Above should be removed & NEVER exist anywhere!
Re: Procedure or Function [message #638424 is a reply to message #638417] Thu, 11 June 2015 08:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68617
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Read read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals.
Use SQL*Plus and copy and paste your session, the WHOLE session.
Do not put images for text, just put it inside the text but put it formatted.

Read WHEN OTHERS.

[Updated on: Thu, 11 June 2015 08:01]

Report message to a moderator

Re: Procedure or Function [message #638427 is a reply to message #638424] Thu, 11 June 2015 08:08 Go to previous message
cookiemonster
Messages: 13915
Registered: September 2008
Location: Rainy Manchester
Senior Member
It's not all obvious from the screen shot what's causing the error. The error message isn't an oracle error message so it would appear that it's TOAD itself that's complaining. Have you tried compiling it via sqlplus? (after removing the exception handler as the others have said).
Previous Topic: Difference
Next Topic: Duplicate Data
Goto Forum:
  


Current Time: Mon Mar 18 22:28:54 CDT 2024