How to transform one row to multiple row
I have excel data of form
Name
Roll No.
Prakash
28,32
Jitendra
38,45
Satendra
43,73
I want to transform it to this form and insert it to sql database
Name
Roll No.
Prakash
28
Prakash
32
Jitendra
38
Jitendra
45
Satendra
43
Satendra
73
How to do it.
prakash kumar jha
It can be done with "Script Component" transformation by making it as asynchronous component ((because
the number of output rows differs from the number of input row) .
To make the component as asynchronous ,we need to set the "SynchronousInputId" property to None
In an asynchronous script component you have to override the "Input0_ProcessInputRow"
method.
Example:
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim keyField As Integer = Row.KeyField
Dim itemList As String = Row.ListField
Dim delimiter As String = ","
If Not (String.IsNullOrEmpty(itemList)) Then
Dim inputListArray() As String = _
itemList.Split(New String() {delimiter}, _
StringSplitOptions.RemoveEmptyEntries)
For Each item As String In inputListArray
With Output0Buffer
.AddRow()
.KeyField = keyField
.ListItem = item
End With
Next
End If
End Sub
Similar Messages
-
How to update one row in AdvancedDataGrid
My App have a AdvancedDataGrid and it has so much rows. Some
data rows for AdvancedDataGrid has changed and i don't want to
update all rows ... But i don't know how to update one row for my
AdvancedDataGrid
Some body help me ...
Thanks so muchs !thanks ntsii.
my problem is:
[Bindable]
var dp:ArrayColection = new ArrayColection({...});
<mx:AdvancedDataGrid dataProvider="{dp}">
<mx:groupedColumns>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
//==================================
in my dp have more rows and some time one of them is changed
then i guess the AdvancedDataGrid must build all rows when
it's dataProvider (dp) have changed.
And i don't want to that...
But i am not sure the AdvancedDataGrid buld all rows from
begin to end ... i don't know.. ! -
How to create one TO for multiple TRs
Dear All,
how to create one TO for multiple TRs, kindly suggest me
Regards,
baluAs for your question: it is discussed in sAP online help:
http://help.sap.com/saphelp_erp60_sp/helpdata/en/c6/f841f24afa11d182b90000e829fbfe/frameset.htm
Sorry I misunderstood your question.
The above mentioned solution won't create one single TO from multiple TR.
Edited by: Csaba Szommer on Aug 11, 2010 9:46 AM -
How to return one ROW with Multiple value seperated by Colon in a SQL Query
Hi,
I have a SQL query as mentioned.
select deptno
from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
10:20:30:40.......Thanks,
DeepakIn 10g:
select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
from dept;
DATA
10:20:30:40with apologies for the abuse of XML... -
How to select one row in a table with radio button
Hi all.
I have a VO where there is an attribute (isDefault [String]) that identifies the default record in the view. The possible values are 'Y' for yes and 'N' for no. Obviously only one record can have the 'Y' value.
In my page I have created an ADF Table (with the usual data control drag & drop). I would to transform the default inputText of "isDefault" field with a selectOneRadio component in order to permit the user to select (and save contextually in the DB) the default row of this table.
Can you explain me how? I'm using JDeveloper 11.1.1.4.
Thanks in advance.
BaduelBaduel wrote:
Cvele,
thanks for your responses. Yes, it's easier to use af:selectBooleanCheckbox but I need that the selection is mutually exclusive (only one row can be selected). >If this is possible also with the boolean checkbox please tell me how.- Let's try with CheckBox :
1. At the ViewObjectImpl level (for example, YourViewObjectImpl), add the following code:
private oracle.jbo.Key currSelectedRowKey = null;
public void doRowSelection(Key newKey) {
// de-select old one
if (currSelectedRowKey != null) {
Row[] rows = findByKey(currSelectedRowKey, 1);
if (rows != null && rows.length > 0)
rows[0].setStatusAsBoolean(Boolean.FALSE); // cast to the appropriate row Impl class if need !
// remember a new selected row key:
currSelectedRowKey = newKey;
}In the ViewRowImpl, in the transient attr settter, do as follows:
public void setStatusAsBoolean(Boolean value) {
setStatus(value.booleanValue() ? ONE : ZERO);
if (value.booleanValue()) {
YourViewObjectImpl vo = (YourViewObjectImpl)getViewObject();
vo.doRowSelection(getKey());
} P.S. The above was not tested at all, but should give you an idea -
How just return one row of a one to many join..
So I have a one to many join where the SMOPERATOR table has data I need however it has a couple of rows that match the JOIN condition in there. I just need to return one row. I think this can be accomplished with a subquery in the join however have not been able to come up with the right syntax to do so.
So:
SELECT "NUMBER" as danumber,
NAME,
SMINCREQ.ASSIGNMENT,
SMOPERATOR.PRIMARY_ASSIGNMENT_GROUP,
SMOPERATOR.WDMANAGERNAME,
SMINCREQ.owner_manager_name,
SMINCREQ.subcategory, TO_DATE('01-'||TO_CHAR(open_time,'MM-YYYY'),'DD-MM-YYYY')MONTHSORT,
(CASE WHEN bc_request='f' THEN 'IAIO'
WHEN (bc_request='t' and substr(assignment,1,3)<>'MTS') THEN 'RARO'
WHEN (bc_request='t' and substr(assignment,1,3)='MTS') THEN 'M'
ELSE 'U' end) as type
from SMINCREQ
left outer join SMOPERATOR on SMINCREQ.assignment=SMOPERATOR.primary_assignment_group
WHERE SMINCREQ.owner_manager_name=:P170_SELECTION and SMOPERATOR.wdmanagername=:P170_SELECTION
AND open_time BETWEEN to_date(:P170_SDATEB,'DD-MON-YYYY') AND to_date(:P170_EDATEB,'DD-MON-YYYY')
AND
(bc_request='f' and subcategory='ACTIVATION' and related_record<>'t')
OR
(bc_request='f' and subcategory<>'ACTIVATION')
OR
(bc_request='t' and substr(assignment,1,3)<>'MTS')
order by OPEN_TIMeHi,
This sounds like a Top-N Query , where you pick N items (N=1 in this case) off the top of an orderded list. I think you want a separate ordered list for each assignment; the analytic ROW_NUMBER function does that easily.
Since you didn't post CREATE TABLE and INSERT statements for your sample data, I'll use tables from the scott schema to show how this is done.
Say you have a query like this:
SELECT d.dname
, e.empno, e.ename, e.job, e.sal
FROM scott.dept d
JOIN scott.emp e ON d.deptno = e.deptno
ORDER BY dname
;which produces this output:
DNAME EMPNO ENAME JOB SAL
ACCOUNTING 7934 MILLER CLERK 1300
ACCOUNTING 7839 KING PRESIDENT 5000
ACCOUNTING 7782 CLARK MANAGER 2450
RESEARCH 7876 ADAMS CLERK 1100
RESEARCH 7902 FORD ANALYST 3000
RESEARCH 7566 JONES MANAGER 2975
RESEARCH 7369 SMITH CLERK 800
RESEARCH 7788 SCOTT ANALYST 3000
SALES 7521 WARD SALESMAN 1250
SALES 7844 TURNER SALESMAN 1500
SALES 7499 ALLEN SALESMAN 1600
SALES 7900 JAMES CLERK 950
SALES 7698 BLAKE MANAGER 2850
SALES 7654 MARTIN SALESMAN 1250Now say you want to change the query so that it only returns one row per department, like this:
DNAME EMPNO ENAME JOB SAL
ACCOUNTING 7782 CLARK MANAGER 2450
RESEARCH 7876 ADAMS CLERK 1100
SALES 7499 ALLEN SALESMAN 1600where the empno, ename, job and sal columns on each row of output are all taken from the same row of scott.emp, though it doesn't really matter which row that is.
One way to do it is to use the analytic ROW_NUMBER function to assign a sequence of unique numbers (1, 2, 3, ...) to all the rows in each department. Since each sequence startw with 1, and the numbers are unique within a department, there will be exactly one row per departement that was assigned the numebr 1, and we''ll display that row.
Here's how to code that:
WITH got_r_num AS
SELECT d.dname
, e.empno, e.ename, e.job, e.sal
, ROW_NUMBER () OVER ( PARTITION BY d.dname
ORDER BY e.ename
) AS r_num
FROM scott.dept d
JOIN scott.emp e ON d.deptno = e.deptno
SELECT dname
, empno, ename, job, sal
FROM got_r_num
WHERE r_num = 1
ORDER BY dname
;Notice that he sub-query got_r_num is almost the same as the original query; only it has one additional column, r_num, in the SELECT clause, and the sub-qeury does not have an ORDER BY clause. (Sub-queries almost never have an ORDER BY clause.)
The ROW_NUMBER function must have an ORDER BY clause. In this example, I used "ORDER BY ename", meaning that, within each department, the row with the first ename (in sort order) will get r_num=1. You can use any column, or expression, or expressions in the ORDER BY clause. You muight as well use something consistent and predictable, like ename, but if you really wanted arbitrary numbering you could use a constant in the analytic ORDER BY clause, e.g. "ORDER BY NULL". -
How to write one row of data at a time to "Write to File"
I am trying to write 10 parameters to the LV "Write to File". This is for just one row at a time. This happens evertime I get a failure in my test routine. I am not quite sure how to accomplish this task. If I get another failure I write one row again. I testing 4 DUTS at a time so I write this row of data to each file. I am sure it is very simple.
Thanks
PhilipAssuming your 10 parameters are an numeric array with 10 elements, use "write to spreadsheet" file with append set to true. (... and if they are scalars, built the array first ).
LabVIEW Champion . Do more with less code and in less time . -
How to set one row or node 's height in the jtree?
How to set height of one row or node in the jtree?
I found the method :jTree.setRowHeight(height);.
But I want to set height of one row ,not all rows of a jtree.
Thanks for help!Who can help me?
-
How to copy one row to another in table interface DATA_CELL?
I am trying to copy the data from row i_y = 7 to row i_y =8 so I am adding my code in method DATA_CELL and can't get it to work. Please let me know if you have any ideas on what I am doing wrong.
Let's say I have row #7 as:
row #7 100|200|300
After running my code below,
row #8 300|300|300
Obviously the data that is populated in row #8 is wrong because I want it to match row #7. How do I get row #8 to be the same as row #7?
I declared zvalue in the attributes tab making it global and code DATA_CELL as:
if i_y = 7.
zvalue = i_display_value.
endif.
if i_y = 8.
c_cell_content = zvalue.
endif.
Thanks for any ideas you send my way.Tried again with this modified code but it still doesn't work. Any ideas on how to get all the columns in row #7 to show up in row #8? Thanks.
data: tmp_display_value like i_display_value.
case i_y.
when 7.
tmp_display_value = i_display_value.
when 8.
c_cell_content = tmp_display_value.
endcase. -
How to pass one row of a result set to a cffunction?
I can pass the entire result set of a query to a cffunction,
but the function only needs one row.
The code below is a syntax error, where "3" is array index
notation for the third row of the result set.
What is the correct way to pass one row of a result set to a
cffunction?
Thank you.iirc, cf does not allow one to reference and access a row of
a resultset
like that.
you will have to create a structure/array that holds the data
from
specific query row and pass that to your function. looping
over
queryname.columnlist list will make it easier and not
specific to any
particular query. make it into another function that accepts
a query and
row number as arguments and returns a struct/array of that
row data (or
automatically passes it to another function).
sample code for creating a structure of specific query row
data:
<cfset rowstruct = {}>
<cfloop list="#queryname.columnlist#" index="col">
<cfset rowstruct[col] = queryname[col][somerownumber]>
</cfloop>
<cfdump var="#rowstruct#">
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
How to get one value from multiple duplication for a key figure field
Hi expert,
I have a infoprovider, with following format:
employee hourly_rate action_type count of action
there are multiple rows for each employee, I want to create query as follows:
employee hourly_rate action_type count of action
in which hourly_rate is constant , only retriving one value from multiple rows for one employee, count of action should be summarized.
how to get this hourly_rate.
Many Thanks,Hi,
put the employee in rows panel -> reaming object put it in free char panel.
suppress the all result rows for the all object except employee .
select the object -> go to query properties -> select display tab -> select result rows -> select suppress.
select the employee -> go to query properties -> select display tab -> select result rows -> select always display. - now it will give employee wise hourly rate summarize data.
Thanks,
Phani. -
How to have one provider with multiple portlets in JDev 11g
Hi,
I am trying to create Oracle PDK Portlets using JDeveloper 11g but for each portlet JDeveloper is creating a provider. As In JDeveloper 10.1.3.4 we can have one provider with multiple portlets in it. But JDev 11g creates provider for each portlet. How can we have one provider with multiple portlets in JDev 11g. Is it something changed in 11g version or am I doing it wrong. As the Help says we can have multiple portlets in one provider but when creating portlets it does not do that. Any help is appreciated.
ThanksHi,
I am trying to create Oracle PDK Portlets using JDeveloper 11g but for each portlet JDeveloper is creating a provider. As In JDeveloper 10.1.3.4 we can have one provider with multiple portlets in it. But JDev 11g creates provider for each portlet. How can we have one provider with multiple portlets in JDev 11g. Is it something changed in 11g version or am I doing it wrong. As the Help says we can have multiple portlets in one provider but when creating portlets it does not do that. Any help is appreciated.
Thanks -
How to schedule one report for multiple company code?
How you can schedule reports in BW 3.5? Suppose I need to schedule one report for multiple company code, how can you do that and notify the users? I do not want to send multiple emails to the same user if the report runs for 20 times (for 20 different companies).
points are given for ASAP replies.
Thanks in advance
PeterDear Peter,
Try to restrict the Company Code with those 20 values and schedule.
Regards,
Ramkumar. -
How to create one delivery for multiple sales order
Hi!! Friends,
Can some one explain the steps to be followed in creating one delivery for multiple sales order in SAP SD.
Regards
AKASH
Message was edited by:
AKASH TAMBIHi.,
You can combine different orders in to one delivery ,But for the customer Order combination should be checked in the sales area data of the shipping tab,we can combine orders but the ship to party,Route,Inco terms,Shipping date,shipping point should be same,you can do in T.code VL04 & VL10
REWARD if helpfull
Thanks & Regards
Narayana -
How to send one text to multiple numbers
On iPhone 3GS , how do u send 1text to multiple numbers?
The information below implies you must use MMS or iMessage (not SMS).
[extracted from the iPhone User Guide for iOS 5]
Sending messages to a group
Group messaging lets you send a message to multiple recipients. Group messaging works with iMessage and MMS (not available in all areas).
Send messages to a group: Tap the new message button, then enter multiple recipients.
Note: With MMS, group messaging must also be turned on in Settings > Messages, and replies are sent only to you—they aren’t copied to the other people in the group.
Maybe you are looking for
-
Laptop fails to boot with battery
Probably the wrong subsection.. :3 Okay, so I have a Toshiba satellite l735-m14t running windows 7. The problem started when I used CCleaner to clear out registry entries of uninstalled applications. Everything was running fine until I restarted. I c
-
Error whlie registering the oracle home in oracle 9i
Hi, I am doing the oracle_home software cloning in oracle 9i.After the copy process of home i tried to register the Oracle home with the central inventory. I tried so many commands to register the oracle_home but still i am getting same error in my l
-
Unable to Install OBIEE in windows 7 32 bit
hi, i am aware that windows 7 is not supported for OBIEE 10g but from one of the blog they said to change the compatibity version to xp and have done the same but i am gettting some error while running the setup.exe file . the error is as folllows th
-
When I first turned on my computer, I was prompted to take a picture. I've looked at other topics that ask where that photo is located, but I can't find it. It's not under User Pictures, and I don't have a folder for Address Book under Application Su
-
HTML e-mail is all very well but, when abroad, it would be much more convenient (not to say cheaper) if my iPhone only received the text content of the e-mail (no formatting, no images, nothing except a link to the download if required). Is it possib