How to execute this Procedure and get the output?
I have created a Procedure the source code of the same is furnished below.
create or replace procedure vin_test( p_deptno IN number
, p_cursor OUT SYS_REFCURSOR)
as
v_res Emp%rowtype;
begin
open p_cursor FOR
select *
from emp
where deptno = p_deptno;
end vin_test;
Now, if i want to see the out put of this Proc
i will first set the Serveroutput on and then..
Exec vin_test(10);
I am getting an error saying wrong number of arguments,so can anybody tell me what parameter value should i pass on so that i can get desired output.
Thanks in Advance
OraCrazy
In sqlplus you can do like this.
SQL> create or replace procedure vin_test( p_deptno IN number, p_cursor OUT SYS_REFCURSOR)
2 as
3 v_res Emp%rowtype;
4 begin
5 open p_cursor for
6 select *
7 from emp
8 where deptno = p_deptno;
9 end;
10 /
Procedure created.
SQL> var lcur refcursor
SQL> exec vin_test(30,:lcur)
PL/SQL procedure successfully completed.
SQL> print lcur
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO DIV
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 10
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 10
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 10
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 10
7900 JAMES CLERK 7698 03-DEC-81 950 30 10
6 rows selected.Thanks,
Karthick.
Similar Messages
-
Getting error while executing a procedure and assign the output in BPEL
Hi
I am getting the Following error while deploying BPEL in 10.1.3.1. I have invoked Database Adapter and called a procedure and that procedure returns a output. I have assigned that output to a variable.
empty variable/expression result.
xpath variable/expression expression "/ns2:OutputParameters/ns2:GREETING" is empty at line 98, when attempting reading/copying it.
Please make sure the variable/expression result "/ns2:OutputParameters/ns2:GREETING" is not empty.
Please reply me with SolutionsHi,
Are you getting this error while deploying or testing ?
Normally this will happen due to namespace mismatch issue. But if you have auto-created the variables then JDev will take care of it so it should not be a problem
Also, please check if this also happens if the code is deployed to 10.1.3.3 ?
Regards,
ketan -
Hello there,I delete my scruff application on the 8/05/13. Receipt N: 184052577343. And I was charged ammount of £ 16.99on the 15/05/13. I t's a Subscription Renewal. How can I stop it and get the refund of this ammount back on my account? Thank you!!
There are instructions on this page for managing and stopping auto-renewing subscriptions (deleting an app won't stop it) : http://support.apple.com/kb/HT4098
In terms of a refund, what does it say on the app's description page in the store (a lot say that refunds aren't given) ? But you can try contacting iTunes Support and see if they will refund or credit you : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption -
How to execute a function and return the result into a bind variable
Hi,
I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
create or replace function total_income
+(v_job_id IN varchar2)+
RETURN number IS
v_total number(6);
cursor get_sal is
select salary from employees
where job_id = v_job_id;
BEGIN
v_total := 0;
for emp in get_sal
loop
v_total := v_total emp.salary;+
end loop;
dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
return v_total;
END;
Now I woud like to execute this function and assign the returned value into a bind variable test_sal
variable test_sal number(6)
SELECT total_income('AD_VP') into :test_sal FROM DUAL;
dbms_output.put_line('Total Sal:'||:test_sal);
This is returning the below errors:
SELECT total_income('AD_VP') into :test_sal FROM DUAL
*+
Error at line 0
ORA-01036: illegal variable name/number
dbms_output.put_line('Total Sal:'||:test_sal);
Error at line 3
ORA-00900: invalid SQL statement
Could someone help me what could be the problem?? Thanks for your time...Dear,
If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
Best regards
Mohamed Houri -
Need help to get access to iTunes store. I bought an iTunes card bor buying on iTunes store.
I forgot the answers for security questions, how can I reset them and get the access back to the iTunes store?If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you should see an option to send security question reset info to your rescue email address.
If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you won't get the reset option - you will need to contact iTunes Support or Apple to get them reset.
e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then 'Forgotten Apple ID security questions'
or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57
When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down this page to add a rescue email address for potential future use : http://support.apple.com/kb/HT5312 . Or you could change to 2-step verification : http://support.apple.com/kb/HT5570 -
I bought an iTune gift card for myself and sent it to my e-mail address. I have waited over an hour and the e-mail showing the gift card has not arrived. How do I find it and get the credit put into my iTunes account so that I can buy some music?
Oh hold on - sudden development!
I panicked and force-shut down my computer because it froze after I clicked on the 'Reset Cache' option, then I logged back on and noticed the Cloud symbol next to the missing song. I clicked it, and it's finally downloaded properly! <3
Mate, thank you so much for helping me out! xxx -
How to execute a procedure depending on the result of a query?
Hello, I'm new in ODI.
I want to execute a procedure depending on the result of a query Oracle table.
We have a Oracle Table whit a column that contains two possibles values.
I want read the table, row by row, and depending on this value, execute a Procedure or execute another.
How can i do?what you need to do is
1. create a variable which "new_var2" which has the count of the number of rows you want to process. must be data type numeric.
2. copy "new_var2" to the package screen.
3. duplicate the "new_var2" on the package screen and evaluate the variable and test for "> 0" zero, call it "new_var2_E"
3. create a new odi variable "new_var1" with a refresh of "select field1 fom (select field1,rownum as rownumber from tablex) where rownumber = #new_var2" in the relevant schema and technology.
4. copy "new_var1" into your package (some where in the flow)
5. right click the "new_var1" variable in you package screen and you should get the option duplicate step (click on that)
6. select the the duplicate "new_var1" on the package screen and correct the the name to something meaning full to you "new_var1_E", also change the "type" to "evaluate variable" then you should see a "value" box. enter one of the values you want to test in the box (remember do not put in quotes ' )
7. now back on the package screen join the "new_var1" to the "new_var1_E" with an OK line
8 you now join "new_var2" to "new_var2_E" with OK
9 you join "new_var2_E" to "new_var1"
10. you then join the "new_var1_E" with an OK or a KO line to the relevant procedure.
12. you need to duplicate "new_var2" in the package screen one more time this time and call it "new_var2_D" set the type to evaluate and then select the increment of -1
13. the relevant procedure to "new_var2_D" with an OK
14. join the "new_var2_D" to the "new_var2_E" with an OK
15. this should close off the loop now the exit point is "new_var2_E" with a KO line to the next part of your process....
Basically you should end up with a loop on new_var2 decementing, and it is used to get a specific next record row from your table.
Hope this helps, sorry it is a little long winded..
Edited by: DavidGD on Feb 8, 2009 3:29 PM -
How to join two tables and get the supply delivery date next to order?
So there are two tables. One has customer's order no, ordered date, order quantity, available quantity and code of article-
The other table comes form supply side where we have supply order no, article number, ordered qty, and delivery date.
We keep stock so this can not be MOT (made to order) system.
What i need is correct date of arrival to appear next to cusotmers spoecirfic order. The older cusotmers order get's the parts first, second oldest order is next in line etc.
here is any example
customer's order
ref order
art. code
ordered qty
available qty
order date
1809202491
700497
60
0
3.7.2014
1809200528
700497
13
0
20.6.2014
1809198640
700497
7
0
9.6.2014
supply order
supply order
art. code
qty orderd
date of arrival
4501243378
700497
50
4.8.2014
4501263437
700497
20
6.10.2014
There is actually a 3rd "table" and that sort of connects the two and that is stock on hand per art. code.
The main issue is that stock is assigned to purchase orders only when it actually arrives in the warehouse.
A human can easilly connect the dates of when the stock will arrive and quantities with correct customer's order. In this case the firts order will get 50 pcs in August while 10 pcs will remain on backorders. The missing 10 pcs Will arrive in October. The second order will get 10 pcs in october and 3 will remain on backorders with no delivery date. While the third customer orders does not have a delivery date.
So how to make the SAP do this calculations and display the arrival date next to date of customer's order?I checked the instructions as i do not have access to this part. It seem this is a query. We had issues with queries in the past as not all codes from orders would appear in them. They never found the reason why that is happening.
However, I think the main issue is that the information here is not connected and is separately provided for supply and for sales. So i doubt it can be connected in this query.
edit: as you can see the only connection is stock on hand.
and total number of various items we have is close to 100.000 of various article codes. -
How to run commands like "ipconfig" and get the output in adobe AIR in windows?
import flash.desktop.NativeProcess;
import flash.desktop.NativeProcessStartupInfo;
if (NativeProcess.isSupported) {
var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");
var process:NativeProcess = new NativeProcess();
npsi.executable = processpath;
process.start(npsi);
The above can only run a sub-application, but how to run an independent application(command) like ipconfig and get the result?Hi,
here is an example of running a net Use command line from AIR, unig the new NativeProcess. Hope it will help !
function launchProcess()
var file = air.File.applicationDirectory;
// set command path
file = file.resolvePath("C:/Windows/system32/net.exe");
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
// prepare command parameters
var args = new runtime.Vector["<String>"]();
args.push('USE');
args.push('W:');
args.push('/delete');
args.push('/y');
// set arguments
nativeProcessStartupInfo.arguments = args;
// add listeners to catch command outputs
process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
// create and run Native process
process = new air.NativeProcess();
process.start(nativeProcessStartupInfo);
function onOutputData(ProgressEvent)
var processResults = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
air.trace("Results: \n" + processResults);
function onErrorData(ProgressEvent)
var processResults = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
if(processResults.search('password') > -1){
window.alert('Bad password');
air.trace("Errors: \n" + processResults);
function onExit(NativeProcessExitEvent)
air.trace("Process ended with code: " + NativeProcessExitEvent.exitCode); -
How to read spool file and get the spool file number
Hey everyone.
I created a program ztemp that is calling another program ztemp2 within, ztemp2 creates a spool file. Now the requirement is I need to write a code within ztemp to download that spool request and then convert it to the pdf file. I know I can use program rstxpdft4 to convert the spool file to the PDF but for this I need to give the spool number, so can you please tell me how can I get the spool number and then fetch it to the program rstxpdft4 .
Thank you.
Rhul goelHi,
Please check the [link|Convert ABAP List to PDF and display without downloading first; (Rich's reply) and get the spool similarly.
Or read from table TSP01 to get the latest spool using sy-uname.
Regards,
Srini. -
Hello,
I'm looking for the most obvious and simple way to, from Labview :
1- Start the Teststand engine : DONE
2- Get a list of SEQ files to execute : DONE
3- Loop through the list to execute each SEQ file : <- found some examples but I have some trouble with the UIMessage stuff
http://zone.ni.com/reference/en-XX/help/370052N-01/tsexamples/infotopics/executing_sequences_using_api_labview/
4- Get the result of the SEQ execution : <- unsure
5- Get the XML path+name of the report file generated : <- obviously not easy
http://digital.ni.com/public.nsf/allkb/3D3B2358DF9B786B8625789500549A3B
http://forums.ni.com/t5/NI-TestStand/Getting-Report-File-Path-location-at-execution-in-TestStand-2012/td-p/3041789
Here is my current implementation :
David Koch
Hello,
I tried to work from this example :
http://forums.ni.com/t5/NI-TestStand/Execution-of-TestStand-Sequence-in-LabVIEW-via-TS-API-Different/td-p/2939616/page/2#M46686
However it remains unclear about how to get a simple
answer from just running a sequence file out of any
model so far (Simple Pass). Like I told you, all what
I need, once the TS engine is started, is a VI with the
following interface :
INPUT
1- TS engine reference
2- SEQ file path (path or string)
3- Sequence name to execute
4- UUT string (optional, but yeah)
5- error in
OUTPUT
1- Result boolean (PASS/FAIL)
2- Path to XML report
3- error out
It would be so cool to just have this
About the surrounding UI, I'm working on it. The LV
code is not really important at this point, it's running
a SEQ file that matters to me.
David Koch
-
What details? FF made a new crummy beta, screwed up my tranquil and wonderful browsing environment, and now, like the big oil companies and the banks, are laughing at me. Browsers of the world, UNITE! We have nothing to lose but our bookmarks!
BillI have taken it back to the Apple store genius bar, but they say they don't see anything wrong. Well unless you use it all day and experience the problems when they happen, you wont see anything wrong. But there are lots wrong with it. But this would be the same store as I purchased the phone. And they backed up my old Iphone 4, but were not able to get anything to load back onto my new phone. So, I lost pretty much everything. But over time, some of my contacts have started showing up, although i am still missing over 800 of them.
-
A few years ago or so i bought Aperture and Photoshop (the whole kit and caboodle) from a university subsidized store (my husband worked there and buying programs like those two, the whole Microsoft office Suite, all kinds of things) at a very significant discount, i think we paid 25$ for Photoshop vs the 400$ it was selling for on the open market.
Yesterday i upgraded most of my laptops to Yosemite (one of them I'm sure was the one that had Aperture on it, a 17in MacBookPro, its about 2 years old now, but at the time i bought it it was the highest computer apple had on the regular floor, I'm sure i could have added some stuff to customize it for extra, but basically we are talking top of the line computer. I recently just required a 2012 MackBook Air with also fairly heavy specs from a family member that was upgrading (I'm not sure why, i know they couldn't possibly be using this thing for anything beyond its capacity, its basically new, and they aren't 3D animation rendering and needed a "quicker" one).
I was very happy with the upgrade, and now it does work much more seamlessly with my iPads and my iPhone, but the whole reason i uploaded it was to work on pictures, adjust them, change the size and then print them out to include in jewelry, and Yosemite won't let me use Aperture at all, when i click to upgrade it (in the bar all it has basically old icon with a (no sign or ghost busters like sign over it) i click on it and it says, you did not buy this with your apple account name and i could not upgrade it. But it just made me click ok, and did not give me any info on how to upgrade it. i do physically own it, or my husband does, I'm not sure to whom it is registered, but sholdnt i still make it able to work with this new operating system, even if not through regular "software updates" it used to always be asking me to upgrade "word" and i got that in the same way, so what is the issue and what do i do to get it to work on this new system?Wow that was really quick, thank you so much. Im not sure at all which version it was because i said it was around 4 years ago he bought it. I know it isn't under his username, since he's a PC person (ugh) so i know its probably registered to one of our actual names. isn't there some way to look it up since we did register it, because I'm not even sure where the disks are from when we bought it (we've moved a lot and also have two storage lockers, i know i would have kept it with other disks) but my cd rom drive is actually broken on my computer as well ( i think it got stepped on and is now squished and won't eject or run disks.)
So is there anyway they can look up that its registered to one of our names since we did register it when we bought and installed it, or do i really have to find the disk with some sort of proof of purchase (i know there would be no receipt after all this time)
either way, ill do what you suggested to the best of my abilities and thank you so much for answering my questions, i can't even open the program as its incompatible and find out the info from that) so I'm in a bit of a pickle and your response was so thorough and it didn't seem to be posted long enough to even write a well researched response, thanks, all the best,
sarucia -
How to run this query to get the minutes between two hours?
Hi all,
Hope doing well,
sir i am running one query which is:
v_TotalHrsMin1 := LPAD((extract(minute from TO_TIMESTAMP (v_Temphrs,'HH24:mi:ss')) - extract(minute from TO_TIMESTAMP (v_Outtime1,'HH24:mi:ss'))), 2, '0');--select to_date(v_temphrs,'YYYY-MM-DD HH:mi:ss')-to_date(v_OutPunch,'YYYY-MM-DD HH:mi:ss')*1440;
in this v_TotalHrsMin1 is number datatype and v_Temphrs is varchar2 which is storing this value: 12:00:00
and v_Outtime1 is varchar2 which is storing 06:00:00
now i want the minute difference between both times
and insert into v_Totalmin1.
but getting null value in v_totalmin1.
thanks952646 wrote:
Hi Sir,
i used query like this: v_TotalHrsMin1 := extract(hour from time_interval) * 60 + extract(minute from time_interval) from (select to_timestamp(v_temphrs,'HH24:MI:SS')-to_timestamp(v_outtime1,'HH24:MI:SS') time_interval from dual);That is not a query - that is a PL/SQL assignment expression. You should learn the differences between SQL and PL/SQL and how they work together ;-)
When doing it in PL/SQL, you do not need a query at all. Why would you do a select from dual in the PL/SQL assignment.
But you should be able to take the SQL example I gave you and write the equivalent PL/SQL code.
We do not want to do your work for you - we want to teach you how to do it yourself.
You should try and understand the examples we give you - not just cut-and-paste it and cry for help when you are cut-and-pasting a SQL example into PL/SQL code.
Anyway - here's a way to do it in PL/SQL:
declare
v_outtime1 varchar2(8);
v_temphrs varchar2(8);
v_interval interval day to second;
v_totalhrsmin1 number;
begin
v_outtime1 := '06:00:00';
v_temphrs := '12:00:00';
v_interval := to_timestamp(v_temphrs,'HH24:MI:SS')-to_timestamp(v_outtime1,'HH24:MI:SS');
v_totalhrsmin1 := extract(hour from v_interval) * 60 + extract(minute from v_interval);
end;
/What's so difficult about taking my SQL example, understanding what the differenct functions do, and then write that piece of PL/SQL? ;-) -
How to modify this query to get the desired output format
I hv written a Query to display all the parent table names and their primary key columns(relevant to this foreign key of the child table).The query is given below...
SELECT DISTINCT(TABLE_NAME) AS PARENT_TABLE,COLUMN_NAME AS PARENT_COLUMN
FROM ALL_CONS_COLUMNS
WHERE CONSTRAINT_NAME IN (SELECT AC.R_CONSTRAINT_NAME
FROM ALL_CONSTRAINTS AC
WHERE AC.TABLE_NAME=TABLE_NAME
AND AC.TABLE_NAME='&TABLE'
AND AC.R_CONSTRAINT_NAME IS NOT NULL);
This query will display all the parent tables and their primary key columns.Now my problem is that how to modify this query to also display the foreign key column name of the child table.
I want the query result in the following format.The query should display the following columns.1)child table's name,2)child table's foreign key column name,3)the corresponding parent table's name,4)the parent table's primary key column name(which is the foreign key in the child table).
For Example I want the output as follows...
TAKE THE CASE OF SCOTT.EMP(AS INPUT TO YOUR QUERY)
CHILD_TABLE CHILD_COLUMN PARENT_TABLE PARENT_COLUMN
EMP DEPTNO DEPT DEPTNO
In this result I hv used alias name for the columns.The query should display this only for the foreign keys in the child table.In the query which I sent to you earlier will give the parent table and the parent column names,But I also want to append the child table and child column names there.
any help on how to tackle would be appreciated.Try this query
SELECT c.table_name child_table,
c.column_name child_column,
p.table_name parent_table,
p.column_name parent_column
FROM user_constraints a,user_constraints b,user_cons_columns c,
user_cons_columns p
WHERE a.r_constraint_name=b.constraint_name and
a.constraint_name=c.constraint_name and
b.constraint_name=p.constraint_name and
c.position=p.position
ORDER BY c.constraint_name,c.position
Anwar
Maybe you are looking for
-
QaaWS-swf in InfoView: unstable connection
Hallo, we designed a dashboard using QaaWS to connect to live data. On a local machine, the Xcelsius-swf works fine. Once I publish it to InfoView and open it online, the connection seems to be "unstable"? After several minutes (2 to 3) when I naviga
-
Finder Cannot Complete Operation While Trying to Trash Files
When I try to trash files, I receive the following error message, "The Finder cannot complete the operation because some data in (file name trying to trash) could not be read or written. (Error Code - 36)." Any help appreciated - Thanks
-
Jfreechart line chart mouse click problem
i need to implement a line chart where users can click on an area of the chart and highlight it, i have serveral questions regarding how to do this: i added a mouselistener to the chartpanel, i can get the points with e.getTrigger().getPoint(), but I
-
Is there any way to assign keywords to clips in the new iMovie?
You can search for keywords that were assigned to clips in the old iMovie 11, but I can't find how to assign keywords to clips in this new version. Other than this, I'm finding all the old features and am loving the new layout and speed of imports w
-
WD Passport problems with Imac
Just bought aWD Passport external hard drive for my Mac. It was working in a fashion and backing up but there seemed to be problems with Time Machine. this morning it is not showing up at all on disc utility.