Need QUERY result in Graph
Dear Experts,
I am having the following requirement.
Can it be possible to present the QUERY result in Graph ?
I read many thread in SDN, I found through APD/WAD we can do it . But I am confused.
But I am not getting any thread , How to proceed step by step ?
Kindly help..
Thanks,
Sethi
Hi,
If you are using Bex Query make as work book ,in that you can add charts and save as work book not as a query.
To insert the chart
Go to insert tab in the Excel(Work book) choose which chart you want in that.
After that go the chart which you have selected, right click and go to select data option, choose series for Entries and choose labels for category.
Hope it helps.
Thanks & Regards,
Ramnaresh.P.
Similar Messages
-
Hi friends,
In my Query designer we have used material,plant,suite,style and two keyfigures.
I give only suite as selection..ex. suite = 10.
the output of my query is like
material plant suite value1 value2 total
101 A 10 25 2 50
103 A 10 35 3 105
107 A 10 15 4 60
104 A 10 20 1 20
105 A 10 55 2 110
Total 150 12 345
my requirement is I need only Total of total Value(i.e 345 ) without displaying material numbers....
If I use material as free characteristics, the total will be ( 150*12 = 1800). it is wrong.
so, how can I get total(345) only in my query..... is any possibility? if yes, guide me........
with hopes
JD...
Edited by: jaya durai on Apr 15, 2008 8:23 AM
Edited by: jaya durai on Apr 15, 2008 8:24 AM
Edited by: jaya durai on Apr 15, 2008 8:25 AMhi Raj,
Already I have tried this, It still appears 1800... is have any function module or user exit, if yes, tell me...
If I hide material, the result displayed in 6th row. because 5 rows for material... but I need only one row which should have only total value..anyhow, thanks for response....
with hopes,
JD -
Returning query results in XML format
Besides using custom tag library, does anyone know any methods or techniques that i can retrive the query results from database in XML format. for example, i have a table named student in database like this:
StudentNo Name Gender Degree
123 Tony male B.Comp.Sci.
456 Tom male B.Fiance
343 Mary female B.Accountingso, if i have query select * from table student, i would get someting like the following:
<row>
<studentNo>123</studentNo>
<name>Tony</name>
<Gender>male</Gender>
<Degree>B.Comp.Sci</Degree>
</row>
<row>
<studentNo>456</studentNo>
<name>Tom</name>
<Gender>male</Gender>
<Degree>B.Finace</Degree>
</row>
The reason i am asking for this is i need query results returned in XML format, so i can wrap XSLT tag around, and apply for HTML, WML, and XHTML template resprectively so i can display them on different terminals. any help is appreciated.I have this method in a ResultSetMapper class:
* Return result sets as an XML stream, with root tag named
* "results", one "result" tag per row, and "result" child tag
* names equal to the column name
* @param query result set
* @param list of column names to include in the result map
* @throws SQLException if the query fails
* @throws JDOMException if the XML stream creation fails
public static final Document toJDOM(ResultSet rs, List wantedColumnNames)
throws SQLException, JDOMException
Element rows = new Element("results");
int numWantedColumns = wantedColumnNames.size();
while (rs.next())
Element row = new Element("result");
for (int i = 0; i < numWantedColumns; ++i)
String columnName = (String)wantedColumnNames.get(i);
Object value = rs.getObject(columnName);
row.addContent(new Element(columnName).setText(value.toString()));
rows.addContent(row);
return new Document(rows);
}It uses JDOM from www.jdom.org. - MOD -
Need blnak line in query result
In sqlplus query result, i need a blank line between each row. how can I get it? solution please.
There are various ways...
If you actually want generated blank rows...
SQL> ed
Wrote file afiedt.buf
1 select decode(rn, 1, empno) as empno
2 ,decode(rn, 1, ename) as ename
3 ,decode(rn, 1, job) as job
4 ,decode(rn, 1, mgr) as mgr
5 ,decode(rn, 1, hiredate) as hiredate
6 ,decode(rn, 1, sal) as sal
7 ,decode(rn, 1, comm) as comm
8 ,decode(rn, 1, deptno) as deptno
9 from emp, (select rownum as rn from dual connect by rownum <= 2) r
10* order by emp.empno, r.rn
SQL> /
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
1111 WILLIS CLERK 7902 18-JAN-08 900 20
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
30 rows selected.
SQL> -
I need to print one query result as a single row
Hi,
I need to print one query result as a single row ,which gives more than one value (of subinventories)and also i would like to print the quantity of that particular subinventory at particular place.Please suggest how can i do this in the report builder?Actually I need to print inventory report with subinventory break up.For that all subinventories of category code AB are taken as single row.Based on that subinventory value Quantity must be printed at that particular place.
For ex
Quantity
Item no Description Subinventory Code AB_Abc AB_Def AB_ghi
1 ***** 12 9
2 ****** 8 5
like that.I am waiting for the reply.Plz its some how urgent.
Thank you, -
Entity-Named Query Caching - Need live results from DB not Cached
I've developed an application EJB3 web application which uses Entity Beans and NamedQueries to retrieve my results.
Aswell as my main EJB3 web application I also have an external interface (Oracle Stored Procedure) which is updating data in my database tables. The problem is that the when the NamedQueries are called they only bring back "Cached" resultsets and not the live results that exists in the database at that time. If my Stored Procedure updates a value (or if I update a value via Toad for testing) the NamedQuery does not bring back these changes. From what I have read about NamedQueries it seems that they do actually query the live db but send back the cached values for performance reasons.
Is there a way to turn off caching of Query results?
If not is there another way to deal with this issue?
ps. I'm using Jdev 10.1.3.4 and appserver 10.1.3.1Anyone?
-
Need help on retrieving query result - NPE
Hi, I could get results with the native query in my TOAD, but I can't get it working in my session EJB. I tried both native query and EJB ql. The query created fine, as soon as I try to retrieve results, it gets stuck.
My native query looks like this:
Query query = em.createNativeQuery("select sum(o.amount_reimbursed) from t_expenses o where o.employee_id = '999999911' " +
"and o.EXPENSE_ID in (select p.expense_id from T_Per_Diem_Xref p where p.expense_Type_Xref_Id=22 " +
"and p.expense_Id in (select e.expense_Id from T_Expenses e where e.employee_Id='999999911' " +
"and e.expense_date > to_date('01/01/2011', 'mm/dd/yyyy') and e.expense_date < to_date('12/31/2011', 'mm/dd/yyyy')))") ;
My EJB query looks like this:
Query query = em.createQuery("select sum(o.amountReimbursed) from TExpenses o where o.employeeId = ?1 " +
"and o.expenseId in (select p.expenseId from TPerDiemXref p where p.expenseTypeXrefId=?2 " +
"and p.expenseId in (select e.expenseId from TExpenses e where e.employeeId=?1 and e.expenseDate>=?3 and e.expenseDate<=?4))");
query.setParameter(1, employeeId);
query.setParameter(2, expenseType);
query.setParameter(3, fDay, TemporalType.TIMESTAMP);
query.setParameter(4, lDay, TemporalType.TIMESTAMP);
Either one, I get NPE at the line retrieve result.
// sumAmt = (Double)query.getSingleResult();
List list = query.getResultList();
if (list != null) {
long longAmt = (Long)list.get(0);
sumAmt = (Double)list.get(0);
As you can see, I tried to getSingleResult, or getResultList. also tried to convert the result to Double or Long. None worked.
Please help and thank you for your time.
SophiaFrank, thank you for your reply. I have this code in my session Facade EJB, and I get the NPE in my backing bean which calls this method. When I debug the code, it appears what really cuases the problem is in this code on the line I try to assign the query result to my variable 'sumAmt = (Double)query.getSingleResult();'. In the debug, when it reaches this line, it starts to give me all kinds of pop-up windows saying couldn't find this file or that file or packages. If I get a stack trace later, I will post it. Right now I am trying to fix something else.
Thanks, Sophia -
Need SQL Query which saves query results to an excel file
Hi,
I am looking for a sql query which saves/ export results of an query to a excel file
Thanks,
ChetanI am looking for a sql query which saves/ export results of an query to a excel file
Thanks,
Chetan
Options:
1) You can use
BCP command to export result to excel
2) Insert into excel by using OPENROWSET
3) Use Import and Export Wizard and provide SQL query as source and Excel as destination
Please refer:
http://stackoverflow.com/questions/87735/how-do-you-transfer-or-export-sql-server-2005-data-to-excel
http://www.codeproject.com/Questions/617527/Export-sql-query-result-in-excel-file
Cheers,
Vaibhav Chaudhari
[MCTS],
[MCP] -
How to get Query Results based on Analysis Authorization Ranges????
Hi Experts,
I have gone through the lot of SDN Links, however not able to find the answer to my question.
I have an Authorization Issue, NO Authorization
Error : EYE 007 ( Insufficient Authorizations )
<b>Here is the issue:</b>
Need to see the complete query result when I gave the range in Analysis Authorization for Controlling Area 001-005. Controlling Area is auth relevant and right now a variable is inserted in the query for it. If I select Controlling Area 001, the result for Controlling Area 001 is displayed in query. If 002 then also displayed. If I do not enter anything, then I get the <b>Eye 007 error message</b>.
I am not sure how do I display/authorize the entire result in the query for all the Controlling Areas, I have authorized user to see??
<b>Its really urgent, please help..!</b>
Here are the logs:
Authorization Check Log
Date and Execution Time (Local Server)
Execution Date: 06.09.2007
Execution Time: 14:48:41
Executed Query: 0CCA_C11/GBCCA_MP01_Q0002_AP
Executed by User ZBI_TEST_001
Executed with Analysis Authorizations of Another User ZBI_TEST_001
InfoProvider Check
Building the Buffer...
...Buffer Built
Are there authorizations for accessing InfoProvider 0CCA_C11 with activity 03?
Authorization exists for general access to InfoProvider 0CCA_C11 with activity 03
InfoProvider Check
Authorization exists for general access to InfoProvider 0CCA_C11 with activity 03
Relevant Characteristics for Detailed Authorization Check
(Characteristics with Full Authorization Are Not Listed!)
List of Effective Authorization-Relevant Characteristics for InfoProvider 0CCA_C11:
0CO_AREA
0TCAACTVT
Relevant Characteristics for Detailed Authorization Check
(Characteristics with Full Authorization Are Not Listed!)
List of Effective Authorization-Relevant Characteristics for InfoProvider :
List Is Empty:
There Are No Characteristics That Have to Be Checked in Detail
Authorization Check
Detail Check for InfoProvider 0CCA_C11
Preprocessing:
Selection Checked for Consistency, Preprocessed and Supplemented As Needed
Subselection (Technical SUBNR) 1
Check Node Definitions and Value Authorizations...
Node- and Value Authorizations Are OK
End of Preprocessing
Filling the Buffer...
...Buffer Filled
Main Check:
Subselection (Technical SUBNR) 1
Supplementation of Selection for Aggregated Characteristics
No Check for Aggregation Authorization Required
Following Set Is Checked Comparison with Following Authorized Set Result Remaining Set
Characteristic Contents
0CO_AREA
0TCAACTVT
SQL Format:
CO_AREA = '0003'
AND TCAACTVT = '03'
Characteristic Contents
0CO_AREA I BT 0001 0005
0TCAACTVT I EQ 03
I EQ 16
Authorized
Subselection (SUBNR) Is Authorized
Authorization Check Complete
Authorization Check
Detail Check for InfoProvider 0CCA_C11
Preprocessing:
Selection Checked for Consistency, Preprocessed and Supplemented As Needed
Subselection (Technical SUBNR) 1
Check Node Definitions and Value Authorizations...
Node- and Value Authorizations Are OK
End of Preprocessing
Filling the Buffer...
...Buffer Filled
Main Check:
Subselection (Technical SUBNR) 1
Supplementation of Selection for Aggregated Characteristics
No Check for Aggregation Authorization Required
Following Set Is Checked Comparison with Following Authorized Set Result Remaining Set
Characteristic Contents
0CO_AREA
0TCAACTVT
SQL Format:
TCAACTVT = '03'
Characteristic Contents
0CO_AREA I BT 0001 0005
0TCAACTVT I EQ 03
I EQ 16
Partially or Fully Authorized (Intersection) Characteristic Contents
0CO_AREA
0TCAACTVT
SQL Format:
( CO_AREA < '0001'
OR CO_AREA > '0005' )
AND TCAACTVT = '03'
Value selection partially authorized. Check of remainder at end
Following Set Is Checked Comparison with Following Authorized Set Result Remaining Set
Characteristic Contents
0CO_AREA
0TCAACTVT
SQL Format:
( CO_AREA < '0001'
OR CO_AREA > '0005' )
AND TCAACTVT = '03'
Characteristic Contents
0CO_AREA I BT 0001 0005
0TCAACTVT I EQ 03
I EQ 16
Not Authorized
All Authorizations Tested
Message EYE007: You do not have sufficient authorization
No Sufficient Authorization for This Subselection (SUBNR)
Following CHANMIDs Are Affected:
184 ( 0CO_AREA )
Authorization Check CompleteHi,
Have you defined the vaule for 0CO_AREA as BT 001-005 in you Authorization for 0CO_AREA.Also how have you defined your Authorization Variable on the query? Have you define as select options or interval? I thing you need to define it as interval or select options.
Hope it helps,
Cheers,
Balaji -
I tried to make the question as explicit as possible.
Refer to Sql Server Management Studio's Results view. Depending upon the structure of the execution plan, the Results pane may begin displaying results while the query is still executing. Can someone point me in a direction for architecting a
data layer (I am tech and framework agnostic for this task. Any solution will suffice) that will begin receiving pages of the set before SQL Server has completed the entire query?
The call from the data layer to SQL Server will obviously have to be asynchronous, but is there any additional ceremony that I need to be aware of when issuing OPTION (FAST x) to the query optimizer?Thanks for the reply. (I actually meant to put this in the SQL Data Access forum, not the T-SQL forum)
"Generally the last step is ORDER BY in a
query, so nothing can start before that executes."
I would imagine you cannot ORDER BY and yield results as they are fetched because of the execution plan that would be generated. For the purposes of this post, please assume that sorting will be done purely client side
"Can you post your query?"
For purposes of discussion, let's assume that the query is
select *
from information_schema.columns
and also assume that you have "lots" of columns to display.
This was an exploratory question to see what would be necessary to replicate the behavior of Management Studio's Query Result view in a custom application.
I would imagine that there's going to be a lot of analysis of the execution plans that get generated in order for the OPTION (FAST x) optimizer hint to do any good, but apart from general tuning concerns that would allow SQL SERVER to yield a page of data
"fast", I was wondering if there was anything else required of the calling client to force it to yield return its first page.
After thinking about this (and phrasing it the way I did in the last sentence) perhaps this is the incorrect forum for this question. I imagine that my concerns are better addressed in forums dedicated to the technology of the calling client (which
would be a .NET assembly)
Be that as it may, if there is any ceremony that SQL Server imposes on clients in order to yield return, I would expect that my question would be in the scope of SQL Server discussions (even though I intended this to be in a different SQL Server forum) -
How to generate XML file from oracle database query result
Hi dudes,
as stated on the subject, can anyone suggests me how can i achieve the task stated above??
Here is a brief description of my problem:
I need to create a XML file once i query from the oracle database, and the query result returned from the database will be stored in XML file.
I'd searched around the JAXB, DOM, SAXP and the like basic concepts, but i still don't know how to start??
Any suggestions ???Read this:
http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
You might have to read more of the book to understand that chapter. -
Stepping through a query result set, replacing one string with another.
I want to write a function that replaces the occurance of a string with another different string. I need it to be a CF fuction that is callable from another CF function. I want to "hand" this function an SQL statement (a string) like this: (Please note, don't bother commenting that "there are eaiser ways to write this SQL..., I've made this simple example to get to the point where I need help. I have to use a "sub_optimal" SQL syntax just to demonstrate the situation)
Here is the string I want to pass to the function:
SELECT
[VERYLONGTABLENAME].FIRST_NAME,
[VERYLONGTABLENAME].LAST_NAME,
[VERYLONGTABLENAME].ADDRESSS
FROM
LONGTABLENAME [VERYLONGTABLENAME]
Here is the contents of the ABRV table:
TBL_NM, ABRV <!--- Header row--->
VERYLONGTABLENAME, VLTN
SOMEWHATLONGTALBENAME, SLTN
MYTABLENAME, MTN
ATABLENAME, ATN
The function will return the original string, but with the abreviations in place of the long table names, example:
SELECT
VLTN.FIRST_NAME,
VLTN.LAST_NAME,
VLTN.ADDRESSS
FROM
LONGTABLENAME VLTN
Notice that only the table names surrounded by brackets and that match a value in the ABRV table have been replaced. The LONGTABLENAME immediately following the FROM is left as is.
Now, here is my dum amatuer attempt at writing said function: Please look at the comment lines for where I need help.
<cffunction name="AbrvTblNms" output="false" access="remote" returntype="string" >
<cfargument name="txt" type="string" required="true" />
<cfset var qAbrvs=""> <!--- variable to hold the query results --->
<cfset var output_str="#txt#"> <!--- I'm creating a local variable so I can manipulate the data handed in by the TXT parameter. Is this necessary or can I just use the txt parameter? --->
<cfquery name="qAbrvs" datasource="cfBAA_odbc" result="rsltAbrvs">
SELECT TBL_NM, ABRV FROM BAA_TBL_ABRV ORDER BY 1
</cfquery>
<!--- I'm assuming that at this point the query has run and there are records in the result set --->
<cfloop index="idx_str" list="#qAbrvs#"> <!--- Is this correct? I think not. --->
<cfset output_str = Replace(output_str, "#idx_str#", ) <!--- Is this correct? I think not. --->
</cfloop> <!--- What am I looping on? What is the index? How do I do the string replacement? --->
<!--- The chunck below is a parital listing from my Delphi Object Pascal function that does the same thing
I need to know how to write this part in CF9
while not Eof do
begin
s := StringReplace(s, '[' +FieldByName('TBL_NM').AsString + ']', FieldByName('ABRV').AsString, [rfReplaceAll]);
Next;
end;
--->
<cfreturn output_txt>
</cffunction>
I'm mainly struggling with syntax here. I know what I want to happen, I know how to make it happen in another programming language, just not CF9. Thanks for any help you can provide.RedOctober57 wrote:...
Thanks for any help you can provide.
One:
<cfset var output_str="#txt#"> <!--- I'm creating a local
variable so I can manipulate the data handed in by the TXT parameter.
Is this necessary or can I just use the txt parameter? --->
No you do not need to create a local variable that is a copy of the arguments variable as the arguments scope is already local to the function, but you do not properly reference the arguments scope, so you leave yourself open to using a 'txt' variable in another scope. Thus the better practice would be to reference "arguments.txt" where you need to.
Two:
I know what I want to happen, I know how to make it happen in another programming language, just not CF9.
Then a better start would be to descirbe what you want to happen and give a simple example in the other programming language. Most of us are muti-lingual and can parse out clear and clean code in just about any syntax.
Three:
<cfloop index="idx_str" list="#qAbrvs#"> <!--- Is this correct? I think not. --->
I think you want to be looping over your "qAbrvs" record set returned by your earlier query, maybe.
<cfloop query="qAbrvs">
Four:
<cfset output_str = Replace(output_str, "#idx_str#", ) <!--- Is this correct? I think not. --->
Continuing on that assumption I would guess you want to replace each instance of the long string with the short string form that record set.
<cfset output_str = Replace(output_str,qAbrs.TBLNM,qAbrs.ABRV,"ALL")>
Five:
</cfloop> <!--- What am I looping on? What is the index? How do I do the string replacement? --->
If this is true, then you are looping over the record set of tablenames and abreviations that you want to replace in the string. -
Query result caching on oracle 9 and 10 vs indexing
I am trying to improve performance on oracle 9i and 10g.
We use some queries that take up to 30 minutes to execute.
I heard that there are some products to cache query results.
Would this have any advantage over using indexes or materialized views?
Does anyone know any products that I can use to cache the results of this queries on disk?
Personally I think that by using the query result caching I would reduce the cpu time needed to process the query.
Is this true?Your message post pushes all the wrong buttons starting with the fact that 9i and 10g are marketing labels not version numbers.
You don't tune queries by spending money and throwing resources at them. You tune them by identifying the problem queries, running explain plans, visualizing their output using DBMS_XPLAN, and addressing the root cause.
If you want help post full version numbers, the SQL statements, and the DBMS_XPLAN outputs. -
How to add different query results in Report designer
Hi,
I am creating a report based on 3 queries. At the end i need to show total of 3 query results.
How can i add results of queries in report designer??
thanks in advanceHi Siva,
As u said that u want to show the results of the queries through report designer but i think it is used for formatted reports .
If u want to see tha results of diffrent query then u can use workbook .
In workbook u can also analyse reports easily by applying slice and dice techniques .
from different queries result set will be displayed on workbook with formatting and good look and feel.
regards,
Supriya -
How to save query result on the file server as excel file?
Hi everyone,
I need to save the the query result on the file server as excel file.
Do you have any idees how can I do it?
Regards
Erwini dont think you can save as excel file but you can save it as CSV use APD or RSCRM BAPI for this
Maybe you are looking for
-
No network connection after hp laserjet m602 firmware update
After updating firmware on our hp laserjet M602 printers, the printers are no longer communicating with our print server. I can't even print configuration pages, if the Network cable is connected. The update completed successfully and I can print us
-
its been greyed out for a while now, and i cant in any way get my wi-fi on. does anybody know of any updates please?
-
Fans are running at full speed after hard drive upgrade. Used same brand drive.
My Western Digital 500GB hard drive crashed. The date on it is Aug. 2010. I swapped it out for a Western Digital Caviar Black 1TB. All plugs were identical including the temp sensor cable. My fans now run at full speed. What gives? BTW. This is th 3r
-
J'ai accepté la mise à jour de Itunes proposée. A présent s'affiche en permanence "runtime error 6034". Que faire? PC vista.
-
Keyboard shortcuts have changed (?)
Hi all, I'm in UK and use British English settings for my keyboard. Recently I've noticed that when pressing shift+3, which would usally give me '£', now gives me '#'. So basically shift and alt have switched functions. I've no idea how to sort this