How to pass an array to a subroutine in FXscript?
Hi,
I am having problems trying to pass an array to a subroutine in FXscript. Code segment:
on TestSub(value x)
// do stuff
end
float i, testarray[256];
for i = 0 to 255
testarray[i] = i;
next
TestSub(testarray);
FXscript returns the error "missing close parenthesis". If TestSub(testarray) is replaced with TestSub(testarray[0]) no error, i.e. if a single value is passed.
Trying to define the subroutine differently doesn't help, e.g. "on TestSub(value x[255])" or "on TestSub(float x[255])" yields the same error.
How do you pass an array to an FXscript subroutine? Or is it not possible?
Thanks for any clues...
You are not being quite clear. If the next frame expects a pointer to a buffer, it cannot be a vi. Labview has no pointer types. You must be referring to a Call Library Node which is set up to call a DLL function. If this is the case, you need to configure the Call Library Node to accept an array of the data type. Then you can wire the array into the call library node.
Is this the case, Call Library Node?
- tbob
Inventor of the WORM Global
Similar Messages
-
How to pass int array as an IN parameter to PLSQL Procedure
Hi,
How to pass int array in java to a stored procedure througn jdbc
and what type of data type I should declare to this IN parameter
in PLSQL Procedure.
Thanks,
SimiHi,
The best way to do what you want depends on what you want. Start by describing what you need to do. It's best to post some sample data (CREATE TABLE and INSERT statments) and what results you want from that sample data. (See the forum FAQ: https://forums.oracle.com/message/9362002)
If you have ideas about how to do the job (e.g., populating a temporary table) it can be helpful to include those, too, but distinguish clearly between WHAT you need to do and HOW you might do it.
As Bencol suggested, a SYS_REFCURSOR might be the best way to pass back the results.
Since you didn't post your table, or even describe what you wanted to do with it, I'll illustrate using scott.emp, which is probably on your system.
Say you wanted a procedure that took a DATE as an argument, and returned a some designated columns (empno, ename and hiredate in the example below) for all employees hired on or after the given DATE. You might write a procedure like this:
CREATE OR REPLACE PROCEDURE hired_since
( start_date IN DATE
, out_data OUT SYS_REFCURSOR
AS
BEGIN
OPEN out_data FOR
SELECT empno, ename, hiredate
FROM scott.emp
WHERE hiredate >= start_date;
END hired_since;
SHOW ERRORS
You can test it in SQL*Plus like this:
VARIABLE c REFCURSOR
EXEC hired_since (DATE '1982-01-01', :c);
PRINT :c
The output I got from this test was:
EMPNO ENAME HIREDATE
7788 SCOTT 19-APR-87
7876 ADAMS 23-MAY-87
7934 MILLER 23-JAN-82 -
I am ussing a DLL created by another party. I have the list of the C declaretions. I have been able to write a seq that can turn the comport ON/OFF or select a different port but I have not been able to send or recieved any data. I have created an array of bytes(unsigned 8-bit integers)to send and recieved data but nothing goes out or in.
Hi Toro,
There is an example in your \Examples\AccessingArrays\PassingArrayParametersToDLL directory that illustrates exactly how to pass TestStand arrays as arguments to dll functions. The source files for the .dll are located in the same directory.
For more information on passing arrays as parameters to modules you should read the "DLL Flexible Prototype Adapter" section of Chatper 13 in the TestStand User Manual, and pay special attention to the subsection entitled "Array Parameters". You can access the User Manual from the TestStand Start Menu group, the TestStand Sequence Editor's Help menu, the \Doc directory, or online at the following link:
http://digital.ni.com/manuals.nsf/websearch/50B69DA356B8D38C86256A0000660E6B?OpenDocumen
t&node=132100_US
Jason F.
Applications Engineer
National Instruments
www.ni.com/ask -
How to pass an array to a stored procedure
create or replace package demo_pkg
as
type cityArray is table of city%rowtype index by binary_integer;
procedure city_report( p_inputs in cityArray );
end;
CREATE OR REPLACE PACKAGE BODY demo_pkg
AS
PROCEDURE city_report (p_inputs IN cityarray)
IS
BEGIN
FOR i IN 1 .. p_inputs.COUNT
LOOP
DBMS_OUTPUT.put_line ( 'citycode = '
|| p_inputs (i).city_code
|| ' CITYDESCRIPTION = '
|| p_inputs (i).city_description
INSERT INTO testing
(city_code, city_description
VALUES (p_inputs (i).city_code, p_inputs (i).city_description
commit;
END LOOP;
END;
END;
to call that procedure ia m using this
declare
my_data demo_pkg.cityArray;
begin
my_data(1).city_code := 1234;
my_data(1).CITY_DESCRIPTION := 10;
my_data(2).city_code := 4567;
my_data(2).CITY_DESCRIPTION := 20;
my_data(3).city_code := 4321;
my_data(3).CITY_DESCRIPTION := 30;
demo_pkg.city_report( my_data );
end;
but actually the procedure (demo_pkg.city_report)is called from front end(.net).how they will call this procedure in .net invironmentHi,
Your exact question has been asked before, see: http://asktom.oracle.com/pls/ask/search?p_string=How+to+pass+an+array+to+a+stored+procedure
or do a search on this forum.
And please use this tag => (yes, just the 4 characters forming the word 'code' between curly brackets)
*before* and *after* your example to maintain formatting and indentation, it's hard to read now.... -
How to pass an Array to jsp:param
Hi,
I am trying to find out how to pass an array to a jsp:param tag abnd then retrieve
the values in the next page. Please help soon. Thanks
Here's my code - Assume the books array has more than 1 value
String[] books = request.getParameterValues("book");
<jsp:include page="<%=contentPage%>" flush="true">
<jsp:param name="bookSelected" value="<%= books %>" />
</jsp:include>
The 'contentPage' takes me to the next page where I have the following to retrieve
the value of 'bookSelected'
String[] bookSelected = request.getParameter("bookSelected");
I tried accessing the array like this
if(bookSelected.equals("book1"))
but did not succeed.
I tried accessing the array in a loop but it did not work. Here's what I tried.
<jsp:include page="<%=contentPage%>" flush="true">
<%for (int i = 0; i<books.length; i++){
%>
<jsp:param name="bookSelected" value="<%= books %>" />
<% } %>
</jsp:include>
Hi
tell me how you redirect from __confirmdelete.jsp:__ to deleteServlet.java..
and post detail code of __confirmdelete.jsp:__ -
How to pass an array which in the jsp to a javascript file
now i have 2 files: jsp and js(javascript)
i want pass an array which in the jsp to another file--> js file
how can i do it ???
can u give me some related links or some source codes as the references???
thxbcos ....my senior has resigned!!! so i take over his job !!!!!
depend on the talent and the project ....only that way to implement to whole project !!!!
but , i had settled it already ....
it is very simple
in the middle.jsp
Collection result = menuManager.getUserRoleMenu(webSessionUser.getGnuserId());
String menuname[]=new String[110];
int menucounter=0;
Iterator vi = result.iterator();
while(vi.hasNext())
HashMap hm=(HashMap)vi.next();
menuname[menucounter]=hm.toString();
menucounter++;
int i;
String tempstr="";
for(i=0;i<menuname.length;i++)
tempstr+=menuname[i]+",";
session.setAttribute("menuname",tempstr);
%>
<script language="javascript">
menu123("<%=tempstr %>");
</script>
in the body,js
function menu123(string123)
//doing
so ....through the script --menu123
i can get the string from jsp to the js!!!!!
is it very simple, but it spends my 2 days!!!
i just learn javascript ....about 1 month !!! -
How to pass an array in Oracle Procedure
If I have to pass an array as an argument in Oracle Procedure/function. How to do that ??
For example, I have to pass the names of employess and then for these employess I have to do something in Oracle Procedure.
Thanks & Regards,
VinayHi!
Here is an example:
create or replace procedure test
is
type v2_itt is table of varchar2(2000) index by binary_integer;
l_v2 v2_itt;
procedure test2( pi_v2 v2_itt ) is
begin
for i in 1 .. pi_v2.count loop
dbms_output.put_line( pi_v2(i) );
end loop;
end;
begin
l_v2(1) := 'name1';
l_v2(2) := 'name2';
test2( l_v2 );
end;
Regards,
Andrew Velitchko
BrainBench MVP for Developer/2000
http://www.brainbench.com -
How to Pass String array from Java to PL/SQL and this use in CURSOR
hi,
I cant understand how to pass Array String as Input Parameter to the Procedure and this array use in Cursor for where condition like where SYMPTOM in( ** Array String **).
This array containing like (SYMPTOM ) to be returned from the java to the
pl/sql (I am not querying the database to retrieve the information).
I cannot find an example on this. I will give the PL/SQL block
create or replace procedure DISEASE_DTL<*** String Array ***> as
v_SYMPTOM number(5);
CURSOR C1 is
select distinct a.DISEASE_NAME from SYMPTOM_DISEASE_RD a
where ltrim(rtrim(a.SYMPTOM)) in ('Fever','COUGH','Headache','Rash') ------- ***** Here use this array element(like n1,n2,n3,n4,n5..) ******
group by a.DISEASE_NAME having count(a.DISEASE_NAME) > 3 ----------- ***** 3 is no of array element - 1 (i.e( n - 1))*****
order by a.DISEASE_NAME ;
begin
for C1rec IN C1 loop
select count(distinct(A.SYMPTOM)) into v_SYMPTOM from SYMPTOM_DISEASE_RD a where A.DISEASE_NAME = C1rec.DISEASE_NAME;
insert into TEMP_DISEASE_DTLS_SYMPTOM_RD
values (SL_ID_SEQ.nextval,
C1rec.DISEASE_NAME,
(4/v_SYMPTOM), --------**** 4 is no of array element (n)************
(1-(4/v_SYMPTOM)));
end loop;
commit;
end DISEASE_DTL;
Please give the proper solution and step ..
Thanking you,
AsishI've haven't properly read through your code but here's an artificial example based on a sql collection of object types - you don't need that, you just need a type table of varchar2 rather than a type table of oracle object type:
http://orastory.wordpress.com/2007/05/01/upscaling-your-jdbc-app/ -
How to pass an array to a function from a SELECT statement
Hi all. I have a problem with passing an array to a function directly from a SELECT statement.
Here is what I want. If I have a function
function AAA(arrayVar <ArrayType>) return number;
I want to be able to call this function this way
select AAA((2,3,4))
from dual
or this way
select AAA((10,12))
from dual
In other words I want to be able to pass an arbitrary number of numbers to the function. And I want this to work in a SELECT statement.
Does anyone have any ideas how to implement this? What <ArrayType> should I use?(I've read about VARRAY, nested tables in the Oracle documentation but as far as I've understood these array types are meant to be used within PL/SQL blocks).
I found only this http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:208012348074 through Google but it didn't help me.
Thank you in advance.> What <ArrayType> should I use?
SQL data types - as 3360 showed above. You cannot use PL/SQL structures and user types in the SQL Engine.
You can however use all SQL structures and types in PL/SQL.
Arrays in SQL is created as collection type - basic o-o. The collection type (or class) serve as a container for instantiated objects or scalar type.
This is covered in detail in [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14260/toc.htm]
Oracle® Database Application Developer's Guide - Object-Relational Features -
How to pass an array to a procedure & how to use array in IN clause in SQL
Hi all,
how do i pass an array of varchar2[10] in an procedure and i want to use this array in the IN caluse of the SQL statement inside the procedure. Can anyone please help me on this.
Thanks & regards
shyam~There are multiple ways. For example:
SQL> create or replace
2 type str10_tbl_type is table of varchar2(10)
3 /
Type created.
SQL> -- Using TABLE operator
SQL> create or replace
2 procedure p1(
3 p_str10_tbl str10_tbl_type
4 )
5 is
6 begin
7 for rec in (
8 select ename,
9 sal
10 from emp,
11 table(p_str10_tbl)
12 where ename = column_value
13 ) loop
14 dbms_output.put_line(rpad(rec.ename,10) || rec.sal);
15 end loop;
16 end;
17 /
Procedure created.
SQL> set serveroutput on format wrapped
SQL> exec p1(str10_tbl_type('KING','ALLEN','SMITH'));
KING 5000
ALLEN 1600
SMITH 800
PL/SQL procedure successfully completed.
SQL> -- Using MEMBER OF method
SQL> create or replace
2 procedure p1(
3 p_str10_tbl str10_tbl_type
4 )
5 is
6 begin
7 for rec in (
8 select ename,
9 sal
10 from emp
11 where ename member of p_str10_tbl
12 ) loop
13 dbms_output.put_line(rpad(rec.ename,10) || rec.sal);
14 end loop;
15 end;
16 /
Procedure created.
SQL> set serveroutput on format wrapped
SQL> exec p1(str10_tbl_type('KING','ALLEN','SMITH'));
SMITH 800
ALLEN 1600
KING 5000
PL/SQL procedure successfully completed.
SQL> SY. -
How to pass an array of values to a view criteria
Hi all,
How to pass mutiple values as array into a view criteria.I want to search
based on mutiple values.
Please help.
ThanksSwapna wrote:
I have a search panel with mutilselect combobox for attributes "a","b", & "c".
Based on selction"a" ,I need to filter the comboboxes "b" and "c".
This's the requirement.I'm not sure that I understand your question. Are you saying that you have three different controls in your UI? Or one control that has three possible values?
Assuming that you have one control with three possible values, if "a" is selected, does that mean that you want all rows where some column has a value of "a"? Or does that mean that you want all rows where that column does not have a value of "a"? Or does that mean that you want all rows where that column has a value of "b" or "c" (note that the last two may be different if the column allows NULL values).
What language is your application written in? What framework/ library are you using to access the database? Are you passing a PL/SQL collection of selected values?
Justin -
Is there a way to pass an array or structure for example as parameters, in addition to a query, or multiple queries to the Report Builder in CF8? I believe this was recommended by users to be in CF8.
BrianO,
Although it's been a while, I thought I'd provide the code to do this for you. It works for me in CF8, and probably will in CF7.
Here I create a structure called My, and provide that one parameter to my CFReportParam tag.
<CFSet My = {
Client = "Client Name",
ReportDateFrom = DateFormat(ThisStartDate, DateMask),
ReportDateTo = DateFormat(ThisEndDate, DateMask),
PageHeaderImage = ImagePath & "\Logos\Page_Header.png",
WatermarkImage = ImagePath & "\Logos\Watermark.png",
GetBarSummary = GetBarSummary,
GetPieSummary = GetPieSummary
}>
<CFReport Template="#ReportPath#\SpendSummary.cfr" Format="PDF" Query="GetSummary">
<CFReportParam Name="My" Value="#My#">
</CFReport>
Inside the report itself, reference the given parameter as Param.My.PageHeaderImage for example. It can be referenced that way from any expression inside the report builder. You can even use the queries as the data source for charts (using the Data From a Query -> Query Builder -> Advanced) by entering "Param.My.GetPieSummary" where it says "Variable containing query object".
HTH
Swift -
How to pass vector array to JasperReport
I have a query looks like this... in my JasperReport. (select * from employee where employee_id = $P{Emp_ID} order by employee_id)
I already created a vector array contains a list of employee IDs from database. Now, I want to pass the array into the query to get a specific list of employees.
Similar to SQL prompt below.
SQL> select * from employee where employee_id in (1,3,4,5,22,23,45) order by employee_id.jasontey,
I'm doing the samething here but with arrays and I'm getting ClassCastException.
Servlet1:Vector PatientInfoVector = new MdlPatient().getPatientInfo(userId,patientNumber);
int patientLength = PatientInfoVector.size();
MdlPatient[] PatientInfoArray = new MdlPatient[patientLength];
for (int i=0; i<patientLength; i++)
PatientInfoArray[i] = (MdlPatient)PatientInfoVector.elementAt(i);
session.setAttribute("patientSession",PatientInfoArray);
response.sendRedirect(response.encodeRedirectURL("/FsuSecurity/SrvSecurity"));
SrvSecurity:
MdlPatient PatientInfo = (MdlPatient)session.getAttribute("patientSession"); This is where I'm getting the ClassCastException.
int patientNumber = PatientInfo.getPatientNumber();
Thanks if you can help,
Doug -
How to pass 1D array into matlab?
1 had 2 1-D array
array1 = 1D array signed 32-bit integer numeric
array2 = 1D array double-precision floating-point numeric
how do i pass this 2 arrays to matlab script??
help....as i'm very new to both labview and matlab.
thks,lynLabVIEW has a Matlab Script Node (Programs >> Mathematics >> Formula) that you can use to interface between the two programs. To pass arrays into the script node do the following:
1. Right-click on the left edge and select "Add Input"
2. Give the input a variable name in the termainal that was created.
3. Right click on the terminal and select Choose Data Type >> Real Vector.
You can now wire the 1D array to this terminal. You enter your Matlab Commands as text inside the node and you can create outputs the same way to created inputs. -
How To Pass an Array from One Frame in a Sequence to a ptr in the next Frame
I have an array (generated from the "Replace Array Subset" VI) that I
wish to pass to the next sequence in a frame.
In this second frame, however, the VI that this data will go into
expects it as a pointer to a buffer.
Of course in C, the array name is the pointer to the array itself, but
apparently this is not the case in Labview..
because if I wire the output array to the edge of the frame (Blue
solid blox - "Tunneling'?), and then try to connect
that blue box in the second frame, to the VI expecting a pointer and
the wire connection gets broken, and the blue
solid box goes empty.
How Can I do this??You are not being quite clear. If the next frame expects a pointer to a buffer, it cannot be a vi. Labview has no pointer types. You must be referring to a Call Library Node which is set up to call a DLL function. If this is the case, you need to configure the Call Library Node to accept an array of the data type. Then you can wire the array into the call library node.
Is this the case, Call Library Node?
- tbob
Inventor of the WORM Global
Maybe you are looking for
-
How do I manage 2 Ipads and 2 iphones on one ITunes account.
How do I manage 2 Ipads and 2 iphones on one ITunes account. Each device has a different name. But every time I plug them into iTunes on my Pc all the apps get screwed up. apps disappear etc. I have "sync apps" selected without automatic updates. I
-
Can you restrict a user in ASDM to only allow them to log a user out of a VPN session
We support many clients and we have found that many of them are sharing VPN credentials when logging in via AnyConnect/WebVPN. We were thinking about restricting simultaneous log in to 1. I also know that users may have situations where they lock up
-
Exchange Passive Node Failover - Getting An Error While Installing Mailbox Role in Passive Node
Hello, I was having Exchange 2007 CCR in Two Nodes, Due to hardware fail my passive node is crash. Now i want to recover my passive node i follow this steps http://www.msexchange.org/articles-tutorials/exchange-server-2007/high-availability-recovery
-
Photoshop crashing on startup after update
Hello. I just updated my photoshop cc and now it will not open...again. This happened last time I updated also. 4 days ago I applied this fix ( Re: Photoshop CC crashes after startup due to application error in PlugPlugOwl.dll? ) and it worked. I sa
-
I have forgotten my answers of security question
I have forgotten my answer for my security question, I tried to go on dicussion.apple.com look at all the question for this discussion/solutions I'm starting to get angry I just brought a 15 dollar gift card and now I can't use it