Columns for spreadshee​t with arrays
I have a data acquisition program that saves arrays as .txt files for
further analysis. I'm writing a program and having problems getting the
data in 4 columns like I want.
My data consists of 4 files, 10 data points obtained per iteration.
Each iteration is saved as a new column. The files have a lot more that
2 columns in reality. For example
A B C D
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
I would like som
e help in getting my 4 files put into one file,
consisting of 4 columns only. I would like my data to look as follows.\
A B C D
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
1 3 5 7
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
2 4 6 8
and so on. Essentially I want to take each iteration of data and place
underneath the previous iterations data in one column. I have tried
many different methods with for loops and various array tools and can
not get it right. Any ideas and help would be greatly appreciated!
Heather
Sent via Deja.com http://www.deja.com/
Before you buy.
> How about...
>
> If you open your text files into strings, then 'match pattern' within
a
> while loop or otherwise search the strings to replace any 'newline'
> characters with Tabs. If you then convert the string to an array, you
should
> have one long row. You can then transpose this to one long column with
one
> of the array tools - 'reshape array' maybe - I can't remember. If you
do
> this for all 4 files, then use 'build array' to stick them together,
you
> should get what you want.
>
> Paul
>
>
Paul,
Thanks for your help. I used the match pattern to find and replace
the new line characters with tabs. The four columns have 10 data
points, then two zero's separating them from the next 10 points. I used
the same idea to get rid of the retur
n characters and replace them with
tabs, which got rid of one row of zeros. I've tried the same idea using
backspace, form feed, space characters, etc, and I still have one row of
zeros separating my data points. Do you have any idea what this
character could be? I tried all of the characters in the manuals and
none will get rid of this problem. Again, thank you very much for your
push in the right direction!
Heather
Sent via Deja.com http://www.deja.com/
Before you buy.
Similar Messages
-
Help me for get this with array
I have a 2D array of integer number. I need compare each element of array and determine if this number is greater than 0.8; if number is greater than 0.8 I must remain the number, else if the number is less than 0.8 I must replace the element for a cero "0".
I would like thet you do suggestions for this. Help. I think use search 1D Array, but my array is 2D....Thankstyk007 wrote:
My advice would be similar to the brute force method mentioned with nested FOR loops, though I would tend to using the In Place Element structure and using the indices of the FOR loops to specify the index that needs checking. This also limits memory allocation if the 2D array is particularly large.
While the in place element is a good suggestion there is no benefit or advantage to using the loop index instead of using auto indexing. Is there a reason you believe this is a better approach?
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot -
Hi All,
We have a report with two dimensions in col , one in row remaining in pov...user want to select multiple members [its more than 10 members..so we thought prompts will not be good.] for one column for different members in second dimension of column and want see the variance between them.
can anyone suggest me how can i achieve this. thank you
regards,
RaviHi All,
Can any one suggest me on this. thanks inadvance.
Regards,
Ravi -
What index is suitable for a table with no unique columns and no primary key
alpha
beta
gamma
col1
col2
col3
100
1
-1
a
b
c
100
1
-2
d
e
f
101
1
-2
t
t
y
102
2
1
j
k
l
Sample data above and below is the dataype for each one of them
alpha datatype- string
beta datatype-integer
gamma datatype-integer
col1,col2,col3 are all string datatypes.
Note:columns are not unique and we would be using alpha,beta,gamma to uniquely identify a record .Now as you see my sample data this is in a table which doesnt have index .I would like to have a index created covering these columns (alpha,beta,gamma) .I
beleive that creating clustered index having covering columns will be better.
What would you recommend the index type should be here in this case.Say data volume is 1 milion records and we always use the alpha,beta,gamma columns when we filiter or query records
what index is suitable for a table with no unique columns and primary key?
col1
col2
col3
MudassarMany thanks for your explanation .
When I tried querying using the below query on my heap table the sql server suggested to create NON CLUSTERED INDEX INCLUDING columns ,[beta],[gamma] ,[col1]
,[col2] ,[col3]
SELECT [alpha]
,[beta]
,[gamma]
,[col1]
,[col2]
,[col3]
FROM [TEST].[dbo].[Test]
where [alpha]='10100'
My question is why it didn't suggest Clustered INDEX and chose NON clustered index ?
Mudassar -
RPD - Cannot obtain number of columns for the query result :Working with MS SQL 2012 schema
Hi All,
I have created my warehouse in MS SQL 2012.
For management purpose, I have created different schemas in SQL database
In RPD, Physical layer, when i view data > I get error as
[nQSError:16002] Cannot obtain number of columns for the query result.
[nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name 'tbl'..
[nQSError:16001] ODBC error state : S0002 code : 208 message: [Microsoft][ODBC SQL Server Driver][SQL Server] Statements could not be prepared..
I have already browsed : OBIEE 11g Strange ODBC Driver Error with SQL Server : Total Business Intelligence ... did not help me
please help!!!Hi All,
After all R&D it is been found that Oracle business administrator( RPD) needs default dbo schema. It doesn't accept custom schema for pulling data.
If anybody have other views please share.!!
Thank you -
IDM with SQL server Error: Cannot find columns for the table...
Hi all,
I am Configuring IDM with SQL Server repository and ran into this error.
'Cannot find columns for the table 'object'
.....jdbc...[SQL Server]Invalid object name 'object'
Can anybody please help me!!
GYes, permissions are very important. I ran into a similar problem because I didn't have the correct permissions. Make sure the user has the following permissions:
CREATE ANY TABLE
ALTER ANY TABLE
DROP ANY TABLE
CREATE ANY PROCEDURE
EXECUTE ANY PROCEDURE
DROP ANY PROCEDURE
Also, make sure there is enough space in the default tablespace of that user.
HTH
~Suvesh -
Conflict resolution for a table with LOB column ...
Hi,
I was hoping for some guidance or advice on how to handle conflict resolution for a table with a LOB column.
Basically, I had intended to handle the conflict resolution using the MAXIMUM prebuilt update conflict handler. I also store
the 'update' transaction time in the same table and was planning to use this as the resolution column to resolve the conflict.
I see however these prebuilt conflict handlers do not support LOB columns. I assume therefore I need to code a customer handler
to do this for me. I'm not sure exactly what my custom handler needs to do though! Any guidance or links to similar examples would
be very much appreciated.Hi,
I have been unable to make any progress on this issue. I have made use of prebuilt update handlers with no problems
before but I just don't know how to resolve these conflicts for LOB columns using custom handlers. I have some questions
which I hope make sense and are relevant:
1.Does an apply process detect update conflicts on LOB columns?
2.If I need to create a custom update/error handler to resolve this, should I create a prebuilt update handler for non-LOB columns
in the table and then a separate one for the LOB columns OR is it best just to code a single custom handler for ALL columns?
3.In my custom handler, I assume I will need to use the resolution column to decide whether or not to resolve the conflict in favour of the LCR
but how do I compare the new value in the LCR with that in the destination database? I mean how do I access the current value in the destination
database from the custom handler?
4.Finally, if I need to resolve in favour of the LCR, do I need to call something specific for LOB related columns compared to non-LOB columns?
Any help with these would be very much appreciated or even if someone can direct me to documentation or other links that would be good too.
Thanks again. -
How to get number of rows and columns in a two dimensional array ?
Hello,
What would be the simplest way to get number of rows and columns in a two dimensional array represented as integers ?
I'm looking for another solution as For...Each loop in case of large arrays.
Regards,
PetriHi Petri,
See a attached txt file for obtaining two arrays with upper and lower index values
Regards
Ray
Regards
Ray Farmer
Attachments:
Get2DArrayIndex.txt 2 KB -
How to add a default value in a site column for every item in a document library
HI
i created a content type with some site columns ,
and included in a Document library.
Process ( content type)
-ProcessNo
-ProcessName
after that i uploaded 100 Documents but not added value in a site column process name.
now how i add a default value in a site column for every document in a document library
adilHI
i get below error when i change the script
PS C:\scripts> C:\Scripts\updatedefaultvalue.ps1
Cannot index into a null array.
At C:\Scripts\updatedefaultvalue.ps1:8 char:7
+ IF($i[ <<<< "Title"] -eq $null)
+ CategoryInfo : InvalidOperation: (Title:String) [], RuntimeExce
ption
+ FullyQualifiedErrorId : NullArray
$web = Get-SPWeb http://tspmcwfe:89/
$list = $web.Lists["test"]
$item = $list.Items | Where { $_["Name"] -eq "Emc" }
foreach($i in $items)
IF($i["Title"] -eq $null)
$i["Title"] = "test"
$i.Update()
adil
Why are you piping a where in the items? Do you only want to add the "test" to ones matching
a name?
If you have ISE installed on your server I recommend you put your code in there and debug it.
If this is helpful please mark it so. Also if this solved your problem mark as answer. -
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> -
Search row and column for return value
Dear Sir/Madam,
I have a problem for searching spreadsheet and hope you can help me out a bit. Im pretty new to Labview and Im currently using Labview 8.0. My task is to search the spreadsheet I have attached in row and column-wise, then return the corresponding value out. I had an attempt in doing this as you can see from the vi that i have attached. I try inputting the 'read from measurement file' into an array and using delete, index and search array I will be able to find the index value for the relevant row and column that i searched for by inputting them into an index array with the orginal array from the 'read from measurement file'.
So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
I can't see any mistakes in my logic but I getting really strange results, like I can read my data has been entered into an array but when i try deleting the first column and put it into another array, the orginal array with nothing deleted is outputted hence making my search to give out -1 value. So could you take a look please and give me any suggestion that can solve my problem or enhance the code a bit. Thank you for your time.
Best Regards,
Coato
P.s for some reason i can't attached the .lvm file of my data hence i have attached the excel version but i think you need to convert it back to .lvm for the 'read from measurement file' function to work.
Attachments:
Backswing compensation.csv 10 KB
Backswing comnpensation2.vi 109 KBYour VI makes absolutely no sense to me, but maybe I don't understand what you are trying to do.
You seem to have dynamic data with 6 signals and 48 points/channel. Now you reshape this into an array of dynamic data with 4x13 elements from which you slice out one row or column, resp. "delete from array" is NOT the correct tool to do this, use "Index array" with one index unwired to get a row or column as 1D array.
So you end up with two 1D arrays of dynamic data that you search for DBL. It is difficult to understand how you want to search for an array element that corresponds to a scalar DBL value of 0.1. Your array elements are NOT DBLs but dynamic data, each containing many signals!
There are two elements on all your data that are "3", the rest are zero. You will never find anything that is 0.1.
Maybe you can convert your original dynamic data to a 2D array with "rows are signals" using "convert from dynamic data", then operate on the 2D array.
Coato wrote:
So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
Sorry, Please explain.
Please make a VI containing a simple 2D aray as diagram constant that contains e.g. 5x5 typical values. Let us know what kind of result you expect from your algorithm..
LabVIEW Champion . Do more with less code and in less time . -
Having compiler issues with Array, can anyone help please?
Using your Invoice class created in lab02, write a client program that allows the user to input three Invoice objects into an array of Invoice objects. After you have inputted all of the invoices, print a heading and then output all of the array elements (Invoice objects) by calling the method from your Invoice class that displays all of the data members on a single line using uniform field widths to insure that all Invoice objects will line up in column format (created in Lab04). At the end of the loop, display the calculated total retail value of all products entered in the proper currency format.
Example of possible program execution:
Part Number : WIDGET
Part Description : A fictitious product
Quantity : 100
Price : 19.95
(etc.)
Example of possible output
Part Number Part Description Quantity Price Amount
WIDGET A fictitious product 100 19.95 199.95
Hammer 9 pounds 10 5.00 50.00
(etc.)
Total Retail Value: 249.95
This is what I have so far at the bottom, can anyone tell me what I'm doin wrong please
//Invoice Lab 6
//Application to test class Invoice with arrays
public class InvoiceTest
public static void main( String args[] )
Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
Invoice array [] = new Invoice [2];
array [0] = new Invoice ("1234", "Hammer", 2, 14.95);
array [1] = new Invoice ("5678", "PaintBrush", -5, -9.99);
double total = 0.0;
System.out.println("Part Number Description Quantity Price Amount");
System.out.println("----------------------------------------------------------------------------------");
for (int i=0; <=2; i++)
total+=array.getPaymentAmount();
system.out.println("The Total retail value is: %.2f\n")
// display invoice1
System.out.println( "Original invoice information" );
System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
System.out.printf( "Description: %s\n",
invoice1.getPartDescription() );
System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
System.out.printf( "Invoice amount: %.2f\n",
invoice1.getInvoiceAmount() );
// change invoice1's data
invoice1.setPartNumber( "001234" );
invoice1.setPartDescription( "Blue Hammer" );
invoice1.setQuantity( 3 );
invoice1.setPricePerItem( 19.49 );
// display invoice1 with new data
System.out.println( "\nUpdated invoice information" );
System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
System.out.printf( "Description: %s\n",
invoice1.getPartDescription() );
System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
System.out.printf( "Invoice amount: %.2f\n",
invoice1.getInvoiceAmount() );
Invoice invoice2 = new Invoice( "5678", "PaintBrush", -5, -9.99 );
// display invoice2
System.out.println( "\nOriginal invoice information" );
System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
System.out.printf( "Description: %s\n",
invoice2.getPartDescription() );
System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
System.out.printf( "Invoice amount: %.2f\n",
invoice2.getInvoiceAmount() );
// change invoice2's data
invoice2.setQuantity( 3 );
invoice2.setPricePerItem( 9.49 );
// display invoice2 with new data
System.out.println( "\nUpdated invoice information" );
System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
System.out.printf( "Description: %s\n",
invoice2.getPartDescription() );
System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
System.out.printf( "Invoice amount: %.2f\n",
invoice2.getInvoiceAmount() );
} // end main
} // end class InvoiceTestChange this (check my comments):
for (int i=0; <=2; i++) // what is <=2?? check the fixed version
total+=array.getPaymentAmount(); //two things 1) this needs to be inside the for-loop 2) you need to tell the array which index to look at
system.out.println("The Total retail value is: %.2f\n") //no need for \n because println does it automagically
}to this:
for(int i=0; i<array.length; i++) {
total += array.getPaymentAmount();
System.out.println("The total retail value is: " + total); //if you need another blank line like above be my guest
Honestly, I didn't look past this part so fix this and post again if something is still broken. -
I haven't had much experience working with arrays in labview and I'm looking for a way to do more complicated math than the "add/multiply array elements."
More specifically, I have a 2-D, 4 row, 3 column matrix ( lets call them x, y, and z, with elements x1, x2, x3, and x4, and the same for y and z.
I need to compute the average for the elements in the 1st and 3rd columns: (x1+z1)/2 = xz1 avg
And then I need to use that result: (xz1 avg - y1)/xz1 avg
For each row in the array.
Do I need to split the array into 3, one for each column, to do this? Or is there a formula node that lets me specify which array column/row/element to use?By default, autoindexing FOR loops iterate over Rows, so once you have the math for one row, simply place it inside a FOR loop and iterate over all rows.
Here's an example:
LabVIEW Champion . Do more with less code and in less time .
Attachments:
ArrayOps.png 16 KB -
Received this error (The workflow could not update the item, possibly because one or more columns for the item require a different type of information.) recently on a workflow that was
working fine and no changes were made to the workflow.
I have tried a few suggestions, i.e. adding a pause before any ‘Update’ action (which didn’t help because the workflow past this action without incident); checked the data type being written
to the fields (the correct data types are being written); and we even checked the list schema to ensure the list names and the internal names are aligned (they
are), but we still cannot figure out why the workflow is still throwing this error.
We located the area within the workflow step where it is failing and we inserted a logging action to determine if the workflow would execute the logging action but it did not, but wrote the same error message.
The workflow is a Reusable Approval workflow designed in SharePoint Designer 2010 and attached to a content type.
The form associated with the list was modified in InfoPath 2010.
Approvers would provide their approval in the InfoPath form which is then read by the workflow.
Side note - items created after the workflow throws this Unknown Error some seem to be working fine.
We have deleted the item in question and re-added it with no effect.
Based on what we were able to determine there don’t seem to be any consistency with how this issue is behaving.
Any suggestions on how to further investigate this issue in order to find the root cause would be greatly appreciated?
CheersHi,
I understand that the reusable workflow doesn’t work properly now. Have you tried to remove the Update list item action to see whether the workflow can run without issue?
If the workflow runs perfectly when the Update list item action is removed, then you need to check whether there are errors in the update action. Check whether the values have been changed.
Thanks,
Entan Ming
Entan Ming
TechNet Community Support -
I got error "The workflow could not update the item, possibly because one or more columns for the item require a different type of information "I found out the cause is Update Item action
I need to update item in another List call Customer Report ,the field call "Issues" with data type "Choice" to yes
then the error arise . please help..Thanks for the quick response Nikhil.
Our SPF 2010 server is relatively small to many setups I am sure. The list with the issue only has 4456 items and there are a few associated lists, eg lookups, Tasks, etc see below for count.
Site Lists
Engagements = 4456 (Errors on this list, primary list for activity)
Tasks = 7711 (All workflow tasks from all site lists)
Clients = 4396 (Lookup from Engagements, Tslips, etc)
Workflow History = 584930 (I periodically run a cleanup on this and try to keep it under 400k)
Tslips = 3522 (Engagements list can create items here, but overall not much interaction between lists)
A few other lists that are used by workflows to lookup associations that are fairly static and under 50 items, eg "Parters Admin" used to lookup a partners executive admin to assign a task.
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.
Maybe you are looking for
-
Ive created the reciever list using the following stmt: LT_RECLIST LIKE somlreci1 OCCURS 5 WITH HEADER LINE, at runtime im able to see the reciver in this table in correct order , but the mail header shows a different mailing order when mails are rec
-
Remote Desktop Services Single SSL Cert with multiple hosts
I am trying to use a single SSL Cert from a third party issuer. I have 3 servers in my deployement all are 2012R2. One contains the RD Web Access role, RD Gateway role, RD Licensing role, and RD Connection Broker role. The other 2 are RD Session H
-
Hi, when I send an report by email, a file with the *.eps extension is attached to the mail. how can the users open it ? Thank you
-
I purchased $20 of credit from Skype and my bank ...
Whats the fee per purchase on Skype I bought $20 yet bank if América posted amount oulled by Skype was $32
-
Creating objects using reflection
Hi, I need to construct a new instance using reflection and passing parameters. If the parameters are of primitive type ex. int, how can I pass them in the Class[] type of object