PC Review


Reply
Thread Tools Rate Thread

Calling Oracle Functions

 
 
Steve
Guest
Posts: n/a
 
      14th Aug 2003
Hi,
I am using the .NET Framework data provider for Oracle
and can't get anything to work when using Oracle
Functions. Couple of quesitons: 1) Do I have to declare
the output as REF CURSOR? If I don't then the error says
there is no store proc with this name? If I do, then I
always get the same error about "invalid argument or type
for input params..".

ANY HELP??


FUNCTION customer_details(dealer_id_in config.ids)
RETURN config.GenRfcTyp
IS
v_rfc config.GenRfcTyp;
BEGIN
OPEN v_rfc FOR
SELECT DISTINCT customer_id uc_id,
customer.name(customer_id)
customer_name
FROM dealer_customers
WHERE dealer_id = dealer_id_in
ORDER BY customer_name;
RETURN v_rfc;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN v_rfc;
END customer_details;
 
Reply With Quote
 
 
 
 
David Browne
Guest
Posts: n/a
 
      14th Aug 2003

"Steve" <(E-Mail Removed)> wrote in message
news:027e01c36282$309c3540$(E-Mail Removed)...
> Hi,
> I am using the .NET Framework data provider for Oracle
> and can't get anything to work when using Oracle
> Functions. Couple of quesitons: 1) Do I have to declare
> the output as REF CURSOR? If I don't then the error says
> there is no store proc with this name? If I do, then I
> always get the same error about "invalid argument or type
> for input params..".
>
> ANY HELP??


try using commandType.Text and CommandText of

"begin :rc := customer_details(:dealer_id); end;"

and bind an output ref cursor and an input parameter of whatever.

The basic idea for troubleshooting this stuff is to push it down in to
PL\SQL and then add back bind variables slowly.


You might even start with

declare
v_rfc config.GenRfcTyp;
begin v_rfc := customer_details(4);
end;

or

declare
type GenRfcTyp is REF CURSOR;
v_rfc GenRfcTyp;
begin
v_rfc := customer_details(5);
end;



David


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Oracle OCI from C# Kevin Microsoft C# .NET 2 26th Jul 2007 10:50 AM
Converting Oracle SQL functions to Access built-in functions GVR_Mike Microsoft Access 3 30th Jun 2006 12:33 AM
Calling Oracle Stored Functions from vb.net rishaan Microsoft ADO .NET 2 17th Dec 2004 06:59 PM
Calling Oracle Functions =?Utf-8?B?U3RldmU=?= Microsoft ADO .NET 1 13th Mar 2004 07:02 PM
Calling Oracle date functions via ODBC and .NET Richard Morse Microsoft ADO .NET 1 20th Feb 2004 03:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:21 PM.