Displaying results of a query
Hi there
I want to display the results of a query.
OK I do kow how to do that. I do have one long text field
(MySQL) and in some cases the colomn I iwsh to display has a page
of information. I just want to display say the first 300
characters. I was initionally thinking rtrim or trim but tralise
that doesnt do it.
I cant find what the correct term is.
Thanks in advance
Actually, I believe the Right() function returns the last
part of the text, you will want to use the Left() function to
return the first part. . . .
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/js/html/wwhelp.htm?hre f=00000617.htm
-Mike
Similar Messages
-
How to display result of database query in JFrame?
How to display result of oracle database query in JFrame?
This is part of my code:
String username, password;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
OracleConnection conn = DriverManager.getConnection(String url, String username, String password);
Statement s= conn.createStatement();
ResultSet q= s.executeQuery("SELECT A, B, C FROM TABLE X");
Forget what url, username & password are. Is there any problem with my code?
What should be next if I want to display result of the query in a table in JFrame?Thx !How to create JTable with unknown no. of rows? How to get no. of rows of a query?
I saw the demo of creating JTable on java.sun.com but the the table has a certain no. of rows which is not applicable to my case.
Suppose the result of query is a table with 3 attributes so there are 3 columns in the table.
R contains the result of the query.
Should it be something like this if I want to create JTable of the query?
How to make n rows of {R.getString(1),R.getString(2),R.getString(3)};?
public SimpleTableDemo() {
super(new GridLayout(1,0));
String[] columnNames = {"A",
"B",
"C",
while (R.next())
// content of a row
Object[][] data = {R.getString(1),R.getString(2),R.getString(3)};
I can't run it because I still can't debug my code which is said before.
Thx! -
Unable to display results of multiple query in grid in Oracle SQL Developer
Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
My question: How to display multiple query results in grid in Oracle SQL Developer.
Example:
select * from Employee;
select * from Department;
- when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
- How to display result of both the queries in Grid.
Any thoughts on this would be really helpful.
Thanks in advance.
HarshHi Harsh,
I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid? -
Display results of MySQL query from AMFPHP by ArrayCollection in AS3 (Flash CS4)
Hi, i am using Flash CS4 (AS3) + AMFPHP + MySQL to do own flash frontend for Wordpress CMS. Everything is going fine but i`ve got one problem. Problem with properly display of result of query in AS3 by using ArrayCollection.
When i check my service in "amfphp/browser/" in web browser i`ve got this (with all needed data):
(mx.collections::ArrayCollection)#0
filterFunction = (null)
length = 2
list = (mx.collections::ArrayList)#1
length = 2 source = (Array)#2
That is the reason that i suppose that service work fine. Problem is when i try to display result in AS3. In actionscript i have got this:
function getNewsListHandler(result:Object):void{
trace(result);
This function displays: [object Object].
I know that "result" is an ArrayCollection type but i don`t know how to get rows and columns from this. I know that my data is there but i have no idea how to get it.
Clarify: I don`t know how to get to Arrays and simple data variables which are in ArrayCollection.
Could anyone help me with that problem. I would be gratefull
P.S. I tried also change query type in service.PHP for mysql_fetch_query but in that case i`ve got only one row (not all data).Thanks for fast reply,
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"});
you would get the data like
var resultstr:String = arr_coll[1][1].col2;
trace(resultstr);
//results in data4
could you explain me how it was happen (arr_coll[1][1].col2)? It`s not clear to me. I thought in this case rather something like this :
var resultstr:String = arr_coll[1]['col2'];
It should give me "data4". I know it wasn`t but i don`t understand ArrayCollection in level which is needed to use your advice in my case. Could you clarify "arr_coll[1][1].col2" a bit?
What would it look like when you would have something like this:
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"},{col1:"data5",col2:"data6"},{col1:"data7",col2:"data8"});
and you would want know f.e. position in ArrayCollection of "data6". How would you code this? arr_coll[1][2].col2? -
How to display result of a query in browser?
I have to write a simple application where I use EJB to access a database and then use Servlet/JSP to display the data to a browser. can anyone help me out please?
in my ejb i am taking the input as claim number and using a select query i am getting the row for the particular claim number from the database. Through a servlet i need to invoke the ejb and get the data(result of the query) displayed in a browser. I want to know a way to display the query result in the browser.
-
Display results from dynamic query created and executed inside procedure
Hi;
I have created this code:
CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, VAR3 IN VARCHAR2) AS
-- Do something
-- That ends up with a variable holding a query.... (just an example)
MainQuery :='select sysdate from dual';
end RunDynamicQuery;
How can I run this procedure and see the result on the dymanic query generated inside it?
BEGIN
compare_tables_content('VAR1','VAR2','VAR3');
END;
Expected Output for this given example:
20-05-2009 11:04:44 ( the result of the dymanic query inside the procedure variable MainQuery :='select sysdate from dual';)
I tested with 'execute immediate':
CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, filter IN VARCHAR2) AS
-- Do something
-- That ends up with a variable holding a query.... (just an example)
MainQuery :='select sysdate from dual';
execute immediate (MainQuery );
end RunDynamicQuery;
BEGIN
compare_tables_content('VAR1','VAR2','VAR3');
END;
Output:"Statement processed'' (no sysdate displayed ! )
Please consider that the collums in the query are always dynamic... PIPELINE Table would not work because I would need to define a container, example:
CREATE OR REPLACE TYPE emp_tabtype AS TABLE OF emp_type;
FUNCTION RunDynamicQuery (p_cursor IN sys_refcursor)
RETURN emp_tabtype PIPELINED
IS
emp_in emp%ROWTYPE;
BEGIN
LOOP
FETCH p_cursor
INTO emp_in;
EXIT WHEN p_cursor%NOTFOUND;
PIPE ROW (...)That would be a nice solution, thanks :)
''For now'' I implemented like this:
My dynamic query now returns a single string ( select col1 || col2 || col3 from bla)
This way I don't have dynamic collumns issue, and from business side, this ''string'' format works for them.
This way I can use the pipelines to get the result out...
OPEN myCursor FOR MainQuery;
FETCH myCursor
INTO myRow;
WHILE (NOT myCursor%notFound) LOOP
PIPE ROW(myRow);
FETCH myCursor
INTO myRow;
END LOOP;
CLOSE myCursor; -
I have a list with almost 10000 items. I have a view that should be returning 8 items. For me, the Farm Admin, I see the full set of expected values. The message "Displaying only the newest results below. To view all results, narrow your query by
adding a filter" shows for other users. This makes no sense -
there ARE filters on this view. I'd rather not increase the throttle limit.
Anthony KellyHi Ajk,
Check that the list is not scoped by an audience; but, I'm afraid that either way admin, (e.g. non Farm admin or site collection admin)
I'd recommend exporting to excel, create two new spreadsheets and then import as custom lists.
Best of luck and cheers,
Stacy Anothersharepointblog.blogspot.com -
Hi All,
I am crawling documents from a file server. I created a new content source and crawled the documents. All documents are crawled successfully.
Then I went to my enterprise search center site collection and created a new result source. I have added the query to use above content source.
After that, on a page I am trying to configure the search results web part to display documents using this result source. Now the problem is:
It displays all the documents that are crawled without searching for anything. I mean first it should not display any results. If a user searches for something , then according to that search it should display results.
Any idea how to do this in the web part? I am using SharePoint 2013 on premise enterprise edition. No code. Totally OOTB.Hi Mohan,
What did you use for the Query text in the result source?
I could reproduce this issue when I used Query text like: {searchTerms} Path:”http://sps2k13sp/sites/First/Shared%20Documents”
Then I changed the Query to
{?{searchTerms}
Path:"http://sps2k13sp/sites/First/Shared%20Documents"}
, then Search result web part didn’t return results without searching.
So , check your result source, and use the Query like the above(adding "{?...}").
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
Hi,
In one of my list there are 33,000 records.
It gives message "Displaying only the newest results below. To view all results, narrow your query by adding a filter."
I don't want to change my threshold limit. Can anybody please tell me steps to resolve this issue?
Regards,
Amit KhatriI have a list of 11,000 items. Even though I have setup filters on it and it shows all 10 records based on that filter, it still shows that warning on top. For some items, even with those filters, I don't see the list items at all. How do I deal with
this situation. I don't want to change my threshold limits from CA either. Please help.
MAK -
Display the result of a query in descending order.
Hello Experts,
How can I display the result of a query in descending order?
Thanks much in anticipation.
Regards.Hi Kumar,
If you want to display char in descending order, in the query designer set the sorting setting as desceing for that particular characteristics, or if you want to see the KF in descending order, create a condition on that KF and set as TOP N and set N as 999999, that would display your KF in descending order.
- Danny. -
Result of a query on the display
Hi,
im a new member here, and I have a smple question
I am using PHP + MySQL + J2ME to build a simple application..
I need to display a result of a query in a drop down list or a text field on the display..
Can anyone guide me to the right direction?
Thank youTake a look at one of the thousends of examples available? Google is your friend!
-
How do you use BOBJ SDK to retrieve the results of a query in XML
I am trying to programatically get the results of a query given the query id
My old code used BusinessObjects Enterprise Web Services API to Retrieve a document's contents
DocumentInformation biDocInfo;
RetrieveData retBOData = RetrieveData.Factory.newInstance();
Action[] actions = new Action[1];
retBOData.setRetrieveView(xmlView);
biDocInfo = rEngine.getDocumentInformation(queryId, null, actions, null, retBOData);
(XMLView) biDocInfo.getView();
Is there an equivalent way to retrieve the results of the query using SAP BusinessObjects BI 3.x Developer SDK Library ?
Thanks for any informationHello.
Are you wanting to use the BusinessObjects Enterprise SDK along with the Report Engine SDK as opposed to using the Web Services SDK that you were using previously?
Also, what part of a webi document are you trying to get the XML format of?
- Whole document
- Single report within a document
- Report page of a report
- Report part within a report
- All data providers
- Single data provider
If you are trying to use Business Objects Enterprise along with the Report Engine SDK, there are numerous samples for the various parts of the webi document that I mentioned above available at the following link:
http://wiki.sdn.sap.com/wiki/display/BOBJ/JavaReportEngineSDKSamples
I hope that this information helps.
Regards.
- Robert -
Appearance of result row in query
Hi guys,
I have the following query example (part of it):
row1 100.000 credit amount
row2 100.000 credit amount
row3 100.000 credit amount
result 300.000
I only want to be displayed:
row1 ...
row2 ...
row3 ...
result 100.000
I know how the rows (1-3) can be handled that they appear empty but don´t know how to handle that the result appears in 100.000.
I thought about exception aggregation but the key figure Im using in this case is not calculated (only uploaded). And as far as I know the expection aggregation only works for calculated key figures.
Any idea?Hi, There are 2 ways, 1st you can define 'Constant' selection else if there are some issues due to CKFs' restrictions 2nd method is to perform a simple average you can try using a simple 'Formula' like SUM(X) / # of records. Ex. (100100100)/3 = 100. Try using the option which retains the value constant, else you can also define the 'No Display' in o/ps like 'Display Results As..' in the last tab of BEx titled 'Calculations''. You can get the # of records by using 0ROWCOUNT in case of DSO or using Data Functions like COUNT(X).
-
I need to write a java client that sends a query to server and display result in browser. I intend to call from the client the command 'cmd.exe /c start url' which will send a http request and bring up a browser for the result. But somehow if the url has more than one query argument, for example -- "http://hostname/test?node1=abc&node2=123", only everything before the "&" is taken, i.e. "http://hostname/test?node1=abc".
Another approach would be to do it step by step, send a regular http request, either the server or the client save the result to a file, then call 'cmd.exe /c start file_location'.
Does anyone have any better idea to work this out or why 'start url' wouldn't work? thanks.The command interpreter (cmd.exe) is interpreting the "&" and thus, is dropping everything after it.
e.g. Try this from a DOS prompt:
cls&echo hey
You get a clear screen, with "hey" at the top, and then the prompt.
Similarly, try this:
cmd.exe rem hello&echo goodbye
You get a new command prompt. Fine. Now exit that, and you get "goodbye" on the screen because that command was still queued up.
Maybe try using the hex equivalent for the "&" character?
Hope that sheds a little light - good luck!
Regards,
Nate -
Display results as String: dosen't work based on the example
Hello,
To understand how to display results as string, I tried to reproduce this:
[http://apex.oracle.com/pls/otn/f?p=31517:84|http://apex.oracle.com/pls/otn/f?p=31517:84]
I have my table emp
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7839 KING PRESIDENT - 81-11-17 5000 - 10
7698 BLAKE MANAGER 7839 81-05-01 2850 - 30
7782 CLARK MANAGER 7839 81-06-09 2450 - 10
7566 JONES MANAGER 7839 81-04-02 2975 - 20
7788 SCOTT ANALYST 7566 82-12-09 3000 - 20
7902 FORD ANALYST 7566 81-12-03 3000 - 20
7369 SMITH CLERK 7902 80-12-17 800 - 20
7499 ALLEN SALESMAN 7698 81-02-20 1600 300 30
7521 WARD SALESMAN 7698 81-02-22 1250 500 30
7654 MARTIN SALESMAN 7698 81-09-28 1250 1400 30
7844 TURNER SALESMAN 7698 81-09-08 1500 0 30
7876 ADAMS CLERK 7788 83-01-12 1100 - 20
7900 JAMES CLERK 7698 81-12-03 950 - 30
7934 MILLER CLERK 7782 82-01-23 1300 - 10 I created with the wizard, on my page, a new REPORT REGION
- selected SQL RESULT -
- Name: Test
- Region Source Type: SQL Query
- Region Template: Report Region
IN Enter SQL Query or PL/SQL function returning a SQL Query, I COPY-PASTE the following code from [http://apex.oracle.com/pls/otn/f?p=31517:84|http://apex.oracle.com/pls/otn/f?p=31517:84]
DECLARE
p_vc_arr2 htmldb_application_global.vc_arr2;
p_string VARCHAR2 (2000);
BEGIN
SELECT ename
BULK COLLECT INTO p_vc_arr2
FROM emp
WHERE deptno = :p84_select_deptno;
p_string :=
HTMLDB_UTIL.table_to_string (p_vc_arr2, ':');
HTP.p (p_string);
END;AND I have this error:
+1 error has occurred+
Invalid query, no select statement found
Is not a PL/SQP functiion??
What do I do wrong?
thanks,
Roseline Paquin
Montreal, Canada1 error has occurred
Invalid query, no select statement foundWhat if you try
DECLARE
p_vc_arr2 htmldb_application_global.vc_arr2;
p_string VARCHAR2 (2000);
BEGIN
SELECT ename
BULK COLLECT INTO p_vc_arr2
FROM emp
WHERE deptno = :p84_select_deptno;
return 'select ''' || HTMLDB_UTIL.table_to_string (p_vc_arr2, ':') || ''' str from dual';
END;??
Maybe you are looking for
-
Opening PDF files that are posted on our website
I create a monthly newsletter using inDesign 5.0. Since I switched to inDesign, I've had mixed results from users opening the files. There is nothing that I can pinpoint as the problem. For some users, the file will open right away in the browser
-
Function Module for BOM for posting BOM component long text
Is there any SAP provided Function Module for posting BOM components long text if so please let me know as it is very urgent for me.
-
Best way to handle Christmas music - Playlist or separate Library?
Anyone have a suggestion about the "best" way to handle Christmas music? After reading the article below I'm tempted to create a new library for Christmas music... that way I can keep it on an external drive or even DVD. http://www.allthingsmarked.co
-
Hello Experts, I'm loading data from an infocube to some infoobject attributes. In the update rule of the start routine, I need to delete datapackage for several criteria: delete DATA_PACKAGE where STOR_LOC NE 'SL01'. delete DATA_PACKAGE where MO
-
Agent control character set problem
Hi, here's my problem : i've got the grid that's running on a RHES4 with an agent. On another RHES4, i've got 10g databases that run and another agent. The repository database is configured like this : nsl_language = AMERICAN nls_territory = AMERICA