Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using of functions in SQL (Oracle)

Status
Not open for further replies.

jabond007

Programmer
Jun 21, 2000
39
US
Hello,

I am tring to execute a SQL in Visual basic which has the following format

Select order_no,order_amount,executed_amount from tab1,tab2 where order=x
and f_status(order_no,order_item_no) ='OPEN';

f_status(order_no,order_item_no) is a stored function which calculates the balance on the order and returns 'OPEN' if order is not fully executed.

the above SQL is passed as a string. But when i execute i get an error. Cant i use a SQL function in the where clause?

Can sombody tell me why the error. Is there any other way to do it. I need the function to a part of the SQL.

Thanks
 
What is the error??

The problem may be in the where clause, but not because of the function call.
When you put "where order=x" does the field order exist?? Should this be order_no??
Also, what is the x?? Is this the order number you are interested in (I presume that is the case)?? And how are you putting this into the sql statement??

Simon
 
thanks william,

I found the problem....the SQL is working now. The function parameters had to be table.field name....

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top