Forums Register Login

pl/sql error

+Pie Number of slices to send: Send
here is my code ........
create or replace function supplier_total_charges(supnum IN OUT
supplies.s_num%type) return REAL IS
sump real;

BEGIN
select sum(ch_price * quantity) INTO sump
from supplier s,charges where supnum= s_num and p_num =
ch_p_num and s_num = ch_s_num;

return sump;
exception
when NO_DATA_FOUND then
DBMS_OUTPUT.PUT_LINE('Select did not return a tuple');
return 0;
end supplier_total_charges;
/

plz tell me wht stupid mistake am i make over here that i m getting this error give below ..thanks plz help me i m stuck over here ...

Errors for FUNCTION SUPPLIER_TOTAL_CHARGES:

LINE/COL ERROR
-------- -----------------------------------------------------------------
6/1 PL/SQL: SQL Statement ignored
7/60 PL/SQL: ORA-00904: "P_NUM": invalid identifier
masoodzia@hotmail.com
+Pie Number of slices to send: Send
Welcome to the Javaranch.

Try to use table aliases with the column names in your where condition.
[ November 24, 2005: Message edited by: Adeel Ansari ]
+Pie Number of slices to send: Send
Hi Masood ,
it seems to me that P_NUM is neither any attribute nor defined var in the block.
confirm this thing and have a check.

it should solve the prob.

No doubt, using table-alias will make it clear - to - understand ur code ( courtesy Adeel bhai ).

Cheers !!!
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1393 times.
Similar Threads
function call within a procedure error !!
PL/SQL PLS-00905 Object is invalid error
error in Oracle function
Execute pl/sql function which is having bind variables in java
pl/sql error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:34:42.