aspose file tools*
The moose likes JDBC and the fly likes pl/sql error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "pl/sql error" Watch "pl/sql error" New topic
Author

pl/sql error

Masood Khan
Greenhorn

Joined: Nov 24, 2005
Posts: 4
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
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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 ]
Naveen Mishra
Ranch Hand

Joined: Nov 20, 2005
Posts: 75
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 !!!
 
 
subject: pl/sql error