Coldfusion tags within query output
I have a simple query to a SQL database that returns a record
set. Within the record set is a field that contains HTML and CFML.
When I display the content it reads the CF tags literally. Is there
any way to get the CF tags to be processed when it is returned in
the query output? See example below.
------------------ CODE ON PAGE
<CFQUERY name="getdata" datasource="DSN">
select ID, HTMLFIELD
from TABLENAME
where ID = '1'
</CFQUERY>
<CFOUTPUT QUERY="getdata">
#getdata.HTMLFIELD#
</CFOUTPUT>
-----------------------VALUE OF "HTMLFIELD"
VARIABLE--------------------------------
<CFSET todaysdate = #DateFormat(Now(), "mm/dd/yyyy")#>
<p>Today is #variables.todaysdate#</p>
------------------------WHAT IS DISPLAYED IN THE
BROWSER----------------
Today is #variables.todaysdate#
-----------------------WHAT should BE DISPLAYED IN THE
BROWSER------------
Today is 06/14/2006
Pete is right, very risky.
I've done a similar feature for a site I wrote that allowed
users to edit pages on the fly, only I pre-selected functions that
could be used and created wrappers for them. Then the users would
insert something like $now()$ in the WYSIWYG. Then when the page
was requested I would pass the data containing HTML and psuedo-CFML
through parse routine which would render the end results in a
controlled manner.
I would really recommend this route as you will have much
more controll over the types of scripts that can be run. It is also
easy to make buttons that insert the code for them.
HTH
Similar Messages
-
Oracle Query output erro (MX7)
Hi
Coldfusion page throwing ODBC error when Oracle (9i) Query
executed. No useful error message shown.
Same query gets executed successfully in Oracle Client.
When i use CLOB Column type in my select query error has
shown. In the same query i have used substr anticipating that some
issues when oracle column type being being CLOB in coldfushion
page. It did not work.
Query output returns some html tags also. I guess we need to
set some configurations in Coldfusion server. As the same code runs
perfectly on the test/production environment.
Pointers are highly appreicated.
Regards
Ram
Beginner in coldfusion Technologysince you didn't show the query, or the error message, I'll
just take a guess and say that you ended your sql with a
semi-colon. -
I need to send an individual email to about 100 names fetched
from an Access 2003 database. I am fetching the distinct emails
from the database and getting each Project owned by each distinct
email address.
I created the correct output on a test web page where the
query will list every distinct email address with each email
address having their own Project Title listing. Now the question is
how do I use my output to send an individual email to each of the
distinct email addresses I got in my query??
For example someone with the email Address of
[email protected] would get one email with his Project Title
listings that could be 3 or 4 titles. The next distinct email
address of [email protected] will get his own email with his
Project title listings.
Here is my attempt but the #userEmail# has everyones email
address.
<cfoutput query = "theQuery" group = "userEmail">
<cfmail to: #userEmail# subject: Project Listing
<cfoutput>Project Listing:
#ProjectTitle#</cfoutput>
<cfmail>
</cfoutput>
Please help.Jazzy has the correct answer. And if your project listings
reside in seperate tables, you need to run a seperate query within
the loop BUT outside of the cfmail in order to retrieve those. So
that would then be...
<cfquery name="rs_read" datasource="xxx" >
SELECT *
FROM #session.sometable#
WHERE whateverid = '#variables.whateverid#';
</cfquery>
<cfloop index="loopcount" from="1"
to='#rs_read.RecordCount#' step="1">
<cfquery name="rs_projects" datasource="xxx" >
SELECT projects
FROM #session.sometable#
WHERE email = '#rs_read.email#';
</cfquery>
<cfset variables.proj = ''>
<cfoutput query="rs_projects">
<cfset variables.proj = variables.proj & ' ' &
rs_projects.projects>
</cfoutput>
<cfmail from="[email protected]" to="#rs_read.email#"
subject="#rs_projects.whatever#">
bla bla #rs_read.anyvariable#
PROJECTS: #variables.proj#
</cfmail>
</cfloop>
REMEMBER: You can not nest outputs in outputs, that's why you
can not run the query output inside CFMAIL because CF regards
cfmail as an output routine. -
Hi All,
i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.
basically query is checking the rows count from couple of user tables in servers.
issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers
could you please suggest how can i achieve this?Copy to what?
SELECT COUNT(*) FROM sys.objects
Running the above statement returns two columns (server name and count)
All the servers SS2005 and onwards , then use
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'name',
@recipients = '[email protected]',
@query = 'SELECT COUNT(*) FROM sys.objects',
@subject = 'Count rows'
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
ERROR displaying in the query output... urgetn
hi experts,
For the amount keyfigures in the query output it displaying ERROR after the amount like ex- 2000 ERROR.
plz let me know how to rectify this..
regards
vadlamudihi,
i have created only two keyfigures EMP_BASIC and EMP_HRA. and in the transformations i have mapped with 0DOC_CURRCY.
but in the report its showing ERROR only after the amount. plz tell me exactly with what field i need to map???
regards
vadlamudi -
Hello Gurus,
I am having an issue with query output.Please find below the details of it
Unsold claims: Total---> 200
Dispatch: Total--->118,086
Unsold claims/dispatch--->0.001694
This should be the output but its coming --.0033120 because itu2019s dividing with max value in dispatch which is 60,386.
Reason: The aggregation property of Dispatch is max value. I am not supposed to do any changes in Modeling. So can we do any thing at reporting level to get the desired output?
Desired output---->0.001694
Output coming---->.0033120
Please help me in getting the desired output at query level.
Regards,solved with the help of nested exception aggregation
-
Change layout of Adhoc query output list for Custom infotype
Hi All,
The fields in the Infoset query output on a custom infotype are aligned with the fields u2018payment typeu2019 and u2018amountu2019 appearing repeatedly(in columns) as declared in the Infotype and the output will be a long horizontal list.
Instead, the requirement is that the output list should show vertically so that If I choose u2018Payment Typeu2019 and u2018Amountu2019 as output fields, it will show a long vertical list as in the case of a standard infotype (IT0008).
Also, this way enables user to use Payment Type as a selection criteria so as to just pulling the needed payment type. When we use IT0008 in the infoset it works fine but in custom IT it does not work.
Any pointers/suggestions on how we can achieve this would be helpful.Hi yu liang,
You can find vendor list having Vendor No. & without showing total liability for every vendor.
after executing the report,
1.You need to select "change layout (ctrl+F8)",
a small window comes, it has two part -> column content & hidden fields.
then u select "Vendor" from hidden field & move it to column content.
2. at column content there is a column named "Total". u need to remove check for your column name "amount".
now select "copy" button or enter. u will find the req. report.
u can save it also by ur name.
hope its helpful to u.......
plz, reward points as a way of thanks if helpful... -
To download the query output to falt file
Hi all,
i have a query which i know will give more than 65k records as the output for a selection.
i cannot run this query in excel due to its limitation.
if i run on web i cannot download this as downloading is happening to excel file only.
The customer ideally wants to download the query result to a text file(csv,tab-delimited etc) which inturn it will upload to MS-Access.
How do i achieve this?
SAP has given response use try using these options:
1.open interfaces to receive the output of a query via the MDX language.
2.open hub tool as it is designed for big amounts of data.(i suppose this is not possible as i want to download query output not the data target contents)
how do i achieve my scenario with option 1?
Are there any alternatives??
Any useful help will be rewarded.
Regards,
Dhanya.hi vivek,
thnks for the useful reply.
i have some problem with my ID,hence loggin in through my coleague's ID.
i will assign u points as i get logged in.
I did as u said by downloading it to unconverted format.
the file got download to a text file.where the output has
1.header rows(10 lines almost)
2.the values r coming in single quotes e,g:
'144000023073 'TAAS SETTLEMENT CONV 738 '19333000 '30.09.2006 '0.000
how can i remove all this?
Regards,
Dhanya
I -
How to get the Query output to Excel
Hi ,
Can you tell me how to get the Query output to excel with out using any third party tool?
Can you tell me how to write the code in Webservice and call it..
Please explain it Elaboartly..
Thanks in Advance!!!
Miniwhats your source system?
you can use Live office, or query as a webservice if you are getting data from universe
if you're getting data from SAP BI query and you have a java stack on your netweaver then you can get the data directly using sap bi connector in xcelsius.
good luck -
Query Output to download in flat file through APD or other means?
Hello Experts,
I am currently on BW3.5 system and have requirement to load query output in flat file in .csv format. I checked the option of APD but looks like we cant directly load the query output in flat file like in APD (BW 3.5 system) .
One way i can think of it...load the query output in transactional ODS and built an infospoke on it to write into flat file.
Please advice if there are any better methods to store the query output in flat files.
Thanks!Hi,
Use RSCRM_BAPI.
See
Re: RSCRM_Bapi
See the help on RSCRM_BAPI
Re: Running Quaries automatically and saving them in as a Excel file in Server
Re: Data transfer to external systems
Re: Loading from a Custom R/3 Table
Re: How can I schedule my Bex report to execute in background
Re: How can I insert the RSCRM_BAPI into Process chain?
Thanks
Reddy -
How to replace # or Not assigned with blank in BEx Query Output.
Hi,
While running the query through BEx Query desginer or Anlayser, I am getting # or Not assigned where there are no values.
The requirement is to "Replace # or Not assigned with a blank" in the output.
I want to know, is there any setting in BEx query desginer where we can do this. How to do this.
Please share your inputs on this. Any inputs on this would be appreciated.
Thanks,
NaveenCheck out SDN-thread: "Re: Remove 'Not assigned'" for more details
Ideas from SDN research:
"a solution i have used is to put each RKF column in a CKF colum then in each CKF use RKF + 0, the outcome is that your # should now be 0s, in the query properties you can set the option to display 0s as blank."
"try to enter a text for the blank entry in the master data maintenance of the relevant objects and set the display option for the objects to 'text'."
Threads:
SDN: How to replace # or Not assigned with blank in BEx Query Output.
SDN: Re: Remove 'Not assigned
SDN: How to replace # or (Not assigned) with blank in BEx Query Output.
SDN: Bex Analyzer : Text element system's table ?
SDN: change message in web application designer ["nonavailable" -> 136 of SAPLRRSV]
SDN: Not Assigned ["Not Assigned -> 027 of SAPLRRSV]
SDN: replacing '#'-sign for 'not assigned' in queries
SDN: # in report when null in the cube
SDN: How to replace '#' with blank when there is no value for a date field
Edited by: Thomas Köpp on Sep 13, 2010 5:20 PM -
How to store select query output in arrays.
i created a varray type variables and now want to assign some data though select query output in pl/sql code as well as in reports 6i.
You're in the wrong forum (this one is for issues with the SQL Developer tool). You were in the right one where you posted first, but don't reuse unrelated threads as you did.
Regards,
K. -
Output mismatch between BEx query output and WebI Report output
Hi All,
I have a BEx query in which there are only characteristics placed in rows.
There are combinations of the values of the characteristics giving different records in the query output.
Date is one of the characterisctics in the query output.
There is an output mismatch between the query output and the WebI report output in the following case:
When there are 'Not Assigned' or '#' or blank values, there are additional entries(rows) in the WebI report, giving repeating or wrong entries in the Date field. This is incorrect data.
Is this because of the 'Not Assigned' or '#' or blank values of the Characteristics or is there any other reason?
How do I fix this?
Please helo me with this.
Thanks and Regards,
Srilakshmi BHi Rajesh,
I need to verify the WebI report output for records with # and 'Not assigned' values for the cHracteristics in the report.
So I cannot check the WebI report by hiding the # or Not assigned values.
The problem is that in the Query output the records are like these shown below:
Char1 CHar2 CHar3 Date field
A B C Date1
#(Not assgined) #(Not assgined) #(Not assgined) No value
Where as the WebI report output is as below:
Char1 CHar2 CHar3 Date field
A B C Date1
#(Not assgined) #(Not assgined) #(Not assgined) Date1
As shown here, there are wrong/repeating entries for the Date field in the WebI report output.
Please check this and let me know what could be the issue and how do I fix it.
Thanks and Regards,
Srilakshmi B -
Query output transfer to excel file
hi all,
how can i query output transfer to excel file ? i am not using any tool. please suggest me. is there any method that i transfer that output to excel file?You can create a csv file. See dump_csv function from Tom Kyte.
-
Want to See Selected Input Variables in the query output
Hi al
My client gives a requirment like they want to see selected variables in the query output. Like suppose if i am entering Profit center, controlling area, version, caldayas a input on the screen. Now they want to see only Profit center and version on the query result.
Please let me know if any one has this solution.
Regards,
Amit ShetyeHi
Can you please give us user requirement and according to ure requirement so we given replies . If ure requirement please explain detail
But it is not neccessary that we can put something in free char and all. Inspite of that they wanted to select the input variable as per their requirement. They dont want to restrict them in Free char.
Maybe you are looking for
-
Hi I am getting a no such file error though I am calling functions correctly. I am able to compile successfully but getting these runtime errors. Can anybody point out what mistake I am doing:- Here are the error lines:- java.io.FileNotFoundException
-
Script to play 15-30 seconds of each song
I have the pearlyrics widget and would like to play the first 15-30 seconds of each song in order to get the lyrics. I know that I have seen a script to do this, but I can't find it anymore. Thanks in advance.
-
Am trying to switch on "find my iphone" icon but cannot verify my icloud account. Tells me to see email but nothing comes thru with any instructions. Any help much appreciated as phone assistence unavailable today.
-
Hi All I am planning to do ABAP certification on November, any past question or any site to refer Thanks Kanishka
-
Why there is no debug output?
Greeting, No output is generated when I place the command "debug frame-relay lmi" I have tried the command "debug all" but nothing generated ... why?