Problem with accepting the Ref Cursor in c# program
I am passing an argument as OUT Ref Cursor in a stored procedure. and calling the procedure from my c# program.
I can connect the database successfully but am getting the error on calling the procedure.
I am using the ODBC connection
My procedure's signatures are like:
CREATE OR REPLACE PACKAGE BODY packageName
IS
PROCEDURE GetOutput(returnCursor OUT Sys_RefCursor)
AS
BEGIN
OPEN returnCursor FOR
<<my select statement>>
END GetOutput;
END packageName;
My function call is like:
CString Extract::ExtractScript() const
CString script;
script.Format("{Call %s.%s()}", packageName,GetOutput);
return script;
I can compile the procedure successfully on Toad but while calling the procedure from the C# program it gives following error
Connection Successful
Problem executing SQL {Call packageName.GetOutput()}...
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GetOutput'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Message was edited by:
user653288
Hi Aga,
Thanks for your response.
I figured out the problem.
I was using the ODBC connection which wasnt updated for Oracle 10g.
I have updated that. Now its working fine.
Thanks again
Regards
Similar Messages
-
Problem in opening a ref cursor.
Hi,
I'm getting the following error when i'm trying to open the ref cursor. PL/SQL: ORA-22905: cannot access rows from a non-nested table item
What i'm trying to do is I'm dumping the data into pl/sql table and i want retrieving the by using a ref cursor. Please see the code and help me out.
CREATE OR REPLACE PACKAGE CPS_RECR.pg_pool_status AS
TYPE pool_rec IS RECORD (
status varchar2(50)
,stsno number
,stscode varchar2(5)
,candidatename varchar2(200)
,monyear varchar2(10)
,yyyymm number
,stscnt number
--type rec_sts_tab is table of number ;--index by pls_integer;
type pool_tab IS table of pool_rec index by binary_integer;
type pool_cv is REF CURSOR return pool_rec;
FUNCTION pool_status_query(p_start_date in date,p_end_date in date,p_invitedtopoolbit in number,p_showedForPoolBit in number)
RETURN pool_tab;--pool_cv ;
cursor cur_pool(p_start_date date,p_end_date date,p_invitedtopoolbit number,p_showedForPoolBit number)
is
SELECT distinct to_char(date1,'yyyymm')yearmonth
FROM acs100data a,
acs100_candidate_verification b,
acs100_candidate_pool d
WHERE UPPER (a.basic_email) = UPPER (b.email)
AND (b.candidate_status IN ('FORL', 'FWRT') or BITAND (b.candidate_status_bit, 4 ) > 0
or BITAND (b.candidate_status_bit, 2) > 0)
AND d.pool_id = b.pool_id
AND pool_date BETWEEN p_start_date AND p_end_date
AND is_tentative_date IS NULL ;
cursor cur_name(p_yyyymm varchar2,p_cond number,p_start_date date,p_end_date date)
is
select *
from (select distinct (case
when p_cond = 0 and b.candidate_status = 'FORL'
then (last_name || first_name)
when p_cond = 1 and b.candidate_status = 'FWRT'
then (last_name || first_name)
when p_cond = 2
and bitand (b.candidate_status_bit, p_cond) > 0
then (last_name || first_name)
when p_cond = 4
and bitand (b.candidate_status_bit, p_cond) > 0
then (last_name || first_name)
end
) candidatename
from acs100data a,
acs100_candidate_verification b,
acs100_candidate_pool d
where upper (a.basic_email) = upper (b.email)
and d.pool_id = b.pool_id
and pool_date between p_start_date and p_end_date
and to_char (date1, 'yyyymm') = p_yyyymm
and is_tentative_date is null)
where candidatename is not null;
END pg_pool_status;
CREATE OR REPLACE PACKAGE BODY CPS_RECR.pg_pool_status
AS
FUNCTION pool_status_query (
p_start_date IN DATE,
p_end_date IN DATE,
p_invitedtopoolbit IN NUMBER,
p_showedforpoolbit IN NUMBER
RETURN pool_tab--pool_cv
IS
tab_pool pool_tab;
temp_rf pool_cv;
n_index NUMBER := 1;
--rec_sts_data rec_sts_tab;
n_stscnt NUMBER;
vc_status VARCHAR2 (100);
vc_label varchar2(1000);
vc_name varchar2(100);
BEGIN
tab_pool.DELETE;
vc_label :='Opening Pool cursor';
FOR rec_pool IN cur_pool (p_start_date,
p_end_date,
p_invitedtopoolbit,
p_showedforpoolbit
LOOP
if cur_pool%notfound then
exit;
end if;
vc_label :='Opening p_cond cursor';
FOR p_cond IN 0 .. 3
LOOP
n_stscnt := 0;
vc_status := NULL;
begin
SELECT SUM
(NVL
(COUNT
(CASE
WHEN p_cond = 0
AND b.candidate_status = 'FORL'
THEN (last_name || first_name)
WHEN p_cond = 1
AND b.candidate_status = 'FWRT'
THEN (last_name || first_name)
WHEN p_cond = 2
AND BITAND (b.candidate_status_bit,
p_cond) > 0
THEN (last_name || first_name)
WHEN p_cond = 4
AND BITAND (b.candidate_status_bit,
p_cond) > 0
THEN (last_name || first_name)
END
0
) cnt,
DECODE (p_cond,
0, 'FAILED WRITTEN TEST',
1, 'FAILED **** TEST',
2, 'Invited for Pool',
4, 'Showed up for Pool'
) status
INTO n_stscnt,
vc_status
FROM acs100data a,
acs100_candidate_verification b,
acs100_candidate_pool d
WHERE UPPER (a.basic_email) = UPPER (b.email)
AND d.pool_id = b.pool_id
AND pool_date BETWEEN p_start_date AND p_end_date
AND TO_CHAR (date1, 'yyyymm') = rec_pool.yearmonth
AND is_tentative_date IS NULL
GROUP BY candidate_status,
b.candidate_status_bit,
DECODE (p_cond,
0, 'FAILED WRITTEN TEST',
1, 'FAILED **** TEST',
2, 'Invited for Pool',
4, 'Showed up for Pool'
exception
when no_data_found
then
n_stscnt :=0;
vc_status :=null;
end;
vc_label :='Opening name cursor';
FOR rec_name IN cur_name (rec_pool.yearmonth,
p_cond,
p_start_date,
p_end_date
LOOP
if cur_name%notfound then
exit;
end if;
tab_pool (n_index).yyyymm := rec_pool.yearmonth;
tab_pool (n_index).stscnt := n_stscnt;
tab_pool (n_index).status := vc_status;
tab_pool (n_index).candidatename := rec_name.candidatename;
dbms_output.put_line('tab_pool(n_index).yyyymm : '||tab_pool(n_index).yyyymm);
dbms_output.put_line('tab_pool(n_index).stscnt : '||tab_pool(n_index).stscnt);
dbms_output.put_line('tab_pool(n_index).status : '||tab_pool(n_index).status);
dbms_output.put_line('tab_pool(n_index).candidatename : '||tab_pool(n_index).candidatename);
vc_name :=rec_name.candidatename;
END LOOP;
n_index := n_index + 1;
END LOOP;
END LOOP;
RETURN tab_pool;
exception
when others
then
dbms_output.put_line('error :'||vc_label||'--'|| vc_name);
END;
END pg_pool_status;
---run script
DECLARE
RetVal CPS_RECR.PG_POOL_STATUS.pool_tab;
P_START_DATE DATE;
P_END_DATE DATE;
P_INVITEDTOPOOLBIT NUMBER;
P_SHOWEDFORPOOLBIT NUMBER;
temp_cv CPS_RECR.PG_POOL_STATUS.pool_cv;
BEGIN
P_START_DATE := to_date('09/01/2008','mm/dd/yyyy');
P_END_DATE := to_date('09/30/2008','mm/dd/yyyy');
P_INVITEDTOPOOLBIT := 2;
P_SHOWEDFORPOOLBIT := 4;
open temp_cv for select * from table((CPS_RECR.PG_POOL_STATUS.POOL_STATUS_QUERY ( P_START_DATE, P_END_DATE, P_INVITEDTOPOOLBIT, P_SHOWEDFORPOOLBIT )) );
end loop;
exception
when others
then
dbms_output.put_line(sqlerrm);
END;Satyaki,
It doesn't help me out. I'm worndering one of code sample is working fine. i didn't my current is giving the problem.
FYI, please see the some code i followed.
SQL> Create or replace PACKAGE cv IS
2 type comp_rec is RECORD
3 (deptno number,
4 ename varchar(10),
5 compensation number);
6 type comp_tbl IS table of comp_rec;
7 function get_coll return comp_tbl pipelined;
8 temp_tbl comp_tbl := comp_tbl();
9 type comp_cv is REF CURSOR return comp_rec;
10 end;
11 /
Package created.
SQL> Create or replace PACKAGE body cv IS
2 function get_coll return comp_tbl pipelined
3 is
4 begin
5 for i in 1..temp_tbl.count loop
6 pipe row(temp_tbl(i));
7 end loop;
8 return;
9 end;
10 end;
11 /
Package body created.
SQL> declare
2 temp_cv cv.comp_cv;
3 rc cv.comp_rec;
4 begin
5 cv.temp_tbl.delete;
6 cv.temp_tbl.extend;
7 cv.temp_tbl(1).deptno:=10;
8 cv.temp_tbl(1).ename:='1223';
9 cv.temp_tbl(1).compensation:=10;
10
11 -- erroring out
12 open temp_cv for select * from table(cv.get_coll);
13 fetch temp_cv into rc;
14 dbms_output.put_line('Deptno is ' || rc.deptno);
15 dbms_output.put_line('ename is ' || rc.ename);
16 end;
17 /
Deptno is 10
ename is 1223
PL/SQL procedure successfully completed. -
How to print/store in file the ref cursor in pl/sql block ?
How to print/store in file the ref cursor in pl/sql block ?.
How to print/store in file the ref cursor in pl/sql block ?.You question is quite confusing?
So, i'm providing link in this manner.
For RefCursor,
http://www.oracle-base.com/articles/misc/UsingRefCursorsToReturnRecordsets.php
http://www.oracle.com/technology/oramag/code/tips2003/042003.html
For UTL_FILE,
http://www.morganslibrary.org/reference/utl_file.html
Regards.
Satyaki De.
Updated with new morgan library link.
Edited by: Satyaki_De on Feb 24, 2010 9:03 PM -
I can not do the update , what should I do to fix this error ?
"There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanksHi,
Please refer to the help document below:
Error downloading, installing, or updating Creative Cloud applications
Regards,
Sheena -
Problems with software the update with Nokia 6233
Problems with software the update with Nokia 6233
Hello,
I have so far some-paints tries my software to update.
Each time the update procedure begins, sometime stands then on the telephone “test mode”.
On the computer wars I the reference in the update manager “connection to the telephone broken off” and wants the update to again start.
If I change my profile attitudes since that for example, then after a telephone restart again deleted.
What there can I make?
GreetingsMessage Edited by adisaily on 24-Aug-2007 09:03 AMIt sounds like your 5800 has the earpiece fault that was common with 5800's made before February.
You need to take it to a nokia care point for repair under warranty.
Care points/service centres and repair info:
UK • Europe • Asia-Pacific • USA •
Canada • Middle East and Africa
Elsewhere: Click here, select your country, go to the support section, then select repair. -
when trying to setup itunes on my pc i get the following message: there is a problem with this Windows installer package. A program required for this install to complete could not be run. How could I solve this problem?
Repair your Apple software update.
Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
If you don't find ASU, go to Control Panel:
START/CONTROL PANEL/Programs n Features/highlight ASU and click REPAIR, -
5, it says, "There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." I have Windows XP and I need help.
After reading all these posts, one by one did not resolve my problem until I got the very end. Regardless of what step would resolve your problem, these are the steps I would recomment to everyone for a what seems to be a safe and fool-proof upgrade to iTunes 10.5.
1. Stand alone upgrade to the latest Quicktime version
2. Go to control panel and "change" then select repair to the following applications in the order specified by the post on Oct 27. (Notice I skipped Quicktime because it had been upgrade manually,and Bonjour did not have a "repair" option)
iTunes; Apple Software Update: Mobile Device Support; Apple Applications Support
Some of these applications may not appear if they do not apply to your configuration (no iPhone, or no iPad, or other apple devices).
Once all updated, I did not need to restart nor launch any applications, I simply went straight into the 10.5 upgrade, and where it normally got stuck, this time the installation continued for a while longer until it completed successfully.
Great work everyone who contributed! Thank you very much! -
I am trying to update to iTunes 10.5 and am getting a Apple Software update error. "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. ?? I can't uninstall the Apple Software Update from my Control Panel. It states "Fatal error during installation" Please HELP!!!
I am experiencing the exact same issue during the installtion process for iTunes 10.5.
I uninstalled all Apple components but when I attempted to uninstall the Apple Software Update I received the same message: "Fatal error during installtion." I was able to repair the Apple Software Update but still could not install iTunes 10.5 afterwards.
I have tried everything that I could find on these discussions pages as well as other suggestions on third party sites. I continue to receive the error message: "There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.
I was able to uninstall and reinstall QuickTime 7.7.1. During the reinstalltion process I received the same message (There is a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.) But after clicking "OK" the installtion process was succesful. PLEASE HELP! -
when I installed iTunes 10.6 to windows 7, during the process i got this message -" There is a problem with this windows installer package. A program required for this install to complete could not be run" and after that the setup closed automatically. Plaese tell me if any setting up of windows is in order.
Try looking at the two previous discussions listed on the right side of this page with your same question.
Also, try searching/posting in the iTunes forum since you do not have an iPod problem. -
I am a new user. I attemped to install I cloud on my Windows 7 home eddition. The program starts to install, but then a error message appears stating "There is a problem with this Windows Installer pacage. A program required for this istall to complete could not be found". What can I do to install I-Cloud?
I have been in touch with Apple support in reference to my problem. We went through every solution available, and found no fix. The tech then suggested I contact Microsoft concerning this issue. I thought that suggestion was just to get me pointed somewhere but Apple. Boy was I wrong!! I contacted Microsoft, and was directed to a free download called Microsoft Fix. This program fixed something in the regisitor, and wala everything was fixed!! I now have I-Cloud and I-Tunes loaded and working well. So, if you can't install Apple Software and are running Window 7 you might give Microsoft Fix a try, it fixed my problem.....
-
How to update ITunes on my PC (Windows XP)?? Repeated attempts produce this messsage: "There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor." I have an older version of ITunes on the computer. Why can't I update it?
MMettlerRepair your Apple software update.
Go to START > ALL PROGRAMS > Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
If you don't find ASU, go to Control Panel:
START > CONTROL PANEL/ > Add n Remove Programs, highlight ASU and click CHANGE then REPAIR -
Each time I attempt to download the new itunes 10.5 I keep getting the following error message:
Product: Apple Software Update -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action SoftwareUpdate_UnregServer, location: C:\Program Files\Apple Software Update\SoftwareUpdate.exe, command: /UnregServer
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Any Ideas of how to solve this one?After reading all these posts, one by one did not resolve my problem until I got the very end. Regardless of what step would resolve your problem, these are the steps I would recomment to everyone for a what seems to be a safe and fool-proof upgrade to iTunes 10.5.
1. Stand alone upgrade to the latest Quicktime version
2. Go to control panel and "change" then select repair to the following applications in the order specified by the post on Oct 27. (Notice I skipped Quicktime because it had been upgrade manually,and Bonjour did not have a "repair" option)
iTunes; Apple Software Update: Mobile Device Support; Apple Applications Support
Some of these applications may not appear if they do not apply to your configuration (no iPhone, or no iPad, or other apple devices).
Once all updated, I did not need to restart nor launch any applications, I simply went straight into the 10.5 upgrade, and where it normally got stuck, this time the installation continued for a while longer until it completed successfully.
Great work everyone who contributed! Thank you very much! -
My ipad will not open icloud photos and I have a windows 7 laptop so I removed icloud and and I am trying to download it again but get the following message: There is a problem with this windows installer package. A program run as part of the set up did not finish as expected. This problem occurred I think after one of the Apple updates and I couldn't find icloud photos on the icloud main page. When I tried to open icloud photos from the select menu it was there but nothing happened.
Try the following user tip:
"There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows -
I keep getting the message" There ais a problem with this windows Installer Package. A program required for this install to complete could not be run. Contact your support personnal or package vendor". I get this whentrying to update itunes.
Does anyone have a idea how to fix this/
ThanksTry the following user tip:
"There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows -
Every time I try to install itunes on my PC I get the following message, and I can't seem to find a solution. Any help out there?? "There is a problem with this Windows Installer package. A program required for this install to complete could not be run."
Try the following user tip:
"There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows
Maybe you are looking for
-
Printing Problems with Spry Menu. Help?
When I have a spry menu in the banner or main image and go to print. Well the image of banner or main image will not print out. It comes out as blank space, with just menu and no background pic. Help. Thanks
-
Perspective effect with Smart Objects (SO)
Hi, i would like to create a perspective efect on smart objects.everything i read so far was that perspective effect doesn't work (distort) on SO. everybody place the SO almost as they want but to create the perspective effect, they rasterize layer a
-
Is it necessary to have a full learning in Swing
hi, everybody, do you i am thinking about spending times to learn Java Swing, but my friend said it was waste of time, Java won't be widely used to develop desktop applications. He suggested me to spend my time on JSP and XML . what do you think ???
-
Non-printing repeating meetings
OK, this is downright weird. I have a user (an executive, of course) whose calendar does not print all events when [a] printing from Outlook and printing from a Delegate/Editor/Designate window. In this case, only repeating events are printed. But wa
-
How do I get the bean property to JSP page for use in a Scriplet
Hi all, I am new to JSF and would like to know how can I get the Bean property to a JSP page and then use that property to dynamically display the contents. Thank in advance,