How to run the packaged procedure with Ref Cursor
Hello.The question may be very simple for you... but I was confused how to run
I have the following package
CREATE OR REPLACE PACKAGE CURSPKG AS
TYPE T_CURSOR IS REF CURSOR;
PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
IO_CURSOR IN OUT T_CURSOR);
END CURSPKG;
/
CREATE OR REPLACE PACKAGE BODY CURSPKG AS
PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
IO_CURSOR IN OUT T_CURSOR)
IS
V_CURSOR T_CURSOR;
BEGIN
IF N_EMPNO <> 0
THEN
OPEN V_CURSOR FOR
SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME
FROM EMP, DEPT
WHERE EMP.DEPTNO = DEPT.DEPTNO
AND EMP.EMPNO = N_EMPNO;
ELSE
OPEN V_CURSOR FOR
SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME
FROM EMP, DEPT
WHERE EMP.DEPTNO = DEPT.DEPTNO;
END IF;
IO_CURSOR := V_CURSOR;
END OPEN_ONE_CURSOR;
END CURSPKG;
/
But I want to test (run) this procedure...But confused how to have Ref Cursor
Could you help me in this...
Thank you
You must declare a variable of type T_CURSOR and pass it to the procedure like this.
declare
lOutCursor CURSPKG.T_CURSOR;
begin
CURSPKG.OPEN_ONE_CURSOR(, lOutCursor);
end;
Tags: Database
Similar Questions
-
How to perform procedures with REF CURSOR &; PLSQL settings table in SQL Dev?
I have 3 SQL Developer. I create a procedure with a set of tables/PL/SQL as an input parameter and a SYS_REFCURSOR as output parameter.
When I press the green arrow (Run button) block the dialog box run PL/SQL PL/SQL has no place at the PL/SQL table with records of entry and also to see the output of the SYS_REFCURSOR.
I get the error ORA-06550 and many other errors when I run the present.
How to do this please?In the debug code, lose the ABS. Prefix the SYS_REFCURSOR QC_SQL_DEVELOPER_TEST.
Also, do not use same name of your settings on your bind variable (so e.g.: OUT_REF_CURSOR).
REF CURSOR is supported output types, so you will get the output of their share in the output tab.
However the output system does not recognize your own types as your PL/SQL table. You need to write an exit procedure yourself, indexing correctly, using the DBMS_OUTPUT.Have fun
K. -
Newbie - how to import the package, procedures, etc.?
I used the "data export", the computer of the developer, expoty tables, export procedures, export Packages, etc. in a file
SQL Developer.
In Sql Developer, how to import tables, import procedures, import packages on my computer "REAL LIVE"?
I want to copy the Package, the copy procedure, etc. 'computing Developer' to computer "LIVE REAL DATA?
TIA
Steve42If you have access to 2 databases of your sqldev client (and therefore have connections put in place for both of them), just run the export file obtained from the DB dev as a script (F5), using the connection to the production DB (drop-down menu at the top right).
Have fun
K. -
Check the package/procedure for a user level privileges
Hi gurus,
How to check the package/procedure for a user-level privileges? as dba_tab_privs for the tables.
for example: grant execute on User1 dbms_scheduler.
now I must verify that user1 has run on dbms_scheduler privilege or not.
What is the advice for this?
Thanks in advance,
CharlesSQL> select privilege, count(*) from dba_tab_privs group by privilege order by 1; PRIVILEGE COUNT(*) ---------------------------------------- ---------- ALTER 19 DEBUG 256 DELETE 131 DEQUEUE 3 EXECUTE 19315 FLASHBACK 52 INDEX 14 INSERT 137 MERGE VIEW 36 ON COMMIT REFRESH 52 QUERY REWRITE 52 PRIVILEGE COUNT(*) ---------------------------------------- ---------- READ 7 REFERENCES 54 SELECT 3752 UNDER 3 UPDATE 111 WRITE 5 17 rows selected.
DBA_TAB_PRIVS is more than simple tables.
-
How to run the sys_refcursor in a procedure
Hello
How to call the following procedure
Guide me so call this procedure / / I have tried but no luckcreate or replace procedure proc_ref_cursor (rc in sys_refcursor) as v_a number; v_b varchar2(10); begin loop fetch rc into v_a, v_b; exit when rc%notfound; dbms_output.put_line(v_a || ' ' || v_b); end loop; end; /
SQL> create or replace procedure 2 proc_ref_cursor (rc in sys_refcursor) as 3 4 v_a number; 5 v_b varchar2(10); 6 7 begin 8 loop 9 fetch rc into v_a, v_b; 10 exit when rc%notfound; 11 dbms_output.put_line(v_a || ' ' || v_b); 12 end loop; 13 end; 14 / Procedure created. SQL> set serveroutput on SQL> SQL> ed Wrote file afiedt.buf 1 declare 2 r sys_refcursor; 3 begin 4 open r for 5 select 1, '2' from dual; 6 proc_ref_cursor (r); 7 close r; 8* end; 9 / 1 2 PL/SQL procedure successfully completed.
Published by: bluefrog on February 5, 2010 10:12
Published by: I forgot to close the cursor!
-
Run the package to a different schema
Hi all
I have a very strange (at least for me) problem with a package to run in the production environment.
The package has been installed in the application schema and in the same schema for all tables that are in the same table.
The customer reported a slowdown in the performance of it, but if I test it in my PR env and:
-If I run the application outside of the package, it run very fast
-If I install the package in my personal schema and run it, it run very fast
-If I run the package, installed on the application's schema, is very slow!
What is the difference between these three methods?
Thank you in advance,
Diego
91ca5e2c-8db6-4563-9e70-c98e10acf2ad wrote:
OK, to start my procedure I used Notepad anonym in plsqldeveloper:
Start
Appuser.pkgapp.prcursors (vcode =>: vcode, pcursor =>: pcursor);
end;
when I try to get the cursor, with plsqldeveloper, I have different response time for:
-package in my user-> very fast
-package to the user of the application-> very slow
OK - but that the above code does not recover. All this shows is a call to the procedure who, do you think, does that open the cursor.
Once a cursor is opened the procedure who opened it has NO control over it. Only the session making the recovery is involved as is an Oracle process on the backend. But the procedure/package is NOT involved.
If the location of the package does NOT affect actual recovery, but it can affect the execution plan used when the cursor is opened first.
New - when you say "run the code" you tell fetch data? Or are you talking about just open the cursor as the example above shows?
Display actual execution plan - get it from a trace file, if you need to.
other things to say is that the number of lines to get out are some ten years.
The question is always this THAT IS SLOW? It is the RECOVERY of these lines "a few ten at most? Or is it just open the cursor so that you can begin to pick up?
You need to SHOW US (just tell us):
1. WHAT you do
2. HOW you do
3. WHAT results you get
4. WHAT results you expect to get
-
How to calibrate the PCI-6110 with NOR-DAQmx
Hello
I am a new user of the PCI-6110 Council tries to run the calibration using LabVIEW procedure. I look at the document "Calibration" on the page of the manuals for the Board of Directors,
http://sine.NI.com/NIPs/nisearchservlet?nistype=psrelcon&NID=11888&lang=us&q=FQL: 28locale % 3Aen % 29 + AND + % 28phwebnt % 3 A 1081 + OR + phwebnt % 3 A 7075% 29 + AND + 28nicontenttype % 3Aproductmanual % 29 + AND + % 28docstatus % 3Acurrent % 29% 20RANK % 20nilangs: en & title = NOR + PCI-6110 + manual
One of the first steps in the document is to call the AI_Configure command to set the input mode, beach, etc. I'm using LabVIEW 8.5 with the NOR-DAQmx software, and I can not find the command (which, in LabVIEW, seems to be "AI Config.vi") anywhere. The calibration paper was written in 2003, and I gather from Google searches (please, correct me if wrong) that this command is actually a part of NOR-DAQ traditional, who was replaced by driver OR DAQmx.
My question is this: what is the equivalent to AI_Configure command in the latest software? Is it perhaps a subsequent document describing how to calibrate using NOR-DAQmx?
Thanks much for any help.
Tom McLaughlin
Hi Tom,
The calibration Procedure series B, E, M, S, which is also linked from this page, describes how to calibrate the PCI-6110 with NOR-DAQmx.
Brad
-
I am a student of plsql, how to run package? give some examples of how to self-test code and package programs
You cannot run the package
you run the procedure/function in packagePlease see
http://docs.Oracle.com/CD/B10501_01/AppDev.920/a96624/09_packs.htm>
A package is a schema object which includes subroutines, the elements and the logically related PL/SQL types. -
Lean how to run the stop code when the highest level VI ends
Hi people.
I am a newbie of LV with 30 years of experience in embedded SW engineering. I searched for how to run the stop code when a VI of highest level ends. I found many examples, but they are horribly complicated. A little birdie told me that such a model of simple design should not be so compilicated.
My application is an application of high tension control to disable all HV checkpoints when the SW ends. My VI code is running in a while loop with a stop button that leads out of the loop. I can easily accomplish my requirement by programming with a sequence of plate that runs after the end of the main loop. The technique of flat sequence does not work when the user clicks the Cancel button in the toolbar of façade, more than that market when the user clicks the close button of the application (X button) when you run the exe application.
Can someone tell me please a simple technique, the code example that can show me a lean and elegant way to accomplish my task? It doesn't have to be an obvious solution (for example a stop induced watchdog seems simple enough).
Thank you - John Speth
1. place this code in a VI:
(also attached)
Calling code in your VI of highest level like this:
-
How to run the VI developed in labVIEW 2011 in its previous versions
Hi all
I am currently using LabVIEW 2011 in my PC at home.
But, all my school's computers are installed with LabVIEW 2010 and 2010 SP1.
How to run the VI developed in LabVIEW 2011 in its previous versions?
Is there any conveter why?
Concerning
Prasanth T
Open the VI in LabVIEW 2011 and use the file menu option, save for the previous Version.
-
Is it possible to run the command script with user account administrator rights?
Is it possible to run the command script with administrator user account rights means please tell me how to...
I need to run it in windows 7 professional service pack 1.
There are a few myths that won't go away, for example
- You can perform administrative tasks when you are working from a command prompt.
- A script (batch file, VBScript, PowerShell) gives you administrative rights.
There is no substance to a myth. Your account has administrator privileges, or it does not. There is no backdoor.
-
How to run the Extendscript .bat file?
I have a file with some instructions .bat and I want that it runs from Extendscript.
How to run the Extendscript .bat file?
I tried execute(); order and it seems that .bat ran but no result, but when I double click on the .bat file all worksout very well.
How used runtime.exec () extend the script?
Can I communicate with Java JDK thru ExtendScript and run commands such as runtime.exec ()?
can someone please?
You can do it like this:
var batFile = new File("C:\\path\\to\\my\\batfile.bat"); batFile.execute();
Note that this will only work if your system is configured in such a way that by double-clicking the .bat file runs it in reality.
You can also use
system.callSystem()
but note that this is only available in AE.
-
What is tdrc.tdrcfacade and how to run the installation wizard?
What is tdrc.tdrcfacade and how to run the installation wizard? My desktop creative cloud application does not open properly... it is just a blank window.
Much obliged,
Angiecrichards@gmail.com
! !
Are Angie, you a blank white screen? What version of OS are you using?
Here's what you can try:
- Blank white screen. Sign in | Creative cloud Packer
- New application Cloud Creative unusable: it is empty!
- Creative cloud Packager white screen after the Adobe ID Login
- Re: screen creative black cloud
Waiting for your response.
-
[CS4:JS] How to run the file ".sh" via Javascript
Dear all,
How to run the file ".sh" through Adobe InDesign Javascript, I used the code below:
//================== Code =============================//
var myFile = File("xxx/xxx/xxx/Test.sh");
var Exec = "sh" + "" + "\""+myFile+"\;"
Leader (exec). Execute();
//================== End =========================//
codes above does not work, I checked before without the "sh" in addition, it does not work.
Please can someone give me the solutions and the suggestion, and I'd appreciate it.
Thanks and greetings
SudhaN T.R.Harihara.,.
Have your IDMLExportparse.sh file runs permission set?
If you open Terminal.app and type
/Applications/MacXinPro/IDMLExportparse.sh
It work? Or do you need to run "sh"? If so, either adjust the
permissions with
chmod a + x /Applications/MacXinPro/IDMLExportparse.sh
or modify the JavaScript code for:
shell("sh "+myFile);
-
Run the file .bat with arguments?
Hello
I need to run the .bat file with Adode Indesign JavaScript parameters/arguments. "File.execute ()" runs the file using the appropriate application. He is running suceessfully in .bat file. But I'm unable to pass arguments. I need to run the command as
For example: test.bat parameter1 parameter 2
var myFile = new File("c:\\test.bat");
myFile.execute ();
The above statements works very well. Is it possible to run settings. Please suggest the solution above the problem.
How "combat environment variables?
type test.bat
echo% % BLAH > c:\test.txt
$.setenv ("blah", "value");
File("c:\\test.bat"). Execute();
Dirk
Maybe you are looking for
-
Resound LiNX2 961 - to broadcast or not...?
I get my new (first time) the LiNX2 961 hearing next week and do my homework. Those of you with loss simple age-related hearing (moderate loss to gradually of frequencies) can help me wrap my head around a fundamental question continuously. When, if
-
HP Pavilion DV7 3110TX - region Code Incorrect
I have a laptop HP Pavilion DV7 3110 tx, Windows 7. I never really used the laptop for viewing of DVDs so far and observe through the HP Media Smart DVD player it says that my area is 6. I live in Australia and my dvd were bought here - region 4. The
-
Impossible to update Windows on my new L750 Satellite
Just bought a new L750 and when I try to update Windows I get the following message. An error occurred when the new updates for your computer Errors:Code800B0100 Windows Update encountered an unknown error. I use Windows 7 Home 32 bit, I tried to use
-
I'm helping a friend on his computer because someone got on the subject and created a strange wallpaper and now she can still access the icon start or the bar menu or the task to start on the desktop. I tried to delete the .gif picture in the photo
-
Help, please! I am currently working on a version of BB10 to an existing application. The application calls a Web service with parameters (including a key). The service then returns the data. It works very well on java with HttpConnection. I'm having