Different ways of passing procedure's paramters
Hi,
In the following example, I am calling the procedure p_test in different ways.
I understood from reading examples, that we can pass parameters using the syntaxe : " Name of the parameters => Value".
But I did not find anything official about it.
I'm just looking for Oracle Documentation where it is explained the syntaxe " Name of the parameters => Value".
CREATE OR REPLACE procedure test_call
is
procedure p_test(I_FIRST IN NUMBER DEFAULT 1, I_SECOND IN NUMBER DEFAULT 2 )
is
begin
dbms_output.put_line ('-----------------');
dbms_output.put_line ('FIRST:'||I_FIRST);
dbms_output.put_line ('SECOND:'||I_SECOND);
end;
begin
p_test(10,11);
p_test(10);
p_test();
p_test(I_FIRST => 100);
p_test(I_SECOND => 200);
p_test(I_SECOND => 2000, I_FIRST => 1000);
exception
when others then
ks_Error.log();
end;
/
note that the => is illegal in sql in 10g and before
select f(x=>1) from dual;
ERROR at line 1:
ORA-00907: missing right parenthesisbut it will probably be possible in 11g
Similar Messages
-
What are different ways to pass variables in a c# program?
What are different ways to pass variables in a c# program?
I was wondering if :
var numbers = textBox1.Text.Split('
.Select(int.Parse).ToArray();
var min = numbers.Min();
var max = numbers.Max();
textBox2.Text = string.Format("min:
{0} max: {1}", min, max);
and
private
int[] numbers =
new
int[10];
were considered passing variables and I am also interested in learning new ways.Hi Billst3r,
Your examples would be considered creating variables or "instantiating" them, which basically means creating them in memory. To pass variables, here is a brief example.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
class Program
static void Main(string[] args)
// Declaring variables
int num1 = 1;
int num2 = 5;
// Pass created variables to private method
int answer1 = ComputeSum(num1, num2);
// Print results
Console.WriteLine(answer1);
Console.ReadLine();
private static int ComputeSum(int param1, int param2)
// Return sum of 2 provided parameters
return (param1 + param2);
Best of luck. -
Ways of passing values/attributes between Portlets of pageflow
Hi
Jusing Bea WebLogic Workshop 8.1.5 where i have one Portal.
The portalt contains:
Page A with A.portlet with A.jpf and a.jsp
Page B with B.portlet with B.jpf and b.jsp
I want to click on a link on a.jsp which then goes to A.action in A.jpf,
then redirect to Page B which then start B.portlet and then start begin
action in B.jpf
and begin action on B.jpf gets the values that I got from link i a.jpf.
How are the different ways to pass the values from A.portlet to another
B.portlet
and that the coresponding .jpf files can get the values. I can not get the
values to passed .
One way to solve this is to use session scope to store values in A.jpf and
then get it from session scope in B.jpf. I dont want that, because it then I
have to remove it to avoid trash in the session.
Any information on this and code will help ?ks wrote:
Any information on this and code will help ?Sounds like inter-portlet communication (IPC) is what you need, see the
documentation at http://edocs.bea.com/wlp/docs81/ipcguide/overview.html
Gerald -
Is there a different way to open a cursor for a ref cursor procedure?
hello everybody
i have two cursors, cur_a and cur_b, declared somewhere else in my application.
These two cursors have the same fields, in the same order, and i have to treat both in the same way. So i wrote a routine that gets as input a ref cursor based on the cur_a rowtype, and i am trying to use this routine for both.
The problem is that i am not able to open outside the routine the cursor in a different way than usual...
the common method is :
declare curs ref cursor ...
begin
open curs for (select *...)
end;
instead i would like to obtain something different
declare curs ref cursor ...
begin
open curs for cur_a
end;hi
thanks for answering
i wanted just to give a better idea, anyway you were near to get it.
the only difference is that the two cursors are not written in dynamic sql, just like strings, but are real cursors.
anyway, this is the version of the package i need, but i am not able to compile
(your original code is commented and immediately below there is my code)
CREATE OR REPLACE PACKAGE BODY mytest
IS
--cur_a VARCHAR2(200) := 'SELECT dummy FROM DUAL';
CURSOR cur_a
IS
SELECT dummy
FROM DUAL;
--cur_b VARCHAR2(200) := 'SELECT ''fred'' FROM DUAL';
CURSOR cur_b
IS
SELECT 'fred' fred
FROM DUAL;
TYPE t_cur_a IS REF CURSOR
RETURN cur_a%ROWTYPE
--PROCEDURE routine_a_b (p_cur SYS_REFCURSOR) IS
PROCEDURE routine_a_b (p_cur t_cur_a)
IS
v_x VARCHAR2 (10);
BEGIN
LOOP
FETCH p_cur
INTO v_x;
EXIT WHEN p_cur%NOTFOUND;
DBMS_OUTPUT.put_line (v_x);
END LOOP;
END;
PROCEDURE doit
IS
--v_curs SYS_REFCURSOR;
v_curs t_cur_a;
BEGIN
NULL;
-- open v_curs FOR cur_a;
OPEN v_curs FOR cur_a;
routine_a_b (v_curs);
CLOSE v_curs;
-- open v_curs FOR cur_b;
-- routine_a_b(v_curs);
-- close v_curs;
END;
END;
the error is:
cursor 'V_CURS' cannot be used in dynamic SQL OPEN statement
i did read that if use weak ref cursor, it could work, so i declare the ref cursor type in this way:
TYPE t_cur_a IS REF CURSOR;
instead than
TYPE t_cur_a IS REF CURSOR
RETURN cur_a%ROWTYPE
what i get is another error (in the open cursor command)
PLS-00382: expression is of wrong type....
but if i replace
OPEN v_curs FOR cur_a;
with
OPEN v_curs for select dummy from dual;
it works... but i already knew it.. :-)
anyway, i used a work around to resolve it, so it's just philosophy -
Any way to pass Multiple Values for a single Label in the Parameter?
I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter.
PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
QUESTION:
Any way to pass Multiple Values for a single Label in the Parameter?
I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
it correct.
I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
Note: We are using Report Builder 3.0Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
Try creating either a function or stored procedure using the code below (compliments to
http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string:
CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
BEGIN
DECLARE @SeparatorPosition INT
DECLARE @ArrayValue VARCHAR(1000)
SET @Array = @Array + @Separator
WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
BEGIN
SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
END
RETURN
END
Once created you can do things like this:
SELECT * FROM Parse('John,Bill,David,Thomas', ',')
SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
This is what your SQL query would probably look like:
SELECT OperationID, OperationName FROM dbo.Operations
WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value. -
Is there a way of passing a mixed cluster of numbers and booleans to teststand
Hi,
I have a labview VI that contains an output cluster containing both numeric and boolean results and would like to pass this to Teststand. At the moment I have coverted all my boolean results to '1/0' so that I can create a numeric array and can quite easily pass this to Teststand (using multiple numeric limit test).
Is there a way to pass mixed results to Teststand and write in the limits (example PASS and GT 5V) or do I have to stick with what I have?
ChrisWhich test step type to use depends on what you have to analyze - a boolean condition? String? Number(s)? I can't tell you because I don't know what's in your cluster. If you click on the plus sign next to the parameter name "output cluster" you will see all paramters and their types, which are passed from the VI to TestStand.
You can either create a variable for the whole cluster, or you can assign all or just some values from within the cluster to variables.
The name of the variable (Locals.xxxxxxx... or FileGlobals.xxxxx...) ist what you type in the value field. You can also choose the variable from the expression browser by clicking on the f(x) button.
Are you new to TestStand, do you know how to work with variables in TS?
Maybe the attached picture gives you an example, there I am assigning the values from VI output "VoltageOutputArray" to the TS variable locals.VoltageMeasurement.
This variable ist used again on the tab "Data Source" as the Data Source Expression.
Regards,
gedi
Attachments:
stepsettings.jpg 89 KB -
Is there a way to pass data between 2 seperate programs?
I realize you can pass values to a program on boot but is there a way to pass information to a program after it's loaded? I want to make it so two seperate programs running on the same PC could exchange data back and forth. Where one program can call a program with options on boot but then that program can pass information back to the one that called it. I can also save it to a text file and constantly check if it changed but I don't think this would be practical. I can set up like a client/server but without networking services needed I think this would be a waste. Is there a better way or do you think the client/server is the best option?
I realize you can pass values to a program on boot but
is there a way to pass information to a program after
it's loaded? I want to make it so two seperate
programs running on the same PC could exchange data
back and forth. Yes that's possible but not very straightforward and it differs from platform to platform. Anonomous pipes seems to be available everywhere but I don't think they are the most efficient -
Different ways to referencing Session State variables
Hi,
According to APEX documentation there's 4 different ways to reference session state variables: http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/concept.htm#BEICHBBG
In an inline PL/SQL statement, what's the difference when using the different methods? I remember reading something that the bind and static text have a size restrictions. What's the difference between the V() and NV() functions?
Thank you.
MartinMartin,
In PL/SQL, the preferable method is to use bind variable notation, e.g., :P1_ITEM. In HTML contexts, you must use &ITEM. notation. In stored procedures, you can use v or nv, the latter function being identical to the former with the additional characteristic that it raises an exception if the retrieved value is non-numeric.
Scott -
Different ways to return results using a stored proc to calling application
Hi, Can someone please suggest me different ways of returning results( set of rows and columns) from a stored procedure to calling application.
Currently I am using sys_refcursor to return results to front end. Stored proc is executed fast, but cursor access and retrieval of results has some overhead.
So can you suggest the ways which will be faster than this approach.
Thanks.Currently the procedure executes quickly but the results from the ref cursor are returned slowly, this is because the query is slow, for whatever reason.
Collecting in all the rows in the stored procedure first before returning them will
a) Make the stored procedure slower taking the same amount of time to execute as current query takes to complete.
b) Use more memory.
c) Put more stress on the network as all rows will be transferred at once instead of using the arraysize/fetchsize to to fetch the rows in smaller packets. -
Different ways to start a run?
We have written a C-Sharp application that is a GUI wrapper around TestStand to hand-hold the operator through setup and execution of a test. I have noticed the following behavior differences with each of the different ways to start a sequence file running:
a) When we useSequenceFileViewMgr.Run() to start the execution, TestStand does not prompt for a UUT serial number and it does not generate a DisplayReport event.
b) When we use SequenceFileViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set).Execute(true) to start the execution, TestStand does prompt for a UUT serial number and it does generate a DisplayReport event.
c) When we useSequenceFileViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 1).Execute(true) to start the execution, TestStand does not prompt for a UUT serial number and it does generate a DisplayReport event.
Are there other ways (better ways) to start an execution from a C-sharp application?
Behavior "C" is the behavior I am looking for, but I would like to understand why the calls have different results?
Can someone enlighten me?
Solved!
Go to Solution.tlaford,
What you're essentially doing is running different execution entry points. If you look at the execute menu in the sequence editor, you will see three options (with the default process model, if you have a custom process model, you may have a different number).
Test UUTs
Single Pass
Run <Name of current sequence>
When you call .Run() you're doing the same operation as Run <sequence name> from the menu. This runs just the currently selected sequence and nothing else. Great for debugging, but does not use the process model framework.
When you use one of the ExecutionEntryPoints, you are running one of the execution entry points from the process model. Those generally call into the MainSequence sequence of your client sequence file. And they perform other operations (such as gathering UUT data, and reporting) around the execution of your client file. The default process models have TestUUTs as index 0 and SinglePass as index 1.
Using the SequenceFileViewMgr is the best way to start a new execution from a user interface programmatically.
Hope this helps.
Josh W.
Certified TestStand Architect
Formerly blue -
I followed a procedure described in a book.
1. insert "Inventory.xml" file to a project "WpfXmlDataBinding" .
2. add the XML data source through the data panel of "blend for 2013", named it "InventoryXmlDataStore" and store it in the current document.
3. dragged and droppped the nodes from the Data panel onto the artboard.
Then I checked my Xaml file against the one provided by the book
Xaml file by the book:
<Window.Resources>
<!-- This part is missing in my xaml file --><XmlDataProvider x:Key="InventoryDataSource"
Source="\Inventory.xml"
d:IsDataSource="True"/>
<!-- This part is missing in my xaml file -->
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<ListBox HorizontalAlignment="Left"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="89,65,0,77" Width="200"/>
</Grid>
my Xaml file:
<Window x:Class="WpfXmlDataBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="922" Width="874">
<Window.Resources>
<DataTemplate x:Key="ProductTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@ProductID}"/>
<TextBlock Text="{Binding XPath=Cost}"/>
<TextBlock Text="{Binding XPath=Description}"/>
<CheckBox IsChecked="{Binding XPath=HotItem}"/>
<TextBlock Text="{Binding XPath=Name}"/>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid DataContext="{Binding Source={StaticResource InventoryXmlDataStore}}">
<ListBox HorizontalAlignment="Left" Height="370"
ItemTemplate="{DynamicResource ProductTemplate}"
ItemsSource="{Binding XPath=/Inventory/Product}"
Margin="65,55,0,0" VerticalAlignment="Top" Width="270"/>
</Grid>
</Window>
All looks quite the same except the <XmlDataProvider ....> part under <Window.Resources>, which is gone completely in my Xaml file.
1, Why?
2, How many different ways to deal with xml data source through WPF?
Thanks, guys.
(ps My "WpfXmlDataBinding" runs without problem through.)Never do yourself down Richard.
Leave that to other people.
It's quite common for smart developers to think they're not as good as they are.
I coach a fair bit and it's a surprisingly common feeling.
And to repeat.
Never use anything ends .. provider. They're for trivial demo apps. Transform xml into objects and use them. Write it back as xml. Preferably, use a database.
You want to read a little mvvm theory first.
http://en.wikipedia.org/wiki/Model_View_ViewModel
Whatever you do, don't read Josh Smiths explanation. I used to recommend it but it confuses the heck out newbies. Leave that until later.
Laurent Bugnion did a great presentation at mix10. Unfortunately that doesn't seem to be working on the MS site, but I have a copy. Download and watch:
http://1drv.ms/1IYxl3z
I'm writing an article at the moment which is aimed at beginners.
http://social.technet.microsoft.com/wiki/contents/articles/30564.wpf-uneventful-mvvm.aspx
The sample is just a collection of techniques really.
I have a sample which involves no real data but is intended to illustrate some aspects of how viewmodels "do stuff" and how you use datatemplates to generate UI.
I can't remember if I recommended it previously to you:
https://gallery.technet.microsoft.com/WPF-Dialler-simulator-d782db17
And I have working samples which are aimed at illustrating line of business architecture. This is an incomplete step by step series but I think more than enough to chew on once you've done the previous stuff.
http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
The write up for step2 is work in progress.
https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
I know this is a basic question but it seems there are several different suggestions on how to do this. So using AS3 with Adobe Flash CS4, what is the correct way to pass a variable from a server side script "PHP" to my SWF?
Thanksvar urlLdr:URLLoader = new URLLoader();
var urlVar:URLVariables = new URLVariables();
// add data to be sent
urlVar.data1 = "whatever";
urlReq.data=urlVar;
urlReq.method="POST";
// listen for data return
urlLdr.addEventListener(Event.COMPLETE, phpCompleteF, false, 0, true);
// call php
urlLdr.load(new URLRequest("yourphp.php"));
function phpCompleteF(e:Event) {
// i'm not sure everything needs to be "typed" but, it's prudent to do so
var vars:URLVariables=new URLVariables(URLLoader(e.currentTarget).data);
// vars contains your return data -
Please Suggest best way to pass Strings in a pipeline
I'm working in a project in which a line passes in a pipeline kind of situation.
The String is passed between different modules and each module adds some more data to it (or may even remove some of it).
Which is the best way to pass the String? I think java.lang.String might not be an efficient method because the String i'll be passing will be modified many times.
ThanxYes. StringBuffer or StringBuilder you can use.
String string = "test";
StringBuffer sb = new StringBuffer(string);later you will add some more strings to the StringBuffer
sb.append("Hello World");No additiional String object will be created. -
Best way to pass data sets to another program
Hey
I want to connect another (maths) program with my java application. Therefore I need to paste data (some kind of tab separated table) to this program.
I try now to save these data in a separate newly generated file and to pass a command with Java's Runtime.exec() method to this program to read these data. Is this a good idea or might there be better ways?
If I do so, is there a way in Java to generate some kind of a "temporary" file which will be deleted automatically after usage or is this nothing else than to save it in a common file and delete it afterwards. What's the best way to pass data generally?Well, the connection will not be over a network, so I'd rather think it's not a Socket or RMI problem (unless someone convinces me).
Yes it's very external, it's a C or C++ written program, I don't have any source codes. So far I generated a file for Input command and data, I passed that on to the maths program and returned the output into another file.
Now I would like to separate the output and like to obtain some tables and graphical things like charts at the output. Do I have to generate three different types of outputfiles? How to store some graphics e.g. some distributions. I thought even of generating a database. I never thought about XML, I don't know if this works for that kind of problem?! -
Is there any way to pass value from one SWF to another ?
I am doing project using flash, now I cant pass a value from one SWF to another, is there any way to pass value from one SWF to another.
thanksHi,
Just to confirm here do you simply want to communicate between two SWFs without involving Flash Media Server. If this is the case one good way of doing it is to use a local connection. It can be used for direct communication between two separate instances of the flash player. However if you want to involve multiple clients sharing a common variable then you may have to use Shared Object for this. Please let me know what is the actual use case, is it multiple clients sharing a common variable or different player instances communicating between themselves.
Thanks,
Abhishek
Maybe you are looking for
-
IPod can't be synced because there is not enough free space?
At first, my iPod couldn't be synced because 'playlists doesn't exist'(there's another forum about this and apparently this comment helped a lot of people... "Click on your 'DEVICE' on the left in ITUNES, click the music tab and where it says Sync Mu
-
Exception not handled by the Collaxa Cube system
Hi! i have plsql procedure and i published it as a web service using JDev 10.1.3, web service is deployed on OC4J 10.1.3. When i call it directly, everything works fine. When i make a BPEL process jast wrapping this web service (receive, assign, invo
-
Backup solutions for Solaris 10 systems
I am trying to put together a backup solution for a number of SunFire V240 systems running Solaris 10. We do run our backups using NetWorker, along with a couple of high powered back up systems. But this solution I am trying to create is something th
-
Delete Printers in HD/Library/Printers folder
On my wife's iBook we need to get her a bit more hard drive space (original 30 gb hd) so I am wondering if can we remove the Printer folders we don't expect to use in the HD/Library/Printers folder?
-
I have a new Macbook Air. How do I join iTunes to my bluetooth on my soundbar?