ColdFusion Query and Structures to JSON
Hello All,
Please, excuse my self-promotion.
If you are trying to integrate Spry JSON with ColdFusion then
try
toJSON.cfc.
Hope it helps you.
Almost there!
If I do select -expandproperty results then I just get
count
470
(The data has changed from the above example from 295 page views to 470).
I don't get any of the other data, which are the % of page views for each browser.
However, if I do select -expandproperty performanceStats then I just get
fileReadCount : 3
inspectedCount : 562
matchCount : 470
processCount : 3
fileProcessingTime : 2
mergeTime : 0
ioTime : 2
wallClockTime : 7
fullCacheHits : 1
partialCacheHits : 0
cacheMisses : 0
cacheSkipped : 2
maxInspectedCount : 297
minInspectedCount : 24
Which appears to be the complete set from the original JSON output. The same is true of metadata:
eventTypes : {PageView}
eventType : PageView
openEnded : True
beginTime : 2015-02-09T13:17:14Z
endTime : 2015-02-10T13:17:14Z
beginTimeMillis : 1423487834145
endTimeMillis : 1423574234145
rawSince : 1 DAYS AGO
rawUntil : `now`
rawCompareWith :
guid : 3c4d61b1-4413-2bd6-ff0f-cf11ed32b687
routerGuid : c7cef9c4-c84e-b1a5-618e-5f729be666d3
contents : {@{function=alias; alias=Total Page Views; contents=}, @{function=alias; alias=IE; contents=},
@{function=alias; alias=Chrome; contents=}, @{function=alias; alias=Firefox; contents=}}
It's frustrating that it only appears to be these values that are not displaying.
Similar Messages
-
How to create a transport request with query and only with its structure.
HI guru,
how to create a transport request with query and only with its structure.transport request should not include any other query items like ( variables, conditions...etc)
thanks in advance.
venkataHi,
Goto RSA1 and then Transport Connection -> In SAP Transports select Object Types-> Query Elements -> Then select Query->Give Technical name of the query and then select for transfer. In the right side you can choose the components which you wanted to transport.
Regards,
anil -
Variables and Structure in Existing query
Hi,
Where can i see the Variables and Structure in Existing query.
Thanks
PriyankaOpen the Query from Query designer.
Click on 'Query properties' in tool bar.
You can see the variables under 'sequence of variables' window.There you can change the Sequence of variables also.
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a569ae09411d2acb90000e829fbfe/content.htm -
Query with tables of BKPF and BSEG and Structures COBL, RF05A
hi experts,
I want to create query with the tables of BKPF and BSEG and Structures COBL, RF05A
How can i proceed?
Please give me complete points
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PMcheck the common fields and required fields and the write SELECT query useing Inner Joins or For all entries
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PM -
Problem with return a ColdFusion query object from a Java class
Hi!
I need to return a ColdFusion query object from a Java class
using a JDBC result set ( java.sql.ResultSet);
I have tried to pass my JDBC result set in to the constructor
of the coldfusion.sql.QueryTable class with this code:
ColdFusion code
<cfset pra = createObject("java","QueryUtil").init()>
<cfset newQuery = CreateObject("java",
"coldfusion.sql.QueryTable")>
<cfset newQuery.init( pra.getColdFusionQuery () ) >
My java class execute a query to db and return QueryTable
Java code (QueryUtil.java)
import coldfusion.sql.QueryTable; // (CFusion.jar for class
QueryTable)
import com.allaire.cfx //(cfx.jar for class Query used from
QueryTable)
public class QueryUtil
public static coldfusion.sql.QueryTable
getColdFusionQuery(java.sql.ResultSet rs)
return new coldfusion.sql.QueryTable(rs);
but when i run cfm page and coldfusion server tries to
execute : "<cfset pra =
createObject("java","QueryUtil").init()>" this error appears:
Object Instantiation Exception.
An exception occurred when instantiating a java object. The
cause of this exception was that: coldfusion/sql/QueryTable.
If i try to execute QueryUtil.java with Eclipse all it works.
Also I have tried to return java.sql.ResultSet directly to
coldfusion.sql.QueryTable.init () with failure.
Do you know some other solution?ok
i print all my code
pratica.java execute a query to db and return a querytable
java class
import java.util.*;
import java.sql.*;
import coldfusion.sql.*;
public class Pratica {
private HashMap my;
private String URI,LOGIN,PWD,DRIVER;
private Connection conn=null;
//funzione init
//riceve due strutture converite in hashmap
// globals
// dbprop
public Pratica(HashMap globals,HashMap dbprop) {
my = new HashMap();
my.put("GLOBALS",globals);
my.put("DBPROP",dbprop);
URI = "jdbc:sqlserver://it-bra-s0016;databaseName=nmobl";
LOGIN = "usr_dev";
PWD = "developer";
DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
try{
// Carico il driver JDBC per la connessione con il database
MySQL
Class.forName(DRIVER);
/* Connessione alla base di dati */
conn=DriverManager.getConnection(URI,LOGIN,PWD);
if(conn!=null) System.out.println("Connection Successful!");
} catch (ClassNotFoundException e) {
// Could not find the database driver
System.out.print("\ndriver non trovato "+e.getMessage());
System.out.flush();
catch (SQLException e) {
// Could not connect to the database
System.out.print("\nConnessione fallita "+e.getMessage());
System.out.flush();
//funzione search
//riceve un hash map con i filtri di ricerca
public QueryTable search(/*HashMap arg*/) {
ResultSet rs=null;
Statement stmt=null;
QueryTable ret=null;
String query="SELECT * FROM TAN100pratiche";
try{
stmt = conn.createStatement();// Creo lo Statement per
l'esecuzione della query
rs=stmt.executeQuery(query);
// while (rs.next()) {
// System.out.println(rs.getString("descrizione"));
catch (Exception e) {
e.printStackTrace();
try {
ret = Pratica.RsToQueryTable(rs);
} catch (SQLException e) {
e.printStackTrace();
this.close();
return(ret);
// ret=this.RsToQuery(rs);
// this.close(); //chiude le connessioni,recordset e
statament
//retstruct CF vede HashMap come struct
//METODO DI TEST
public HashMap retstruct(){
return(my);
//conversione resultset to querytable
private static QueryTable RsToQueryTable(ResultSet rs)
throws SQLException{
return new QueryTable(rs);
//chiura resultset statament e connessione
private void close(){
try{
conn.close();
conn=null;
catch (Exception e) {
e.printStackTrace();
coldfusion code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
<head>
<title>Test JDBC CFML Using CFScript</title>
</head>
<body>
<cftry>
<cfset glb_map =
createObject("java","java.util.HashMap")>
<cfset dbprop_map =
createObject("java","java.util.HashMap")>
<cfset glb_map.init(glb)> <!---are passed from
another page--->
<cfset dbprop_map.init(glb["DBPROP"])>
<cfset pra =
createObject("java","Pratica").init(glb_map,dbprop_map)>
<cfset ourQuery
=createObject("java","coldfusion.sql.QueryTable").init(pra.search())>
<cfcatch>
<h2>Error - info below</h2>
<cfdump var="#cfcatch#"><cfabort>
</cfcatch>
</cftry>
<h2>Success - statement dumped below</h2>
<cfdump var="#ourQuery#">
</body>
</html>
error at line <cfset pra =
createObject("java","Pratica").init(glb_map,dbprop_map)>
An exception occurred when instantiating a java object. The
cause of this exception was that: coldfusion/sql/QueryTable.
----------------------------------------------------------------------- -
SAP BW QUERY AND BOBJ , QUERY VARIABLES
I have a SAP BW QUERY which Iu2019m trying to get through to BOBJ 4.0 AND CONTINUE TO GET THIS error "getDocumentInformation exception Error WRE 99998.........database error The MDX QUERY SELECT {...} ON CLOUMNS, NON EMPTY UNORDER, DIMESION PROPERTIES ON ROWS from SAP VARIABLES FAILED TO EXECUTE WITH ERROR for characteristic 0FISCYEAR, enter year in specified format(IES10901)
We using BOBJ 4.0 AND IDT TO CREATE connections to query...
In SAP BEX ANALYZER the query runs and returns results without any issues, but in u201CQUERY AS A WEB SERVICEu201D and u201CWEB SERVICEu201D we get THE above error ....
so i removed the variables from the row section and included it in the filter section of query and still i get errors in bobj (This is after going to Transaction RSRT checking the properties TAB and selecting "Use Selection of Structure Elements" and then generating query in SAP BW,
SOME queries you need to assign variable inputs for certain characteristics to restrict specific data ACCORDINGLY...
is there a way to come around this?
are there some docs available that simply describes the method of using a variable input/prompt in a SAP BW QUERY and how to use it in BOBJ?
Any help would be greatly appreciated
Thanks in Advancepersonal experience the variables doesnt work properly from query to bobj, remove any calculations in yoru query and variables, you could only use filters in query.. when you bring them in webi then brring the values to the report then create vraibles in it there.
i keep my query from filtering as well then do everything in webi or xcelsius .. -
Hi,
i have created a query on YTD sales query and comparison with the previous year. i have created a structure using 0calmonth2 info object and restricted it for each month starting from July to June. In the key figures i have used sales values key figure and restricted one with variable 0I_PRFYE for all fiscal year periods of previous year and for the current year i used a value range from 001.YYYY to the current fiscal year period. where YYYY is the same fiscal year as in current fiscal year period.
After executing the query for sales values in previous year i have a value against every fiscal year period in the previous year. For the current year i have the value only for the first month as we are in the first month.
example:
jul aug sep oct nov dec jan feb mar apr may jun
Current year 17 0 0 0 0 0 0 0 0 0 0 0
Previous Year12 13 18 34 23 67 20 10 83 34 25 27
When i creating a line chart based on this data, for the current year the line drops from jul to aug and continues to be zero through out the year. what i am expecting is it should not drop to zero as we have not yet come to aug in the current year. What i am expecting is that the line should be showing as a dot in the current month jun, when the current fiscal year period is aug i will have some value in the aug so the chart should show a line from jul to aug.
I tried to change the display of zero's as blank & even tried replacing zeros with some characters but could not achieve the desired result.
can some body help me achieve this. Correct responses will be awarded appropriately.
Regards,
Ravi.Hi,
The line chart shows the two series one for previous year and one for current year.
the issue is with current year. as the value for aug is blank the line chart drops to zero on the y axis. What i want to achieve is that as i am not yet in aug and my current fiscal yera period is jul i dont want the line to drop to zero. in this case i want it to be just a dot on y axis depending on the value. Once my current fiscal year period is aug i want a line from jul to aug only. In the current senario if my current fiscal year period is aug i will have the line from jul to aug but then drops to zero on y axis for sep. I dont want that to happen.
Hope iyou understand what i am trying to explain.
Thanks for your reply.
Ravi. -
Select Query and Recordset on same page
I have been workig with Coldfusion for a while now. Where I work there is a need for web pages to extract data from data sources. I have been successful at doing this. Typically I use a form that selects multiple criteria, which when submitted loads a target/action page that displays records that are filtered based on the SQL statement contained on that action page. What I do is to conditionally check if criteria is passed using cfif. And if a field parameter is indeed passed it becomes part of the cfquery. This works out well - especially for reporting.
But now I am seeing more and more a need to accomplish the same process - but on a single cfm page. So the page I seek will have both the form (select) and the recordset results on the same page.
In this exercise I will be caching results od a query and having several queries to further refine what I seek (QOQ). What I am seeking is the best practice to follow, I was thinking that using an iframe on the page would be and adequate solution whereby the query would pass the criteria and its form action would pass the variable(s) to the action page, which would be the source of the iframe. But I am not certain that this is a best proctice. Nor have I had great success at getting the pages to work in concert.
Any advice that you can lend would be appreciated.I ideally start by reducing the 2-page functionality - of form page and action page - to just one. It goes like this:
<cfset isValidationPassed = false>
<cfif isDefined("form.someVar")>
<!--- Do validation. Validated form implies isValidationPassed is true --->
</cfif>
<cfif isValidationPassed>
<!--- Do action page stuff --->
<cfelseif NOT isDefined("form.someVar") OR NOT isValidationPassed>
<!--- Display the form. --->
<!--- If form had been submitted, inform user which validation failed, and what to correct. Display the form. --->
<cfoutput><form method="post" action="#CGI.SCRIPT_NAME#"></cfoutput>
</form>
</cfif>
The idea is then to pile on the complexity, layer by layer. -
hai sap gurus..
what is difference the query and reporting
in an interview i have been asked.
how many queries and how many reporting did you created.Hi Naren,
SAP Query
An ABAP Workbench tool that enables users without knowledge of the ABAP programming language to define and execute their own reports.
In ABAP Query, you enter texts and select fields and options to determine the structure of the reports. Fields are selected from functional areas and can be assigned a sequence by numbering.
ABAP Query offers the following types of reports:
Basic lists
Statistics
Ranked lists
Query used for short run based i.e the format of the report output you can change frequently.
Report (CA)
A compilation of data for a company or group of companies in the form of a table or list.
An evaluation is the result of executing a report. It can be either displayed on the screen or sent to a printer.
Here ABAP programing language will be used to execute the report.
Report used for long run it is standard output we can,t change frequently.
I hope it will clear for you,
Regards,
Murali. -
Converting an Ultra Search result to a ColdFusion query
Hello,
I'm trying to convert an Ultra Search result into a ColdFusion query.
There's a java class for CF which turns a java result into a CF query, coldfusion.sql.QueryTable(java.sql.ResultSet), but is there anything which will convert an Ultra Search result to a java result or a CF query?
Thanks.HOMEWORK ALERT HOMEWORK ALERT
You can't cast from a character to a String. That doesn't work.
However, in a fit of being helpful.
Look at the constructors for the String object in the API
Link ===> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#String(char[])
char[] charA = {'H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D' } ;
String a = new String(charA) ;
System.out.println(a) ;There's a price for my help, and it's this. Now that you understand what you can do, is it a good idea or a bad idea and why ???
Explain. -
i just what to know the difference between aggregate and structure? although aggregate is used for query performance and structure for reporting.Both are giving the same view?
adding to the paolo's answer
Aggregates are used for query performance in the sense that If ur query has the same selections as they are in the aggregates then the query performance increases dramtically and structure is used in reporting in cases such as where u might need a complex selections of char and KF's.
for structures
http://help.sap.com/saphelp_nw04/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm
for aggregates
http://help.sap.com/saphelp_nw04/helpdata/en/7d/eb683cc5e8ca68e10000000a114084/frameset.htm -
Output query and alert if there is a duplicate between 2 tables
I have 2 tables MembTableA and MembTableB. If a MemberNumber exists on both tables I want to somehow put an alert in my coldfusion output (I have an example "CFIF" in my code below) - and only show the 1 result from MemberTableA. Below is my query and output - can someone assist?
Query in CFC
SELECT dbo.MembTableA.MemberNumber, dbo.MembTableA.StatusCode, dbo.membTableB.Status
FROM dbo.MembTableA LEFT OUTER JOIN
dbo.membTableB ON dbo.MembTableA.MemberNumber = dbo.membTableB.MemberNumber
Where dbo.MembTableA.status IS NULL
AND (dbo.MembTableA.StatusCode) = <cfqueryparam value="555" cfsqltype="cf_sql_varchar">
or dbo.membTableB.Status = <cfqueryparam value="999" cfsqltype="cf_sql_varchar">
Output code on page
<cfinvoke component=.....
method="MemberNumberLst"
returnvariable="MemberNumberLst">
<table>
<tr>
<th>Member Number</th>
<th>Status Code</th>
</tr>
<cfoutput query="MemberNumberLst">
<tr>
<cfif MemberNumberLst.MemberNumber is on both tables ..... >
<td>#MemberNumber# **on both tables**</td>
<cfelse>
<td>#MemberNumber#</td>
</cfif>
<td>#StatusCode#</td>
</tr>
</cfoutput>
</table>earwig75,
Since you are doing a left outer join, if there is a matching MemberNumber in MembTableB, you just need to check if the dbo.membTableB.MemberNumber column is not blank. You'll need to add the dbo.MembTableB.MemberNumber column to your SELECT statement. However, because ColdFusion's query results don't carry fully qualified column names (i.e. dbo.membTableA.MemberNumber and dbo.membTableB.MemberNumber will both be listed as MemberNumber), you will have to use an alias on that column. Also, if you use aliases on table names, it will simplify the rest of your query. Here's a cleaner version:
SELECT tblA.MemberNumber, tblA.StatusCode, tblB.Status, tblB.MemberNumber as MemberNumberB
FROM dbo.MembTableA AS tblA LEFT OUTER JOIN
dbo.membTableB AS tblB ON tblA.MemberNumber = tblB.MemberNumber
Where tblA.status IS NULL
AND (tblA.StatusCode) = <cfqueryparam value="555" cfsqltype="cf_sql_varchar">
or tblB.Status = <cfqueryparam value="999" cfsqltype="cf_sql_varchar">
Will MemberNumber always appear in MembTableA and only sometimes in MembTableB? If so, then the modified query should work. If the number might appear in MembTableA sometimes, or might appear in MembTableB sometimes, then the query probably needs to be redesigned. If MemberNumber will always appear in MembTableA, your <cfif> could then look like this:
<cfif MemberNumberLst.MemberNumberB <> ''>
Also, you might want to check the location of the parenthesis in your WHERE clause. AND operators take precedence over OR operators, so this query is going to either find records where both the tblA.status is null AND tblA.StatusCode equals '555', or records where tblB.Status equals '999'. Is this precisely what you want?
HTH,
-Carl V. -
Query and Workbook BI 7.0
Hi
I am in BI 7.0
1)I created a query X and saved it as workbook. When I edit the changes in query, I don't see the changes reflected in workbook.I thought if I change the query or workbook, the changes should take place.
2) I have to create 12 queries of same structure but contains different hardcoded costcenters.Can somebody advice me what is the best method to accomplish the above requirement.Should I create query or query views and what major differences did you guys observe between Query and Query View from your expereince and practices...Hi Jacky,
If you change the query this way you wont have to re-insert the query each time you make changes.
1. Open the workbook.
2. Select the query by clicking on it. Then use the Edit query option from the toolbar.
3. Make changes to the query.
4. Execute the query by clicking the Green check mark.
5. After making sure that the changes have been applied, save the workbook.
Hope this helps... -
Need info on HR authorisations and structural profiles
Hi gurus,
can somebody guide me to the info on HR authorisations and structural profiles?Lots of info here:
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=structural%20authorizations&cat=sdn_all
also a step by step guide here:
http://sapbasis.msspro.com/securitydocs/structural_authorizations_step_by_step.doc -
Coldfusion Query Delay Problem
Folks we are having some intermittent problems with our
application web servers.
We are using coldfusion to serve data from Oracle databases.
SELECT statements only, no updating of the database is done. The
coldfusion application server and the oracle database server are
seperate servers,
The problem we are having is as follows.
When the user opens the app for the 1st time a query is run
to work out what access level they have. 95% of the time the query
is instant. We have been logging this using getticktick()
often the time taken is 0ms we also see 16ms and 31ms. The query
returns
1 row with 1 field in it to size of data returned is not an
issue.
Occasionally we get this query reportedly taking between 5
and 120 seconds using gettickcount() either side of it.
We turned on some logging at the Oracle end and this reported
that EVERY time a query of this type it is taking absolutely no
time all.
Our next port of call was the network. We have sniffed
packets between the coldfusion server and the oracle server.
We managed to trap one of the requests where the response
time is slow and the scenario was as follows :
1. Coldfusion -> Oracle. Hello i've got some work for you
to do. Completed in millisenconds
2. Oracle -> Coldfusion. Acknowledged, Yes what is it?
Completed in millseconds.
3. Coldfusion -> Oracle Acknowledged......... delay of 17
seconds (delay times vary)..... it's this query
4. Oracle -> Coldfusion. Here are your results. completed
in milliseconds
5. Coldufsion -> Oracle. Acknlowledged. completed in
millseconds.
So it appears that internally within coldfusion a delay is
occuring as the database and the network have been eliminated.
The delay time is never the same and can range from a couple
of seconds to over a minute. The times of day that these delays
occur at is not uniform.
The server is busiest between 0800 and 1700. But this server
is NOT under heavy load at all, it is however query intensive. It
is up 24 hours a day and there is a constant user base.
We have tuned all our queries and cached them as best we can.
However i'm not sure how much this helps as we get delays on
queries we know are performant.
We are currently upgrading one of our servers to CF8 using
oracle thin jdbc drivers rather than the odbc to see if this makes
a difference.
If anyone has previous experience of this or knows of
anything settings we need to tweak at a java level that would be
great.
Spec of what we are running is as below :
Windows 2003 Server
Coldfusion MX 7.0.2 Standard
Oracle 10g ODBC Drivers
Any help gratefully received as the users are starting to get
fed up of having these delays for no apparent reason.> 3. Coldfusion -> Oracle Acknowledged......... delay
> of 17 seconds (delay times vary)..... it's this query
Do you mind elaborating here?
It kind of appears as if there are two requests.
Meaning, is it just as correct to state it this way:
2. Oracle -> Coldfusion. Acknowledged, Yes what is it?
Completed in millseconds.
3. Coldfusion -> Oracle Acknowledged. it's this query.
delay of 17 seconds (delay times vary)
4. Oracle -> Coldfusion. Here are your results. completed
in milliseconds
If this is how it happened, then I would guess that
it's a database issue.
Or perhaps this is the more correct way to state it:
2. Oracle -> Coldfusion. Acknowledged, Yes what is it?
Completed in milliseconds.
3. Coldfusion -> Oracle Acknowledged. Completed in ???
4. Coldfusion -> Oracle it's this query. Completed in ???
5. Oracle -> Coldfusion. Here are your results. completed
in milliseconds
If this is how it happened, then I would think you
need to determine which step took 17 seconds.
Maybe you are looking for
-
My text messaging app is not working at all is a blank screen when I open it! Help!!!
-
Connecting Ethernet Macs & printer with wireless network?
I have a small LAN (500MHz Cube, iMAC, Tally T8016 Laser Printer) handled by a Belkin 4-port router, connected to a cable modem. I would like to incorporate a new Mac mini, a MacBook and an AirportExtreme Base Station but have some problems. Connecti
-
How to Reorient One Page in a PDF File?
Hi, I have a multi-page PDF file created with Epson Scan on an Epson Stylus Photo RX500 and saved in Adobe Reader 9.4.6. There was a way to reorient the pages after scanning and before saving to PDF but they were just little thumbnails and I didn't
-
HT1600 APPLE TV AND MY MACBOOK
When I purchased Apple TV I thought that it would also allow me to project what I had on showing on my computer onto my tv or projector via Apple TV but I cannot figure out how to do this, was I wrong or am I missing something?
-
RMAN problem while backing up SunMC-3.6.1 online
Hi Geeks, I am having trouble while online backing up SunMC(3.6.1) running on Solaris10 (11/06). The exact error message in log file is ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Started /opt/SUNWsymon/sbin/es-backup at Thu Ju