Creating 1-D array of type double
Hello,
I am not that good with the labview and when I was trying to build some example I got a error as in the attached image.
Can some help me in creating a simple 1-d array of type double in labview2011.
Thanks.
Solved!
Go to Solution.
Attachments:
Error_64-bit_real.JPG 24 KB
Go to Help>>Find Examples>> search for array>>open Build Array example.
-In the example they are using integer numeric control.
-If you want array of double type please change data type to double instead of I32.
-Please check this also http://www.ni.com/white-paper/7571/en/
Thanks
uday,
Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
Certified LabVIEW Associate Developer (CLAD) Using LV13
Similar Messages
-
Grabbing numbers from an array of type double and outputting them into a text file
In a program im creating i need to save some coordinates of a micropositioner i have into a text file,
I have the coordinates saved into an array that has 6 digits of precision (6 places after the decimal point).
I use the number to string conversion and wire that into the write to text file function in labview. When i open the file
the numbers that are only displayed are the ones to the left of the decimal point. I know the number to decimal string function
rounds the values so if i were to input 3.111111 it would only output the string "3" instead of "3.111111" .
So to get all the digits onto the file without rounding i multiplied the number by 10^6 but the decimal point will be lost at that point.
Is there anyway i can convert numbers into strings without labview rounding to the nearest whole number also without having to multiply by 10^6 and without having to expect the user to know that the coordinates saved in a file are multiplied by an order of magnitude of a million ?ed oh i guess i just missed that function on the pallete after i saw that the function went from number to hex, octal, etc. i assumed that the rest on that row would be some sort of conversion to a different base number, haha thanks.
-
Hello.
During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
ODCIIndexInsert in case of creating indextype WITH ARRAY DML option
According to Oracle documentation
http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
In case of WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
RETURN NUMBER
In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
Indextype was created as
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
or
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
(problem occurs in all cases)
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
When attempting to insert data in the table
insert into test_table values (1);
oracle raise exception
Error starting at line 53 in command:
insert into test_table values (1)
Error at Command Line:53 Column:1
Error report:
SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
29925. 00000 - "cannot execute %s"
*Cause: The specified function does not exist or does not have an
appropriate signature.
*Action: Implement the function with the appropriate signature.
So my question is.
Is it normal behavior of oracle (according to documentation)?
What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
static function ODCIIndexInsert(ia sys.odciindexinfo, ridlist sys.odciridlist, env sys.ODCIEnv) return number
Everything works too. But this approach doesn't satisfies our business needs.
Is it a way to define ODCIIndexInsert parameter types (in case of indexing number column) so that batch inserting works according to documentation ?
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
I am attaching full sql script to recreate environment and reproduce the problem.
Type definition:
CREATE OR REPLACE TYPE index_methods AS OBJECT
step number,
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
CREATE OR REPLACE TYPE BODY index_methods IS
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
BEGIN
ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
RETURN ODCIConst.Success;
END ODCIGetInterfaces;
STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexCreate;
STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexDrop;
STATIC FUNCTION ODCIIndexAlter (
ia sys.ODCIIndexInfo,
parms IN OUT VARCHAR2,
altopt NUMBER,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexAlter;
STATIC FUNCTION ODCIIndexUpdPartMetadata(
ia sys.ODCIIndexInfo,
palist sys.ODCIPartInfoList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexUpdPartMetadata;
STATIC FUNCTION ODCIIndexExchangePartition(
ia sys.ODCIIndexInfo,
ia1 sys.ODCIIndexInfo,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexExchangePartition;
STATIC FUNCTION ODCIIndexInsert(
ia sys.ODCIIndexInfo,
ridlist sys.ODCIRidList,
newvallist sys.ODCINumberList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexDelete(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
env SYS.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexUpdate(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
newval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexStart(
sctx IN OUT index_methods,
ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo,
qi sys.ODCIQueryInfo,
strt number,
stop number,
cmpval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
sctx := index_methods(1);
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexFetch(
self IN OUT index_methods,
nrows NUMBER,
rids OUT SYS.ODCIridlist,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
end;
Problem workaround:
--drop function test_eq_fun;
CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
BEGIN
IF a = b then
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
--drop operator test_eq;
CREATE OPERATOR test_eq
BINDING (number, number) RETURN NUMBER
USING test_eq_fun;
--drop indextype test_index_type;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
--drop table test_table;
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
insert into test_table values (1);I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
2 (
3 step number,
4 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
5 STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
6 STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
7 STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
8 STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
9 STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
10 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2, newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
11 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
12 STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
13 STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
14 STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
15 op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
16 MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
17 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
18 );
19 /
Type created.
SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
2 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
3 BEGIN
4 ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
5 RETURN ODCIConst.Success;
6 END ODCIGetInterfaces;
7
8 STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
9 BEGIN
10 RETURN ODCIConst.Success;
11 END ODCIIndexCreate;
12
13 STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
14 BEGIN
15 RETURN ODCIConst.Success;
16 END ODCIIndexDrop;
17
18 STATIC FUNCTION ODCIIndexAlter (
19 ia sys.ODCIIndexInfo,
20 parms IN OUT VARCHAR2,
21 altopt NUMBER,
22 env sys.ODCIEnv)
23 RETURN NUMBER IS
24 BEGIN
25 RETURN ODCIConst.Success;
26 END ODCIIndexAlter;
27
28 STATIC FUNCTION ODCIIndexUpdPartMetadata(
29 ia sys.ODCIIndexInfo,
30 palist sys.ODCIPartInfoList,
31 env sys.ODCIEnv)
32 RETURN NUMBER IS
33 BEGIN
34 RETURN ODCIConst.Success;
35 END ODCIIndexUpdPartMetadata;
36
37 STATIC FUNCTION ODCIIndexExchangePartition(
38 ia sys.ODCIIndexInfo,
39 ia1 sys.ODCIIndexInfo,
40 env sys.ODCIEnv)
41 RETURN NUMBER IS
42 BEGIN
43 RETURN ODCIConst.Success;
44 END ODCIIndexExchangePartition;
45
46 STATIC FUNCTION ODCIIndexInsert(
47 ia sys.ODCIIndexInfo,
48 rid VARCHAR2,
49 newval NUMBER,
50 env sys.ODCIEnv)
51 RETURN NUMBER IS
52 BEGIN
53 dbms_output.put_line ('single');
54 return ODCIConst.Success;
55 END;
56
57 STATIC FUNCTION ODCIIndexInsert(
58 ia sys.ODCIIndexInfo,
59 ridlist sys.ODCIRidList,
60 newvallist your_type,
61 env sys.ODCIEnv)
62 RETURN NUMBER IS
63 BEGIN
64 dbms_output.put_line ('batch');
65 return ODCIConst.Success;
66 END;
67
68 STATIC FUNCTION ODCIIndexDelete(
69 ia SYS.ODCIIndexInfo,
70 rid VARCHAR2,
71 oldval number,
72 env SYS.ODCIEnv)
73 RETURN NUMBER IS
74 BEGIN
75 return ODCIConst.Success;
76 END;
77
78 STATIC FUNCTION ODCIIndexUpdate(
79 ia SYS.ODCIIndexInfo,
80 rid VARCHAR2,
81 oldval number,
82 newval number,
83 env SYS.ODCIEnv)
84 RETURN NUMBER AS
85 BEGIN
86 return ODCIConst.Success;
87 END;
88
89 STATIC FUNCTION ODCIIndexStart(
90 sctx IN OUT index_methods,
91 ia SYS.ODCIIndexInfo,
92 op SYS.ODCIPredInfo,
93 qi sys.ODCIQueryInfo,
94 strt number,
95 stop number,
96 cmpval number,
97 env SYS.ODCIEnv)
98 RETURN NUMBER AS
99 BEGIN
100 sctx := index_methods(1);
101 return ODCIConst.Success;
102 END;
103
104 MEMBER FUNCTION ODCIIndexFetch(
105 self IN OUT index_methods,
106 nrows NUMBER,
107 rids OUT SYS.ODCIridlist,
108 env SYS.ODCIEnv)
109 RETURN NUMBER AS
110 BEGIN
111 return ODCIConst.Success;
112 END;
113
114 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
115 BEGIN
116 return ODCIConst.Success;
117 END;
118 end;
119 /
Type body created.
SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
2 BEGIN
3 IF a = b then
4 RETURN 1;
5 ELSE
6 RETURN 0;
7 END IF;
8 END;
9 /
Function created.
SCOTT@orcl12c> CREATE OPERATOR test_eq
2 BINDING (number, number) RETURN NUMBER
3 USING test_eq_fun
4 /
Operator created.
SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
2 FOR
3 test_eq(number, number)
4 USING index_methods
5 WITH ARRAY DML(number, your_type)
6 WITH LOCAL RANGE PARTITION
7 WITH SYSTEM MANAGED STORAGE TABLES
8 /
Indextype created.
SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
2 /
Table created.
SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
2 /
Index created.
SCOTT@orcl12c> insert into test_table values (1)
2 /
single
1 row created.
SCOTT@orcl12c> insert into test_table
2 select 2 from dual union all
3 select 3 from dual
4 /
batch
2 rows created.
SCOTT@orcl12c> insert into test_table select deptno from dept
2 /
batch
4 rows created.
SCOTT@orcl12c> insert into test_table select object_id from user_objects
2 /
batch
34 rows created.
SCOTT@orcl12c> -
Hi,
When I create a sales order with reference to a Quote, the pricing condition types are duplicating. Same is happening when subsequent documents like Billing, credit memo request and credit memo are created. Particularly, the condition types are doubled/tripled/.... in the subsequent documents. Because of this, pricing net value is calculated wrong. For example, freight charges getting added twice. I searched the forum and found similar issue was discussed at Condition types - Doubling UP raised by forum member Sridhar Vijjhalwar, however there is no solution added in it.
Has any other member came across this issue and resolved?
I have checked the access sequence and exclusive indicators are checked. Copy controls are also checked, looked good and I tested by adding copying type D/G. Checked OSS note also and found one OSS note 1459807 - Invoice has missing/incorrect conditions when created from a sales order.
but it is not solving the problem either. Issue also elevated to SAP for their investigation. Our system is SAP ECC 6.0 - EHP6.
Quote Pricing:
Sales order Pricing:
I appreciate any pointers to resolve the issue.
Regards,what was the scenario, and how did you replicate?
It is a configuration for a new project (France country), however we found that the same issue popping up for existing business processes also. As for replicating, we just tried the same procedures, the issue is found in subsequent documents.
If you have observed one notable thing is - all the condition types which duplicated were Z Conditions, and the standard conditions were never duplicated at least in my case.
In our case even standard condition types like MWST, SKTO, GRWR, VPRS also shows duplicating.
if you can throw about the business process?
As you have mentioned order created with reference to quote was only the straight forward scenario?
I tested other scenario also, like creating a sales order, then delivery and then billing. In this case in billing document, the condition types are duplicating. If I create a credit memo request against the billing document, then it further duplicating.
I am not sure what is causing this. I initially thought it may be copy control settings pertaining to the new project, however other business documents also has the same issue. Other business are using different document types.
Thanks for your follow-up.
Regards, -
How to create an new array from dynamically discovered type
public static Object toAdjustedArray(Object source, Object addition,
int colindex, int adjust) {
int newsize = 0;
Class componentType = null;
if (source.getClass().isArray()) {
Object[] arrayIn= (Object[])source;
componentType = arrayIn[0].getClass();
newsize = arrayIn.length + adjust;
else {
System.out.println("error in ArrayUtil");
Object[] newarray = new Object[newsize];
copyAdjustArray(source, newarray, addition, colindex, adjust);
return newarray;
}This methods take an array as an input an append new value(s) to it.
I can get the component type of the array (i.e. the class of the array's member). But how can I create a new array of this component type (i.e doing something like componentType[] newarray = new componentType[newsize])?
CU JeromeI fanally found a walkaround trick for my problem.
Their is no way to create an array of a certain type (dynamically dsicovered) in CLDC. But what you can do is to use the instanceof method to determine the type of your array and in a big if statement create the right array.
Here is the final code:
public static Object toAdjustedArray(Object source, Object addition,
int colindex, int adjust) {
int newsize = 0;
if (source.getClass().isArray()){
Object[] arrayIn= (Object[])source;
newsize = arrayIn.length + adjust;
Object arrayElement = null;
if (addition.getClass().isArray()){
Object[] temp = (Object[])addition;
arrayElement = temp[0];
else{
arrayElement = addition;
Object newarray = null;
if (arrayElement == null){
newarray = new Object[newsize];
if (arrayElement instanceof org.hsqldb.Index){
newarray = new org.hsqldb.Index[newsize];
else {
newarray = new Object[newsize];
copyAdjustArray(source, newarray, addition, colindex, adjust);
return newarray;
} -
. NET to call Oracle stored procedure, use an array of types of parameters
. NET to call Oracle stored procedure, use an array of types of parameters
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
Use System.Data.OracleClient
C# Code:
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[] { "11", "22" };
OracleParameter p1 = new OracleParameter("i_test", OracleType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.Value = str;
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleType.Int32);
p2.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 4, 2009 7:13 AM. NET to call Oracle stored procedure, use an array of types of parameters
The use of ODP.net(Oracle 10g), the error is still the same
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
ODP.NET(Oracle 10g)
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[2] { "11", "222" };
cmd.ArrayBindCount=2;
OracleParameter p1 = new OracleParameter("i_test", OracleDbType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p1.Value = str;
p1.ArrayBindSize=new int[2]{2,3};
p1.ArrayBindStatus = new OracleParameterStatus[2]{
OracleParameterStatus.Success,
OracleParameterStatus.Success
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleDbType.Int32);
p2.Direction = ParameterDirection.Output;
P2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p2.Value=0;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 5, 2009 7:48 AM -
How to assign values to instances of a method created via an array
i have created an array of the PlayerRecord instance called currentPlayers and im trying to use another array of Strings to give names to the players (currentPlayers[instance].name) but it is failing horribly
when i try to name them one at a time as seen in the code here it seems to compile fine, but when i test it with a System.out.println(currentPlayers[0].name); it tells me "Exception in thread "main" java.lang.NullPointerException"
Im assuming this happens because the instances of PlayerRecord were created using an array, therefore i could not give the PlayerRecord a name value to begin with, but shouldnt currentPlayers[0].name = namesarray[0]; make up for that and give the value in namesarray[0] to currentPlayers[0].name? therefore allowing me to display the value held in currentPlayers[0].name without the error?
public class Round
public static PlayerRecord[] currentPlayers = new PlayerRecord[15];
public Round(String[] namesarray)
currentPlayers[0].name = namesarray[0];
System.out.println(currentPlayers[0].name);
public class test
public static void main (String[] args)
String[] namelist= {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l","m", "n", "o", "p"};
Round one = new Round(namelist);
public class PlayerRecord
public String name;
public PlayerRecord(String playername)
name = playername;
}unfortunately the rest of the program relies on being
able to change the number of elements in the array,
so in the end a variable would take the place of the
15 in
public static PlayerRecord[] currentPlayers =
new PlayerRecord[15];so that would not work
It 'works', just not the way you supposed it would. :^)
It initializes an array of 15 elements with references to type Round. You need to assign those references to instances. The only way to create instances is via the 'new' keyword.
im surprised java isnt up there in the top reasons
for suicide
It's too early in the week for me to start drinking.....
actually now that i think about it, i could make it
work by having a definite amount of elements in the
array, but the array of names cannot be read since
they are connected to the Round method
Correct me if I am wrong, but you do already have a definite number of elements in your array. 15.
so basically the creation of the array of
currentPlayers has to be before the Round method, yet
the naming of the players has to happen in the Round
method, is there any way this can be done?
Round is not a method. It is your class's constructor (I think). Right before calling the setter for 'name', call 'new' and assign the created Round instance to that array element (in your case '0').
Then call 'name'.
Message was edited by:
s34nsm411- Saish -
Swapping values in an array of type Node
I have a simple class called Node that is storing integers and from this class I am creating an array:
public class Node {
private int iData;
public Node(int key)
iData = key;
public int getKey() {
return iData;
public void setKey(int id) {
iData = id;
} When I insert an integer into the array, I need to be able to look to the previous value and swap it if necessary so that for each insert the smallest number is always the first element.
The problem is that I keep getting "Incompatible Type" errors. I know the solution is very simple, but no matter what I try I keep getting this error.
//assume array has already been created
int temp = array[numOfNodes -1].getKey();
array[numOfNodes -1] = array[numOfNodes];
array[numOfNodes].setKey(temp); I understand why this is wrong, since temp is an integer and the value should be of type Node, but I do not know how to do this correctly.
Thanks
Edited by: jaden403 on Sep 22, 2007 1:17 PM
Edited by: jaden403 on Sep 22, 2007 1:17 PMdo not know how to do this correctly.
import java.util.Random;
public class IntNodeTest {
public static void main(String[] args) {
Random rand = new Random();
int range = 20;
int size = 5;
IntNode[] nodes = new IntNode[0];
for(int j = 0; j < size; j++) {
nodes = addNode(new IntNode(rand.nextInt(range+1)), nodes);
showArray(nodes);
private static IntNode[] addNode(IntNode node, IntNode[] nodes) {
// Make a new array to receive the new element.
IntNode[] temp = new IntNode[nodes.length+1];
// Copy the existing array into temp.
System.arraycopy(nodes, 0, temp, 0, nodes.length);
// Assign node to the last element in temp.
temp[nodes.length] = node;
return temp;
private static void showArray(IntNode[] nodes) {
for(int j = 0; j < nodes.length; j++) {
System.out.print(nodes[j].getKey());
if(j < nodes.length-1)
System.out.print(", ");
System.out.println();
class IntNode {
private int iData;
public IntNode(int key) {
iData = key;
public int getKey() {
return iData;
public void setKey(int id) {
iData = id;
} -
how do i create a dummy array
in my object obj1 i have a attribute which is of type obj2 array. obj2 is an object with 1 string and 1 time attribute.
i want to create a obj1 object and populate it with data which will include a populate obj2 array
-ThanksSounds like you want to create a group. A group can have a time and string. A group is an array by definition.
Option 1 Right mouse click the BPM object and click "Group". Right mouse click it again and create the string and time attributes.
Option 2 Optionally, you could create another BPM Object that has the two attributes (the time and string arrays). If you go this route you could add this BPM object as an attribute of another BPM object's group. Assuming your attribute's name is "myNewAttribute" and the object your created with the time and string is in the "Model.MyNewObject" BPM Object, you'd of course want to this to the constructor of the group's constructor:
myNewAttribute = Model.MyNewObject()Dan -
Hello,
We are seeing a lot of log messages like the one below when an MDO select query is run. There is a message for every numeric column. There doesnt seem to be any issue with the queries working properly its just creating a lot of log messages. Has anyone else had this issue?
Exception of type com.sap.sql.log.OpenSQLException caught:
Cannot fetch column 22, which has JDBC type DOUBLE, into a Java variable of type
float..
[EXCEPTION]
com.sap.sql.log.OpenSQLException: Cannot fetch
column 22, which has JDBC type DOUBLE, into a Java variable of type float.
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:83) ...Hi Christian,
You are right. As in your case it is a select query it does not reflect the error automatically. In my case, I had an insert query so it failed then and there, which was easier to debug and fix.
I have one question regarding your case. When you read the MDO using the query, what do you do with the output? Do you assign it to any local/transaction property in the output links of the query block or in a proceeding assignment block?
Because, the error mentions that the assignment of float to double datatype fails. So, in theory there should be some assignment done with the output.
Please check if you could figure out this part in your transaction.
Regards,
Saumya Govil -
StringIndexOutOfBoundsException using ARRAY data type
Hi all.
JDK 1.5.0_03, Oracle 9.2.0.4, 9i thin drivers.
I'm trying to use the ARRAY data type to submit a large amount of data to a stored procedure. Unfortunatley I'm getting an error when using the oracleCAllableStatement.setArray method. I've successfully set up my types in the database, and I can create my StructDescriptor and ArrayDescriptor objects but that's as far as I get.
Here's my code:
connection = ConnectionManager.getRawConnection(DatabaseProperties.CSA_DB);
connection.setAutoCommit(false);
ARRAY array = getDatabaseArray(timeSeriesList, date, connection);
String result = new String();
statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)");
statement.setARRAY(1, array);
statement.registerOutParameter(2, OracleTypes.VARCHAR, result);
statement.execute();
LOG.info(result);
connection.commit();
The line highlighted is where it fails. The exception is below. Unfortunatley its a Java exception rather than a Oracle one so not much help there.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 40
at java.lang.String.charAt(Unknown Source)
at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:123)
at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:69)
at oracle.jdbc.driver.OracleConnection.nativeSQL(OracleConnection.java:1181)
at oracle.jdbc.driver.OracleStatement.expandSqlEscapes(OracleStatement.java:6412)
at oracle.jdbc.driver.OracleStatement.parseSqlKind(OracleStatement.java:6401)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:152)
at oracle.jdbc.driver.OracleCallableStatement.<init>(OracleCallableStatement.java:77)
at oracle.jdbc.driver.OracleCallableStatement.<init>(OracleCallableStatement.java:48)
at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1134)
at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:988)
at com.db.csa.systems.csa.timeseries.DataArchivedTimeSeriesProvider.archiveTimeseriesForDate(DataArchivedTimeSeriesProvider.java:46)
at com.db.csa.experiments.TimeseriesArchiver.main(TimeseriesArchiver.java:26)
I'm now completely stuck as short of decompiling the class that's throwing the exception I have no idea what's going on.
Anyone got any ideas?
Thanks, Rob
Message was edited by:
user470390Hi,
Shouldn't:
statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)");be this:
statement = (OracleCallableStatement)connection.prepareCall("{call DATA_LOAD.ARCHIVE_TIMESERIES(?, ?)}");i.e. have a closing brace?
- Mark -
Question about Java Array Primative Type.
Say I create an Array of type Integer, like this:
Integer [] myArray = new Integer[10];
I now have an Integer array, 10 cells big.
However, I have now learned that I can do the following:
String [] [] [] stringArray = new String [3][3][3];
I can create higher dimensional arrays!
Is there any limit to the degree/dimension such an array may be,
and does the Array class presently support any methods, like getDimension,
to check the number of indices on an array where the number of indicies/dimensions
are a priori unknown?And as far as I know, their is not limit to the depth of the arrays as long as you stay within the memory boundaries.In practice the depth is limited by the range of a Java 'int', because the array descriptor in the .class file is a String starting with the appropriate number of [ characters.
-
Creating dynamic sized arrays and filling them automatically on speedy 33
hi all,
I am trying to create dynamic sized arrays on Speedy-33. Specifically, depending on the user input, I want to be able to create
arrays with 128 or 256 elements and fill them automatically. However,
array constant element is fixed for Speedy 33; thus I have to manually set the
size of the array with the mouse and enter the values in to the array by
myself. I want to make this tedious process automatic. Would this be possible? thanks so much for comments!
~casiopeaCasiopea,
There is a really great article on using arrays with LabVIEW DSC which can be found here:
How Can I Be Successful With Arrays In the LabVIEW DSP Module?
One of the biggest things that should be noted about DSP is that there is no dynamic memory allocation. Your array size must be fixed, and thus, your array needs to be initialized by using a constant.
An easy way to initialize an array constant that has many elements that are all the same is to simply create a numeric constant that has the value that you want. Then, create a new blank array constant and drag the numeric into it. In the index input for the array constant, type in the index of the last element that you want to be initialized. Then type in the value in the element that is displayed and all of the elements before it will be initialized to the default value of the numeric constant that you dropped into the array constant. I hope this helps. I would really recommend reading through that article, as it has a lot of great information about using arrays with DSC.
Brian Coalson
Software Engineer
National Instruments -
Clearing the array of type Serializable
Hi all,
In my process request of my controller i have the following code:
String umxRegParams = pageContext.getParameter("UMXRegParams");
Serializable parameters[] = {umxRegParams};
basically I'm getting the parameter of UMXRegParams from the pagecontext and storing it into an array called parameters[].
What i want to do is to be able to clear whatever is in parameters[] when press the apply button in process form request. Is this possible?
Thankswhen you creating new object parameter of Type of Serializable [] then it already empty.
you can do also in this way
Serializable parameter[] = null;
Thanks -
Reg: PLS-00418: array bind type must match PL/SQL table row type error
I am trying to access a table of records through JDBC OracleCallableStatement. I am able to do it fine for all mappings except for the ones below
TYPE CAT_CD_TYPE IS TABLE OF A.B %TYPE INDEX BY BINARY_INTEGER;
TYPE ORG_CD_TYPE IS TABLE OF C.D %TYPE INDEX BY BINARY_INTEGER;
Column B is CHAR(1) and Column D is CHAR(2). I am trying to register the out parameters of Oraclecallablestatement as
cstmt.registerIndexTableOutParameter(2, 2000, OracleTypes.CHAR, 0);
cstmt.registerIndexTableOutParameter(3, 2000, OracleTypes.CHAR, 0);
All the other mappings work fine. These two fail with the error
SQLException in invokeDBPackage() : ORA-06550: line 1, column 32:
PLS-00418: array bind type must match PL/SQL table row type
ORA-06550: line 1, column 35:
PLS-00418: array bind type must match PL/SQL table row type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I tried other OracleTypes mappings too but no luck so far.
Any advice on this would be greatly appreciated.Hi,
I'm not sure it's reasonable to expect someone to sift through that much stuff.
Which parameter is it having a problem with?
Can you modify the following to reproduce the behavior?
Thanks
Greg
create package mypack5 as
TYPE v2array is table of emp.ename%type index by BINARY_INTEGER;
PROCEDURE test_it(thearray IN v2array, numrecs out number);
END;
CREATE or replace PACKAGE BODY MYPACK5 AS
PROCEDURE test_it(thearray IN v2array, numrecs out number)
IS
begin
numrecs := thearray.count;
END;
END;
using System;
using System.Data;
using Oracle.DataAccess.Client;
public class indexby
public static void Main()
OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;");
con.Open();
OracleCommand cmd = new OracleCommand("mypack5.test_it", con);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter Param1 = cmd.Parameters.Add("param1", OracleDbType.Varchar2);
Param1.Direction = ParameterDirection.Input;
Param1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
Param1.Size = 3;
string[] vals = { "foo", "bar", "baz" };
Param1.Value = vals;
OracleParameter Param2 = cmd.Parameters.Add("param2", OracleDbType.Int32, DBNull.Value, ParameterDirection.Output);
cmd.ExecuteNonQuery();
Console.WriteLine("{0} records passed in", Param2.Value);
con.Close();
}
Maybe you are looking for
-
XML PO Output for Communication does not show barcode on PDF
Hi, I am attempting to add a barcode to the PO Output for Communication XSL style sheet. I am doing this by calling 2 RENDERX XSL style sheets, the second containing an SVG template. I have successfully accomplished this locally on my personal comput
-
Error Installing DVDSP 3 Upgrade
New to discussions. First post. Recently acquired DVD Studio Pro v1 + v3 upgrade intending to install under OS X 10.3.9 on mirrored RAID drives. Tried to install v3 upgrade without first installing v1, hoping it would merely prompt for valid license.
-
Add Captions to a Recorded Adobe Connect Meeting
We have several archived meetings using Adobe Connect that we'd like to belatedly add closed captions to for when people view these at home. Is there an easy way to do this via Adobe Connect, or will we need to download the file and add the CC ourse
-
I know I posted this before, but I didn't get an answer which adequately explained my problem. I did a Batch rename of 179 photos of 300 in a folder; the others were rejected. Then, I exported them as reduced sized jpegs. I had other programs open, B
-
Mac OS X Leopard iSync problem
I use iSync I rely upon iSync Now on Mac OS X 5 (Leopard) my USB-connected Nokia phone (6136) is not recognised by iSync because of some incompatibility between the software on the phone and on the Mac. System Profiler can see phone when connected in