How to get the values of the rows in a column only?
How to get all the values in the rows of a column.for example, a query gives result as:
123
234
233
12121
all in different lines. But I want the result like this:
123,234,233, 12121.All in a single row and a single column.
How is that possible?
SELECT rtrim (xmlagg (xmlelement (e, column_name |))) (') .extract('//text () '), ',') from table_name
Tags: Database
Similar Questions
-
How to get the name constraintlist and column in a table?
Hello
can someone please tell me how to get the type of constraint, and it is imposed on the names of columns in a table.
Thank you
NicoHello
Use the two tables:
select * from all_constraints select * from ALL_CONS_COLUMNS
Sorry SY, you were faster than me...
Published by: user11268895 on August 19, 2010 13:27
-
How to get the row of Table data in the pop up window
Hello world
I'm working on Jdeveloper 11.1.1.4 and I got a requirement when there is a delete as a column in a Table in the ADF. When the user clicks on delete button that I need to display a confirmation message "You want to remove from the Table" OK CANCEL.
If the user clicks the OK button, then I need to update the value of last_update_by to the one who connects and then deletes the line from the user interface but at the level of the table of database, that line will be there.
Do I want to get the line given in the confirmation message pop-up and to add rowdata.setAttribute(last_update_by,'') in the class of the action of the OK button.
I could get the rowdata table in class action OK button but when I do rowdata.setAttribute(last_update_by,'') that class action it gives me null pointer exception.
Can someone help me with valuable suggestions?
Thank youYou may need to check {: identifier of the thread = 2223878} thread
-
How to transpose the rows in multiple columns by using PivotTable
I have 1 line containing 12 columns with the value "JAN", "FEB", "MAR", "J-1","F-1","M-1","J-2","F-2","M-2","J-3","F-3","M-3"
I want to display like
JAN J - 1 F - 1 M - 1
FEB J - 2 F - 2 M - 2
MAR F - 3 J - 3 M - 3
How to achieve the foregoing?Today, you have only 3 months JAN, Feb, Mar. Is it always the same number of columns. What happens if several months ago we added this line?
Your data is really coming from relational source or some sort of text file?
There is a better way to do this in narrative using HTML mode, if your condition is just to show them in several lines and do some math.
Go to Narrative display;
In the prefix, use
In the text box 'Story' add something like that
@1 @4 @7
@2 @5 @8
@3 @6 @9 As a suffix, use
You can also add simple calculations like sum etc at the bottom of these lines as the overall totals.
Kris
-
Get a value from a row in a column
I have a table contains the following data
ID Student class classeRoom 1 English 3-B 3-B 2 null null 3-B 3 null null 3-B 4 Jack OuMe 3-B 5 Richard DSA 3-B 6 Jhon Ross 3-B 7 French 3-B 3-B 8 null null 3-B 9 null null 3-B 10 Jack OuMe 3-B 11 Richard DSA 3-B 12 Jhon Ross 3-B 13 Spanish 5-B 5-B 14 null null 5-B 15 null null 5-B 16 Cena ADI 5-B 17 Mike Rock 5-B 18 Philippe DSK 5-B I need a select query to get the result as below:
ID Student class classeRoom CLASSES 1 English 3-B 3-B English 2 null null 3-B English 3 null null 3-B English 4 Jack OuMe 3-B English 5 Richard DSA 3-B English 6 Jhon Ross 3-B English 7 French 3-B 3-B French 8 null null 3-B French 9 null null 3-B French 10 Jack OuMe 3-B French 11 Richard DSA 3-B French 12 Jhon Ross 3-B French 13 Spanish 5-B 5-B Spanish 14 null null 5-B Spanish 15 null null 5-B Spanish 16 Cena ADI 5-B Spanish 17 Mike Rock 5-B Spanish 18 Philippe DSK 5-B Spanish I tried something like this:
Select ID, STUDENT, CLASS, FIRST_VALUE (STUDENT) IGNORE NULLS above (SCORE FROM CLASSEROOM ORDER BY ID) CLASSES from my_table
but I don't have the answer
Thanks for help
How about this slight adjustment to the solution of Solomon?
select id, student, class, classeroom, last_value( case when class = classeRoom then student end ) ignore nulls over(order by id) classes from t order by id;
ID STUDENT CLASS CLASSEROOM CLASSES 1 English 3-B 3-B English 2 null null 3-B English 3 null null 3-B English 4 Jack OuMe 3-B English 5 Richard DSA 3-B English 6 Jhon Ross 3-B English 7 French 3-B 3-B French 8 null null 3-B French 9 null null 3-B French 10 Jack OuMe 3-B French 11 Richard DSA 3-B French 12 Jhon Ross 3-B French 13 Spanish 5-B 5-B Spanish 14 null null 5-B Spanish 15 null null 5-B Spanish 16 Cena ADI 5-B Spanish 17 Mike Rock 5-B Spanish 18 Philippe DSK 5-B Spanish -
How to get the total of a column in php
I have a php MySQL database that stores the bills paid, I need to show all of the column that stores the individual payments
what I have so far
$colname_rsProperty = "-1";
If (isset($_GET['recordID'])) {}
$colname_rsProperty = $_GET ["recordID"];
}
@mysql_select_db ($database_hostprop, $hostprop);
$query_rsProperty = sprintf ("" SELECT * FROM host_editprop, host_editpropUtil, host_editpropUtilComp WHERE host_editprop.prop_id = AND host_editpropUtil.prop_id = host_editprop.prop_id AND host_editpropUtilComp.utilID = host_editpropUtil.UtilPropNameID %s ", GetSQLValueString ($colname_rsProperty,"text")");
$query_limit_rsProperty = sprintf ("%s LIMIT %d, %d", $query_rsProperty, $startRow_rsProperty, $maxRows_rsProperty);
$rsProperty = mysql_query ($query_limit_rsProperty, $hostprop) or die (mysql_error ());
$total = 0;
$total += $row_rsProperty ["utilityAmount"];
the host_editpropUtil column is called utilityAmount
and the individual amounts are the echoes of
<? PHP echo DoFormatCurrency ($row_rsProperty ['utilityAmount'], 2, ','.', ' £');? >
and I want to put the total at the end of these
and just an echo of the total need
<? PHP echo $total? >
This is just to show the first value in the table
Thanks in advance
got it to work
$colname_rsProperty = "-1";
If (isset($_GET['recordID'])) {}
$colname_rsProperty = $_GET ["recordID"];
}
@mysql_select_db ($database_hostprop, $hostprop);
$query_rsProperty = sprintf ("" SELECT * FROM host_editprop, host_editpropUtil, host_editpropUtilComp WHERE host_editprop.prop_id = AND host_editpropUtil.prop_id = host_editprop.prop_id AND host_editpropUtilComp.utilID = host_editpropUtil.UtilPropNameID %s ", GetSQLValueString ($colname_rsProperty,"text")");
$rsProperty = mysql_query ($query_rsProperty, $hostprop) or die (mysql_error ());
$row_rsProperty = mysql_fetch_assoc ($rsProperty);
$totalRows_rsProperty = mysql_num_rows ($rsProperty);
@mysql_select_db ($database_hostprop, $hostprop);
$query_rsSum = sprintf ("SELECT host_editpropUtil.utilityAmount, host_editprop.prop_id, host_editprop, host_editpropUtil.prop_id FROM host_editpropUtil WHERE host_editpropUtil.prop_id = host_editprop.prop_id AND host_editprop.prop_id = %s", GetSQLValueString ($colname_rsProperty, "text") ");
$rsSum = mysql_query ($query_rsSum, $hostprop) or die (mysql_error ());
$totalRows_rsSum = mysql_num_rows ($rsSum);
$grandTotal = 0;
Use a loop here
{If ($row_rsSum = mysql_fetch_assoc ($rsSum))
$grandTotal += $row_rsSum ["utilityAmount"];
$row ['utilityAmount'] ;// and view the contents of the line
$row ['SUM (utilityAmount)'; / / and display the contents of the line
}
-
How to get the name of VM knowing only Snapshot name
New on this site, PowerCLI and PowerShell in general. I run a command to determine what shots are there (get - vm | get-snapshot) and he returned to me a list of snapshots there but not what VM, they are on. I'm looking for the virtual machine is a snapshot on?
Thanks for the help in advance.
In Christ,.
Michael
The "VM" of the snapshot property would give him to you. Add to your example, it would be. Get - VM | Get-Snapshot | Select the virtual machine
-
How to get the checksum for several columns?
I need to compare the data of a record in a data table in another table. The structures of the two tables are not the same, but the data types of the columns I'm comparing cam is obviously the same. There are many columns so I thought that a shortcut to make a crazy long A = A AND B = B, etc... several dozens of times to check if the data are different each time was to use checksum.
I had planned to use the concatenation of all the columns together in a single string, delmitted by a semicolon.
However, I find that it does not work as desired. The checksum produces the same number for different values of data. So I need ot use something else.
There is another function I could use in a similar way where it will create a compact, unique hash to a concatenated string of time I spend?
And what is the data type of the return value - hoping that it's digital!What checksum algorithm do you use?
Depending on the version of Oracle, you can use the HASH of the package DBMS_CRYPTO method, i.e.
SELECT dbms_crypto.hash( to_clob( ename || empno || sal ), 1 /* dbms_crypto.hash_md4 */ ) FROM emp
A MD4 hash should have a very low incidence of collisions of normal data even if it isn't particularly cryptographically course. You can also use the ORA_HASH method
SELECT ora_hash( ename || empno || sal ) FROM emp
but I expect the chance of collisions to be a little higher.
Justin
-
How to get the value of varStatus in managed Bean
Hi all
I use jDeveloper 11.1.2.4 version.
I had a table with table with departments view object. I added an extra column to the table to display the serial numbers of the lines like this.
< af:table...
varStatus = 'vs' rowSelection = "multiple" id = "t1" binding = "#{ReferenceBeans.departmentTable}"> "
< af:column id = "c5" headerText = "varStatus" >
< af:outputText value = "#{vs.index + 1}" id = "ot1" binding = "#{ReferenceBeans.varStatus}" / > "
at the bean, I get all the values of the selected line, but I don't get the varStatus value of the column.
If I use
Object varStatus is getVarStatus () .getValue ();.
System.out.println("varstatus::"+varStatus);
That's the impression first value only, but not the values of the selected line.
How to get the varStatus value in the bean selected lines.
Best regards
Claude Reynier.
You can get the index of the line of the ViewObject.getRangeIndexOf (row) method. Something like this:
empIter.getViewObject () .getRangeIndexOf (currentRow)
example:
RowKeySet selectedEmps = getTable().getSelectedRowKeys(); Iterator selectedEmpIter = selectedEmps.iterator(); DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry(); DCIteratorBinding empIter = bindings.findIteratorBinding("EmployeesView1Iterator"); RowSetIterator empRSIter = empIter.getRowSetIterator(); while (selectedEmpIter.hasNext()) { Key key = (Key) ((List) selectedEmpIter.next()).get(0); Row currentRow = empRSIter.getRow(key); System.out.println("FirstName" + currentRow.getAttribute("FirstName") + " - Row Index= " + (empIter.getViewObject().getRangeIndexOf(currentRow) + 1)); }
-
How to get the values of the table of the ADF to bean class?
Hi all
My 11.1.1.6 Jdev
Here I do not use BC ADF in my project. I'll put values in the ADF table with bean.
In the table, I put a checkbox. When I selected (Checkbox) a few rows in table and submit. In the submit method, I want to get all the values of line checkbox selected in my bean class.
How can I get the values. ???
Here my table UI code
< af:table var = "row" rowBandingInterval = "0" id = "t1" value = "#{pageFlowScope.BinderSolutionsBean.uiBinderProperties} '"
styleClass = "AFStretchWidth" emptyText = "no record found".
Binding = "#{pageFlowScope.BinderSolutionsBean.binderTree}" >
< af:column sortable = "false" headerText = "Script ID" id = 'c4' >
< af:panelGroupLayout id = "pgl4" >
< af:selectBooleanCheckbox id = 'sbc1' > < / af:selectBooleanCheckbox >
< af:spacer width = "5" / >
< af:outputText value = "#{row.scenarioId}" id = "ot5" / > "
< / af:panelGroupLayout >
< / af:column >
< af:column sortable = "false" headerText = "Quote ID" id = "c1" >
< af:outputText value = "#{row.quoteId}" id = "ot4" / > "
< / af:column >
< af:column sortable = "false" headerText = "NASP ID" id = "c2" >
< af:outputText value = "#{row.naspId}" id = "ot2" / > "
< / af:column >
< af:column sortable = "false" headerText = "GCH ID" id = 'c3' >
< af:outputText value = "#{row.gchId}" id = "ot3" / > "
< / af:column >
< af:column id = "c6" headerText = "Term" >
< af:outputText value = "#{row.term}" id = "ot9" / > "
< / af:column >
< af:column sortable = "false" headerText = "Status" id = "c5" >
< af:outputText value = "#{row.status}" id = "ot6" / > "
< / af:column >
< / af:table >
follow some above recommendation such as the creation of additional attribute. You will also need the key in your collection, while making the data for your chart.
You must write a custom selectionListener. On valueChangeEvent of box, get the key of a line and add the line at the bean.
Maybe it's little help for you
-
How to get the 6th element of a C.V. value column
Hi all
I use Oracle Business Intelligence 11.1.1.7.131017.
I have a column with the following formula: C.V. ("Tickets". "Number of tickets"), but since we want to only show the values advocated by the past 6 months and which is an accumulative column, we added the rank function in the filter and placed as: grade (C.V. ("Tickets". " Number of tickets')) < = 6 and for the final formula, we need the minimum value that is placed in 6th place...
My problem is how to get the value assigned to this position?
Here's the column values:
30719 (value I pretend-> min)
31357
32025
32595
33652
34616 (I also use this value-> max)
Any idea on how to get the value placed on tier 6?
Thanks for the help and have a good week.
Kind regards
Frederico.
I found a solution (poor, but it works)...
As a minimum I want is always located in the row = 6 I put a case when row = 6, then returns the value I'm pretending, else return 0, so after that I need only the max of all values, as they are 0 or the value that I'm pretending, like this:
MAX (CASE WHEN (GRADE (C.V. ("Tickets". "Number of tickets')) = 6) THEN of C.V. (FILTER ("Tickets"." Number of tickets' using 'status '. ((("" Resolved "="Resolvido")) END ELSE 0)
I want to thank you all for the help, normally I post in the forum of the ADF but its good to know I can get a lot of support here as well...
Many thanks to all,
Frederico.
-
How to get the value of the outputtext in javascript and send it to backing bean
Hi Experts ADF,
JDev Version 11.1.1.7.0
I have the following: the value of the outputtext must be treated in javascript and the serverlistener method has the same value. I founded this value returns a string that wshould see the mouseover NIJ.
Help, please. Thanks in advance.
< af:column sortProperty = "#{bindings." OrderProposalReadClient.hints.exceptions.name}.
filterable = "true" sortable = "true".
headerText = "#{suiviewBundle.EXCEPTIONS} '"
ID = "c16" >
< af:outputText value = "#{row.exceptions}" id = "ot32" clientComponent = "true" > "
< af:clientListener type = "mouseOver".
method = "customJsFunction" / >
< af:serverListener type = "mycustomserverEvent".
Method="#{pageFlowScope.ChangeOrderProposalBean.handleServerEvent}"/ >
< / af:outputText >
< / af:column >
JavaScript
< af:resource type = "javascript" >
var customJsFunction = function (event)
{
var exceptiondata = AdfPage.PAGE.findComponentByAbsoluteId ('ot32');
AdfCustomEvent.queue ();
Returns true;
}
< / af:resource >
BackingBean
public String handleServerEvent(EC ClientEvent)
{
Please let me know how to get the value that javascript code sends here.
Let's say javascript sends the value of outputtext as "001".
So, I have to check "001" in my list and return a value that appears on mouseover.
}
Kind regards
RoyHello, Roy.
To use the value on another component of the user interface, I shows an example:
-code of the page
shortDesc = "shortDesc" >
method = "customJsFunction" / >
-the javascript code
var customJsFunction = function (event)
{
var exceptiondata = event.getSource ().findComponent("ot32").getValue ();
AdfCustomEvent.queue (event.getSource (),
"mycustomserverEvent,"
{param1:exceptiondata},
(true);
Returns true;
}
-OutputTextCase11.java
public void handleServerEvent (EC ClientEvent)
{
String param = (String) ce.getParameters () .get ("param1");
RichOutputText outputText = (RichOutputText) ce.getComponent () .findComponent ("ot1");
outputText.setShortDesc (param);
outputText.setValue (param);
AdfFacesContext.getCurrentInstance () .addPartialTarget (outputText);
}
I hope this helps you.
RFH.
-
How to get the value of viewrow by chain
With the help of Jdev11.1.1.5.0 - adfbc - ireport3.0.0
Here I will describe: what I've done.
use jsff (dynamic region) while hitting the af:tree nodes it opens. Fine OK
I had somevo manually wroten Query. and the query is fine no problem with it
I do drag and drop the pacctid correspondent run params vo as selectoncechoicehere i give sample not a original query select * from sometable where acctid = :pacctid
public static vo
Value of data - to pay account, advance
Announcement name - ap, given
in this jsff*page representation* account type : account payable (ap) - select one choice type advance (ad) - select one choice type like this some select once choice and some inputs. Run report - command button
. Java.jsff code <af:selectOneChoice value="#{bindings.ACCT_TYPE.inputValue}" label="Account Type" shortDesc="#{bindings.ACCT_TYPE.hints.tooltip}" id="soc3" required="true" autoSubmit="true" binding="#{backingBeanScope.SUP1040V.soc3}" valuePassThru="true" valueChangeListener="#{backingBeanScope.SUP1040V.ValueChangeListener1}"> <f:selectItems value="#{bindings.ACCT_TYPE.items}" id="si3"/> </af:selectOneChoice> <af:commandToolbarButton text="Export in pdf" id="ctb2"> <af:fileDownloadActionListener method="#{backingBeanScope.SUP1040V.Report}" /> </af:commandToolbarButton>
If I get ap means my report runs. or otherwise it will show an empty page.//while hitting the button following logs are appeared i show it as commented format. public void Report(FacesContext context, OutputStream out) throws IOException,Exception { FacesContext ctx = FacesContext.getCurrentInstance(); HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest(); HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); ..... BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry(); System.out.println("print binding" +bindings1 ); //while using sop i get this in my log : : print binding ReportsPageFragments_SUP1040VPageDef_WEB_INF_TaskFlows_SUP1040_V_TF_xml_SUP1040_V_TF JUCtrlListBinding listBinding1 = (JUCtrlListBinding)bindings1.get("ACCT_TYPE"); System.out.println("print list bindings" +listBinding1 ); //while using sop i get this in my log : : print list bindings0 Object selectedValue1 = listBinding1.getSelectedValue(); System.out.println("print selected value" + selectedValue1); //while using sop i get this in my log : : print selected valueViewRow [oracle.jbo.Key[AP ]] request.setAttribute("ACCT_TYPE", //here i want the value "AP" in String ); if i use like this means request.setAttribute("ACCT_TYPE", soc1.getValue() ); i get the index value. i need the dataname "ap" so i go above method which say wrotes ... ... request.getRequestDispatcher(response.encodeURL("/sup1040servlet")).forward(request,response); System.out.println("hihihihih"); response.flushBuffer(); ctx.responseComplete(); } public void ValueChangeListener1(ValueChangeEvent valueChangeEvent) { // Add event code here... String AcctType = valueChangeEvent.getNewValue().toString(); System.out.println("AcctType" + AcctType); FacesContext contxt = FacesContext.getCurrentInstance(); valueChangeEvent.getComponent().processUpdates(contxt); BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry(); // Get the sepecific list binding JUCtrlListBinding listBinding1 = (JUCtrlListBinding)bindings1.get("ACCT_TYPE"); // Get the value which is currently selected Object selectedValue1 = listBinding1.getSelectedValue(); System.out.println(selectedValue1); }
How to get the value of class viewrowimpl as string.
Published by: ADF7 on March 24, 2012 07:27ADF7,
I'm not sure that understand what you're up to.
For as far as I understand you want to get the value of display rather than the index
I use this codepublic void StatusChangedListener(ValueChangeEvent valueChangeEvent) { BindingContext lBindingContext = BindingContext.getCurrent(); BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry(); JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("Status"); int newindex = (Integer) valueChangeEvent.getNewValue(); Object row = list.getDisplayData(); // Wichtig um die liste zu laden!!!! Row lFromList = (Row) list.getValueFromList(newindex); Object lAttribute = lFromList.getAttribute("Value"); String newVal = (String) lAttribute; }
to get the value of a component of selectOneChoice...
Timo
-
How to get the value of a particular column column name?
Hi all
How to get the column name for a particular column value.
example:
create table test (ID number, col2, col3 varchar varchar);
Insert into test values (1, 'true', 'false');
Insert into test values (2, 'false', 'true');
commit;
I want to choose the name of the data column 'true' with id = 1;
That is to say) while waiting for answer is "col2". pls help someone.This might help:
DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT col2, col3 FROM test WHERE id = 1; -- FOR c IN (SELECT rownum rn, t2.column_value.getrootelement() name, EXTRACTVALUE(t2.column_value, 'node()') value FROM TABLE(XMLSEQUENCE(c1)) t, TABLE(XMLSEQUENCE(EXTRACT(column_value, '/ROW/node()'))) t2) LOOP IF c.value = 'true' THEN DBMS_OUTPUT.PUT_LINE(c.name); END IF; END LOOP; END;
-
How to get the values of the cells of an interactive report?
Hello
We use the APEX 4.0, with Oracle 10 g r2 on Windows XP.
I have a page with an interactive report, and I configured the "link" column to link to a target custom (instead of see a row).
This custom target is simply a call to a function of ajax (I hope!) view more information (in another region) on the clicked folder.
I think I have to display the primary key in the report and then get the value of call my function as:
to be able to find the information right on the straight line.javascript:my_function(ID);
But, how to get the value?
Kind regards.
Yann.Hello
Got to the report attributes tab and scroll down to the section of the link column. Click on the lightning bolt next to the column value, a popup displays Columsn names in reports of each locked in a pair of #.You pass the column for your javascript like this function
javascript:my_function('#ID#');
Kind regards
Maybe you are looking for
-
Cannot attach to post a pdf, Excel file!
I bought my iphone 6s 2 months ago... I can't attach a pdf file or excel file to mail from my iphone... .only with google reader, dropbox or icloud... cela *... I want a refund Apple... it is my second iphone and the last (first was the 2g)... .Samsu
-
How to stop Auto-filling of the id and the password on the yahoo login page?
Firefox asked me if I wanted my Yahoo login page automatically informed whenever I connect. I said 'yes' by mistake. Now, I know that I don't want. How can I stop it?
-
Service contract for codec status listed as unknown in TMS
Hi all We have a Cisco MX200 we recently installed and we bought 3 years maintenance contract to the unit by our partner Cisco. TMS currently appears the contract status of maintenance/service as unknown codec. We checked the codec with Cisco via t
-
I have a site that is complaining that their Citrix connection is to have abandoned several times per day. This seems to be specific to the site. I read of some limited on some firewall at a specified time SSL connections. The PIX will limit connecti
-
What Version of Dreamweaver I use, and how to pass?
I tried to build a reactive site in my dreamweaver cc version, but I'm really bad. I also use windows 8.The first thing I tried to know is what version of Dreamweaver that I currently use. I don't seem to be able to know.The next thing I wanted to