How to use Array
I have to read multiple notes and print distinct note from multiple notes.
Here is the sample data in my first page of the report.
Run# Time Note1 Note2 Note3 Note4
101 2300 CR N1 CR N2
102 1700 ER 1
103 1400 1 N3
104 0230 CR N4 ER
104 0300 ER H
I would like to see at the page footer like this.( Distinct notes info)
CR,N1,N2,ER,1,N3,N4,H
Thanks again!
Shirin
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Aug 18, 2008 11:07 AM
Use COLLECT and CONCATENATE to achieve your desired strig.
Like:
DATA: BEGIN OF ITAB OCCURS 0,
RUN TYPE I,
TIME TYPE T,
NOTE1 TYPE CHAR10,
NOTE2 TYPE CHAR10,
NOTE3 TYPE CHAR10,
NOTE4 TYPE CHAR10,
END OF ITAB.
*101 2300 CR N1 CR N2
*102 1700 ER 1
*103 1400 1 N3
*104 0230 CR N4 ER
*104 0300 ER H
ITAB-RUN = '101'.
ITAB-TIME = '2300'.
ITAB-NOTE1 = 'CR'.
ITAB-NOTE2 = 'N1'.
ITAB-NOTE3 = 'CR'.
ITAB-NOTE4 = 'N2'.
APPEND ITAB.
CLEAR ITAB.
ITAB-RUN = '102'.
ITAB-TIME = '1700'.
ITAB-NOTE1 = 'ER'.
ITAB-NOTE2 = '1'.
APPEND ITAB.
DATA: BEGIN OF IT_DIST OCCURS 0,
NOTE TYPE CHAR10,
END OF IT_DIST.
FIELD-SYMBOLS: <FS> TYPE ANY.
DATA: L_CNT TYPE I.
LOOP AT ITAB.
L_CNT = 3.
DO 4 TIMES.
ASSIGN COMPONENT L_CNT OF STRUCTURE ITAB TO <FS>.
IT_DIST-NOTE = <FS>.
COLLECT IT_DIST.
CLEAR IT_DIST.
l_cnt = l_Cnt + 1.
ENDDO.
ENDLOOP.
DATA: L_STRING TYPE STRING.
LOOP AT IT_DIST.
CONCATENATE L_STRING IT_DIST INTO L_STRING SEPARATED BY ','.
ENDLOOP.
WRITE: L_STRING.
Regards,
Naimesh Patel
Similar Messages
-
How to use array or type in "IN" criteria
Hi all,
anybody knows how to use group of same datatype data ( array or type ) in SQL statement
For example
ls_dept[1] = 'abc';
ls_dept[2] = 'xyz';
ls_dept[10] = 'ppr';
i want to use this group of data in "IN" criteria like
Select * from department where dept in ('abc','xyz'.....''ppr');
if anybody know how to use please reply me as soon as possible.
Thanks,I hope you are not suggesting concatenating literals from a web front-end application ;) Is it not what he was saying.. he is getting user input info from an application.. if the user sends multiple values.. he has to build a string with concatenating literals..
correct me if I am wrong. -
How to use array as parameter in procedure
Hello,
I am using Oracle SQL Developer 1.5.5
I wanted to write a procedure which does insert into table.
It should take 2 parameters.How to take array as parameter?
One is a array of strings ('abc','def','erg') and another is a varchar ('abc').
How to do this?
Can somebody pls give a small example?
Thanks
Edited by: user13305573 on Aug 5, 2010 11:27 PMHello,
I am sorry if u didnt get my point.
My req is i am using Orcale SQL Developer.
Db is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
I want to write a procedure which will be called from a java file.
The parameter to that procedure will be a arr(array of strings) and username(varchar).
I want to insert that data into a tableA.
like if parameters are
(abc01,edfg02,efg03) as arr and honey as username
then it should insert 3 rows to the tableA
abc01 honey
edfg02 honey
efg03 honey
Thanks
Edited by: user13305573 on Aug 5, 2010 11:54 PM -
How to use array of Point Class
I use Point class as array. I already create that. However I can't access to setLocation.
Ex.
Point myPoint[] = new Point[10];
myPoint[0].setLocation(10, 2);
It has a error.
Please Explain me.DeltaGeek wrote:
BalusC wrote:
Or use [Arrays#fill()|http://java.sun.com/javase/6/docs/api/java/util/Arrays.html]. Point[] points = new Point[10];
Arrays.fill(points, new Point());
That doesn't do what you think it does, unless you want your array to contain 10 references to the same Point object.The OP has received a good answer, I believe. So it's worth risking diverting this thread into the weeds by pointing out that if Java had closures then BalusC's code could be modified to work. -
How to use Array in Formcalc?
Please share syntax for using Array in Formcalc.
Hi,
FormCalc is a simple scripting language and does not support objects like arrays.
The only function that come close to an array in JavaScript is Choose(),
This first parameter selects the nth value of the following comma separated strings.
Choose(3, "String1", "String2", "String3", "String4")
returns String3 -
How to use Array in Calc script.
Hi, <BR> I want to use Array in Calc scripts. Can anyone provide me some examples. <BR><BR>Thanks<BR>Murali
For information on the ARRAY command, check out <a target=_blank class=ftalternatingbarlinklarge href="http://dev.hyperion.com/techdocs/essbase/essbase_712/Docs/techref/techref.htm">this hyperlink</a>.<BR><BR>Click on <b>Calculation Commands</b>, then choose <b>ARRAY</b>.<BR><BR>Can you give me some information explaining why you want to use ARRAY? It's use is pretty rare and I would like to understand what you're trying to do.
-
How to use array?I am a newer ------:(
In C language I can use array this way:
char array[10][20];
fread(array[1],20,1,fp);
but in java,what to do?
char array[][]=new [10][20];
and the code below will cause an error:
binstream.read(array[1]);//error line
pls help me and tell me what to do,thank you very muchHi evilstar007!
1st) There aren't unsigned primitives in Java, all primitives are signed.
2nd) The loop in previous message will read an entire line filling the buffer without length contraints. If there are n^z then it will read n^z "chars". This is is for text but I know there is a special one as you need, for bytes (primitive byte). You can also retrieve the bytes from stream:
data = new byte[dim];
inp.read(data);
I'm not sure about, there are a lot of methods and classes.
You pretend to read from stream and fill the contents of RomBanks array with length 32768L ok ?
Read the entire line and retrieve bytes.
Since you are a C programmer will be easy to understand Java.
Best Regards! -
How to use array in web services?
I have a function which returns an array of byte? How do I convert it into a web service function?
Hi, Eric,
Thank you for your quick reply.
The web service I am trying to develop is basically a generic Data Access Component to bridge between SQL server and a desktop .Net application. The application will have about 3000 users from WAN, therefore we want to have a server side component to handle connection pooling etc. Because of limitation of current servers, we are asked to develop a Java Web Service, instead of MS WS.
To make the component more reusable, I am thinking to have methods like this in the service:
RunQueryReturnRS(String Sql, WebRowSet, rs)
RunQueryReturnInt(String Sql, int NumRecdImpacted)
RunStoredProcedureReturnRS(â¦.)
RunStoredProcedureReturnInt(â¦.)
â¦â¦
You see, I would like to get whole resultset back to client, including both metadata and data in a format of generic resultset. When I paged through the Sunâs document, finding WebRowSet is claimed to be seariable, and ready for Web Service. I thought if I can use WebRowSet that will save me time to write new classes to hold resultset info and pass back to client.
Could you please tell me if it is a feasible approach?
Thank you.
-Qing -
How to use array of obects in jsp
I had passed an array of objects (Bean object) by using
request.setAttribute("Bean",req);
but how i display the values in my textbox on clicking next or prev button of my jsp.
Customer ID <input type="text" name="customerid" value=<%=req.getCustomerid()%> >
Date: <input type=text value=<%=req[i].getToday()%> name="today" >
how shud i use these values on button clicks.
thanksRemember that JSP is a server side language. It can not react to client side button clicks, unless it reloads the entire page.
You are only storing the attribute in request scope, so that array would not be available for the next request.
To make it available for all requests of the same user, you have to use session scope.
The button click code has to be written in javascript.
How large a list are we talking about here? If it is small (< 50 elements) you could send it all as part of the html page, and change it in javascript.
Otherwise you are looking at reloading the page, or making an ajax call.
Cheers,
evnafets -
In formula node how to use array outputs
someone has talked about this. but it is still a problem to me.
no matter how i declare the variable, the output terminal keeps a scalar.You should be able to declare it using:
int32 VarName[x][y];
That should make an array of 32bit integers.
See one of my earlier posts here: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000EE2C0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_TIER_0=0&USEARCHCONTEXT_TIER_S=0&USEARCHCONTEXT_QUESTION_0=array+formula+node&USEARCHCONTEXT_QUESTION_S=0
Try copying the code that I posted into your formula node and see if you get an array out. Or try the example I attached with the same code in it.
Let us know if you are still having trouble.
Brian
Attachments:
ArrayFormulaNode.vi 23 KB -
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 use arrays in view criteria
Hi all,
Am using Oracle Jdeveloper ,Studio Edition Version 11.1.1.2.0.
I have a query panel with three comboxes,which can multiselect
company,application & user respectively.When I mutiselect company,
then based on the selected value I need to populate the application
& user comboboxes.I want to search based on the selection.
I have used viewcriteria to filter the apllication&
user comboboxes.When a company is selected then company_id is passed as
bind variable to the view criteria,then it can filter application combobox.
Its working fine on single selection.
So I want to pass the selected values as an array to view criteria.
Please help
Thankscn u chk this..
http://jobinesh.blogspot.com/2010/12/using-oraclejbodomainarray-with.html
oops.. i am late by three minutes.. ;)
you can check the link provided.. above -
How to use array variable in Oracle
Hi,
I want to use a array variable to store many string values i.e. values like ( "my name is hhhyy and i have a tack", "My data is valid" , "hhggg gaya hujjjs")
currently all these values are in seperate variables , I want to consolidate them in one array and use it in further , after replacing some values from them.
I want to take data too. I am thinking of using "Varchar array" with values are in one cursor i want to take them in single array.
varchar array is throwing some exception once it has taken all the value. I had extended it upto 100 values.
What could be the possible solution.
create or replace function testet
( value varchar2) return varchar2
as
x_value Varchar2(2000);
x_value2 varchar2_array := varchar2_array();
x_value3 number;
cursor c1 is
SELECT val
FROM table A
WHERE A.coulmn= 'val';
begin
x_value2.EXTEND(100);
x_value3 := 1;
for indx IN c1
loop
x_value2(x_value3):= indx.val;
dbms_output.put_line(x_value2(x_value3));
x_value3 := x_value3 + 1;
end loop ;
end;user12403816 wrote:
actual error :
ORA-06533: Subscript beyound count
ORA - 06512 " at Function name , line 23
ora - 06512: at line 3
06533, 00000, "Subscript beyond count"
// *Cause: An in-limit subscript was greater than the count of a varray
// or too large for a nested table.
// *Action: Check the program logic and explicitly extend if necessary.code contains bug.
after code is fixed, then no error gets thrown -
How to use array function?
I want to create a array with the data are in the table (one or more than one field).
By using function makearray or array, it can create the array with one record
e.g.
Local stringvar Array x := MakeArray ({CASES.ASSIGNTO});
ubound(x);
the result will be 1, means only one record is in the Array x.
Actually, I want to get all records of the field CASES.ASSIGNTO.Hello Kent,
You can't just assign all field values to an array, the formula needs to process each record in the details section and assign the record to the array. Here is a sample formula that would assign all countries to an array;
WhilePrintingRecords;
stringvar array t;
numbervar x;
x:= x + 1;
redim preserve t[x];
t[x]:= {Customer.Country};
t[x]
If you need the completed array available in the main report before the Report Footer then you would need to use a subreport in the Report Header to generate the array and then using a shared variable pass it back to the main report.
Also note that an array is limited to 1000 elements so if there is a possibility of the number of records exceeding 1000 you will need to create more than 1 array and depending on the value of the counter assign the records greater than 1000 to the second array -
Can any one help me to use an Array in oracle.Also i want to search whether an element is already existing in the array
One possible approach
SQL> create or replace type array as table of number;
2 /
Type created.
SQL> select case when count(*) = 1 then 'found' else 'not found' end
2 from dual
3 where exists (
4 select null from table(array(1,2,3,4,5))
5 where column_value = 3);
CASEWHENC
found
SQL> edi
Wrote file afiedt.sql
1 select case when count(*) = 1 then 'found' else 'not found' end
2 from dual
3 where exists (
4 select null from table(array(1,2,3,4,5))
5* where column_value = 1)
SQL> /
CASEWHENC
found
SQL> edi
Wrote file afiedt.sql
1 select case when count(*) = 1 then 'found' else 'not found' end
2 from dual
3 where exists (
4 select null from table(array(1,2,3,4,5))
5* where column_value = 6)
SQL> /
CASEWHENC
not found -
How to use array variable in Business Rule
Hi,
I have read a lot about Array variable. But everywhere declaration of array variable in described. I can declare that. It works fine. But i can't implement that array variable.
Can any one please provide me an example of implementation of array variable?
Regards,
Rubi
Edited by: Rubi Banerjee on Mar 30, 2012 3:35 AMforget about all varible in essbase CSC
it's bad practics.^^^Is it?
Essbase cube are self big array )^^^That's what makes ARRAY so cool -- you can set up an array that encompasses a dimension.
Example straight from a HBR:
ARRAY SomeArray["Entity"] ;
Regards,
Cameron Lackpour
Maybe you are looking for
-
How to remove tab stops at one shot after importing a word document
HI everyone, This is my first post in Framemaker Community as I am moving from RH to FM. I have an issue with respect to importing word documents to Framemaker. After I have import a word to doc to FM multiple tab stops are created. Now, although I r
-
Cycle counting happening not beyond fiscal year
Hello We tried to run Cycle counting using LX26 but got error as IM settings are not done,we ran MIBC The issue here is we can't push the counting date beyond the fiscal year end. If I run the transaction LX26 in either QAS or Prod it will work just
-
How to link a marketing characteristic with a table? ( TR CL03 - CT04 - BP)
Hello, I'm trying to link a table (CRM_MKTPL_CAMPAIGN field : EXTERNAL_ID) with a mkt characteristic so that the user could select a value for this characteristic through a matchcode in transaction BP. I understood that i had to deassign the characte
-
Which Printer model can be used as a True A3/A4 Printing/Scan/Copy Wireless with ePrint
I have been going around in circles to find a suitable printer which can do the following 1) Automactically detect A3 or A4 paper size and print accordingly scale automatically is required 2) Copy an A4 document and print the same on A3 Paper 3) Netw
-
Remove Mail from mailbox after accepting mail by another guy
I have an requirement in such way that if one employee accpets the mail, mail should get removed from mail box of other employee. Mail are the MS-Outlook mails and all employee are group together in one address book. In second scenario, if employee s