List of query result in UDF
Dear all expert,
I make an UDF and put query to that UDF. I want to make list of value of that query result is always appear when user click that UDF.
It's working fine if, the result of query is 2 rows (the list of value is pop up) but if the result only 1 row, the list of value is not show up.
The purpose to make this UDF and query is to give information to user. So, I need, the list is to show up
try this
SELECT T2.DocTotal as 'SPK Value', T0.DocNum 'Payment No', T0.DocDate 'Payment Date', T1.U_Progress, Sum(T1.U_Prog_Val) 'Progress Value', Sum(T1.U_Ret_Val) 'Retensi Value', T0.DpmAmnt 'Down Payment', T0.DocTotal 'Paid', T0.Comments
FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OPOR T2 ON T2.DocNum = T1.BaseRef
WHERE T0.U_SPK = $[$U_SPK.number] and T0.CEECFlag = 'n'
GROUP BY T2.DocTotal, T0.DocNum, T0.DocDate, T0.Comments, T0.DpmAmnt, T0.DocTotal, T1.U_Progress
Union All
SELECT 0,0, 0, '0', 0, 0, 0, 0, '0'
Edited by: Suraj V on Jul 24, 2009 1:16 PM
Similar Messages
-
Search directory of PDF's based on Query Results?
Hello - Is it possible to search a directory of .pdf files
based on a
returned list of query results? For example I query a product
database
that returns a list of Product Names and Product ID's. Based
on that
list of query results, I'd like see if a pdf exists in the
directory
that has the same name as the Product ID, and then create a
link to that
.pdf.
Make sense?
Thank you,
Steve MillerI figured it out.
Thank you,
Steve Miller
Steve Miller wrote:
> Hello - Is it possible to search a directory of .pdf
files based on a
> returned list of query results? For example I query a
product database
> that returns a list of Product Names and Product ID's.
Based on that
> list of query results, I'd like see if a pdf exists in
the directory
> that has the same name as the Product ID, and then
create a link to
> that .pdf.
>
> Make sense?
>
> Thank you,
> Steve Miller -
Is it possible to list out CATALOG ITEMS GROUP in a Query Result of a Request Offering??
Hi Experts,
Is it possible to list out CATALOG ITEMS GROUP as a result of Query Result in Request Offering ?? Because each and every Catalog Items Groups are being created as a SingleTon Child Class of System.CatalogItemGroup. i.e., Each CatalogItemGroup instance
will have its own singleton class.
Is it possible to list out all CatalogItemGroup Instances consolidatedly in the QueryResult Window??
Though the System.CatalogItemGroup class is an Abstract class, I tried to list out the Classinstances via powershell command as below, which lists all catalog group instances, Note: Actually these are instances of SingleTon
Child Classes
"Get-SCClassInstance -Class (Get-SCClass -Name System.CatalogItemGroup)"
But when I configured the QueryResult window with the "System.CatalogItemGroup" class, it doesn't list out any Group instances in the Porta.......
Am I missing anything, Any suggestions please???
Thanks and Regards, Narayana BabuThanks Anton, I already tried that too... But it doesn't list out any Group instances in the Portal.
Since each Catalog Groups are individual Single ton Class instances derived from "System.CatalogItemGroup" class. Therfore If I specify the internal ID of the abstract class "System.CatalogItemGroup" in the tag below, it doesn't list any in the
Portal.... But if I specify ID of any one of the derived singleton class, it does displays the one instance of that particular class..
Thanks and Regards, Narayana Babu -
Query result list sort order in the Service Manager Portal (2012).
Hi there,
I have a setup a user prompt for a request offering in which the values are based on a query results list. When the user prompt is displayed in the portal the order of the items presented based on my query results list is in reverse
alphabetical order (Z to A) instead of traditional A to Z. I can clicked the column header to toggle the sort order, however having to do this is slightly annoying.
My query results list is based on returning the Department field of a specific criteria of template AD user accounts (which are imported into the CMDB via the AD Connector).
Where and how is the sort order defined?
Thanks
BryanHi Bryan,
After a quick test I can see the query results is in a descending order based on the first display column of the query results configuration. In the Request offering wizard I don't see an option for sorting. I don't think it is possible to configure this
out of the box.
But maybe it is possible from a Self Service Portal rendering point of view. Maybe there is a key for it in the settings.xml just like the maximum of query results:
http://blogs.technet.com/b/servicemanager/archive/2011/11/08/advanced-query-results-customization-for-request-offerings.aspx
If this is possible I'm also curious to know how! :)
- Dennis -
Howto handle persistence API query result list
Hello.
I need some advice on how to handle a persistence API query result List since the Object variable returned by the "list.get(i)" method cannot be cast to an EntityClass declared by the EntityClassManager.
The piece of code below might help you understand my exact problem.
EntityManagerFactory emf = Persistence.createEntityManagerFactory("SporTakipPU");
EntityManager em = (EntityManager) emf.createEntityManager();
Query q1 = em.createQuery( "SELECT d.id, d.date, c.name, c.sirname FROM Log d, Kisi c WHERE d.id = :id AND c.id = :id" );
q1.setParameter( "id", argument );
List logList = q1.getResultList();
Log log = (Log) logList.get(1);
In this code i cannot cast Object to Log in the last line. Apparently this has something to do with the query.
Trying to solve this problem i declared two private string variables name and sirname and their set and get methods but this didn't help.
Thanks...Entity Class : ReportView
===================
@Entity
@Table(name = "dummy")
public class ReportView implements Serializable {
@Id
@Column(name = "id", nullable = false)
private Integer id;
// getter , setter
SessionBean : ReportSessionBean
==========================
public List<ReportView> getReports() {
Query q = em.createNativeQuery("SELECT ID FROM REPORT", ReportView.class);
List<ReportView> r=(List<ReportView>)q.getResultList();
return r;
JSF / Back Bean : ReportBackBean
==========================
public class ReportBackBean {
@EJB
private ReportSessionRemote reportSessionBean;
/** Creates a new instance of ReportBackBean */
public ReportBackBean() {
public List<ReportView> getReports() {
return reportSessionBean.getReports();
JSF
===
<f:view>
<h:dataTable value="#{ReportBackBean.reports}" var="report" border="1">
<h:column>
<h:outputText value="#{report.id}"/>
</h:column>
</h:dataTable>
</f:view>
Regards,
Telman
.. -
Warning Message in query result as 'Notification Number DBMAN 345'
Hi ,
I have a warning message while executing the query
'Diagnosis
Currently, it cannot be guaranteed that SIDs and master data exists for all characteristic attributes for the DataStore object to be read.
There is a restriction on a navigation attribute of the listed characteristic in the query. This filters all characteristic values of the master-data bearing characteristic for which there is not yet master data out of the result.
For performance reasons, this filtering is unavoidable.
System Response
Procedure
In case of doubt, find other restirctions directly on the characteristic values of the characteristics contained in the DataStore object.
Procedure for System Administration
Notification Number DBMAN 345 '
'i am getting this error because of cutomer exit variables on navigatioanl attributes of Omaterial'
I tried supressing it in RSRT.. but unable to find the message.
I tried debugging and assigning enhancement points in FM BAL_LOG_MSG_READ.. As it is standard function module its not suggestable to do..
can we creat custom FM ?? will it be called if we write code to supress warning message??
Please let me know how to use BADI'S in order to supress the error message that appearing in query result?
Thanks All.Hi,
The warning is raised due to the following reasons:
- you have a selection in the filter of a navigation attribute
- in your DSO you do not use the option "SIDs Generation upon Activation"
If the option "SIDs Generation upon Activation" is not flagged,
you may get char.values for an Infoobject in the system not
having any SIDs. As a result you may see in the report less data as
expected.
For example we have Infoobject A with its Nav.attribute B
Infoobject A Nav.attribute B
12 13 ->> has a SID in the X-table
11 10
9 13 ->> has no SID in the X-table
If you define a selection on B =13 in the query, you only get infoobject
A with key 12 displayed in the result, since only B =13 has a SID
in the relevant X-table.
The warning refers to this behaviour and cannot be avoided unless you:
- flag the option in the ODS-settings
- or remove the filter defined on 0MATERIAL__xxxx
Thanks,
Venkat -
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 -
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. -
How to use query-result as a new query-fiter
HI, All
Is it possible to execute sub-query filtererd by the pre-query-reslted lists ?
As far as I investigated, only way to do is that I combine two suject-areas by using set operations like "Union" or around.
But in this way, there is an impractical restriction to define these datatype and column in common. (namely, "Union" conditions)
I just want to query filtered by ex-query-results at anytime; for example, I extract a customer lists by one query and use various analysis in the group of customer list.
Please give me some advise.
RegardsFirst create a Request with your FilterQuerey. Secund Create a Request und create a Filter. Under Advanced you will find the path to the first Requst. Than you can select the columns.
Thats it :-)
Stefan -
Query result to ASCII file output
Seems like there SHOULD be some rediculously simple solution
to this - but I sure haven't found it yet! I have a query which
produces the a varying number of columns (based on a multi-select
cfselect) which I need to output to a comma delimited ASCII (.TXT
or .DAT or .CSV file). I have all the steps worked out when the
number of columns and their names are known, but I need to make
this variable. First choice would be to be able to just "DUMP" the
query result into a text file. CFDUMP can send results to a text
file, but NOT in comma delimited format, and with all kinds of info
besides just the basic data. (NOT good!) Second choice, since the
"append to text file" uses an output property that expects a comma
delimited string variable would be to use CFLOOP to loop thru the
rows in the query and put them (a row at a time) into a variable,
then use that variable for the file append. Problem is I can't find
a way to just say "send *ALL* to the string variable. Every example
I have been able to find includes specifying the column NAMES when
doing anything with a row in the query result!!! Short of a brute
force series of if/then statements that specify EACH POSSIBILITY
(in this case 60 - 75 of them, and the number WILL GROW!) I haven't
been able to find a solution. There's GOTTA BE A WAY!!!!! :)auntiealias
> I tried that, but as far as I could figure you still
have to have a specific column name
Look at the udf more closely. If you read the documentation
it states all of the parameters are optional, except the query. So
if you do not supply column names, the function will use the
columnList variable to determine the names of the columns in the
query. If you look at the actual code, notice it uses array
notation to extract the values (not evaluate) .
... (code to create query) ...
<!--- pass in the query object only ---->
<cfset test = QueryToCSV2( data )>
http://cflib.org/index.cfm?event=page.udfbyid&udfid=1197
> I have a cfselect with multiple set to "yes" and the
selections are "which columns of
> data do you want to see?"
Hopefully you are not using the raw form value directly in
your sql, because that is a sql injection attack just waiting to
happen. -
How to get the dynamic query result
If in one query, there is the amount range dimension, based on different dimension value combination, the customer revenue should be refreshed into different range, how to make it by cube?
eg.
Customer Store Material Month Amount
C001 M & S Tennis 2005/01 "10"
C001 Douglas Tennis 2005/02 "60"
C002 M & S Soccer 2005/01 "1"
C002 M & S Soccer 2005/02 "50"
C002 M & S Tennis 2005/02 "50"
C003 Douglas Tennis 2005/01 20
Query condition:
Time Customer Amount Range Amount
2005 C001 0~50_____________0
2005 C001 51~100___________70
2005 C001 100 +____________0
2005 C002 0~50_____________0
2005 C002 51~100___________0
2005 C002 100+_____________101
2005 C003 0~50_____________20
2005 C003 51~100___________0
2005 C003 100+_____________0
However, if I drill down Time into month, the result is total different, I only list the result related to customer C001
Time Customer Amount Range Amount
2005/01 C001 0~50____________10
2005/01 C001 51~100__________0
2005/01 C001 100 +___________0
2005/02 C001 0~50____________0
2005/02 C001 51~100__________60
2005/02 C001 100 +___________0
Any good solution on that? Thanks for any input.
Message was edited by: Lei ShaoHi, Sen,
I used your solution in my infocube and query, where I created a structure with 'between'. However, it is still the simple summation in different amount range.
Just like the following:
Sales ORG / Sales Office / Sales Rep / Amount
East / Atlanta / 1001 / 3
East / Atlanta / 1002 / 4
So the query result is the same:
S-ORG / S-Office / S-Rep / Amount Range / Amount
East / Atlanta / 1001 / 0~5 / 3
East / Atlanta / 1001 / 5+ / 0
East / Atlanta / 1002 / 0~5 / 4
East / Atlanta / 1002 / 5+ / 0
When I remove 'drill down' for Sales Rep, the result is:
S-ORG / S-Office / Amount Range / Amount
East / Atlanta / 0~5 / 7
East / Atlanta / 5+ / 0
However our expection for the result is different, because in business traction, if we remove sales rep, the sales org and sales office will get the sub-total like this: (we can image it with ABAP program sub-total)
Sales ORG / Sales Office / Amount
East / Atlanta / 7
So our expection for the result is:
S-ORG / S-Office / Amount Range / Amount
East / Atlanta / 0~5 / 0
East / Atlanta / 5+ / 7
Therefore, any good suggestion for this?
Thanks a lot
Regards,
LS -
Output query result in XML format
folks:
could anybody provide more information
about how to generate query result in
xml format? looks like DBXML is for demo only
and i have heard that PLSQL XML parser is the way to go; so far i have not found
a sample yet on how to actually
do the XML generation; if you know more
about it, please let me know; thanks in
advance.
BillHere are some sample apps that might interest you:
[list]
[*][url [URL=http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The]http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The XML Flight Finder
[*][url [URL=http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B]http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B with XML
[list]
Enjoy,
-rh -
Bug in pinning of results tabs results in multiple query results tabs
In Tools > Preferences > Database > Worksheet there is an option called Automatically Freeze Reult Tabs.
This option, when unchecked, does not seem to be working. New query results tabs are created when pressing F9 to run selected query text.
Elsewhere I have read that this is a known bug (9247525). A work-around is said to be to not select text before pressing F9. However, this does not seem to always work for me. Sometimes SQL Developer tries to execute code that is outside of the immediate query. The result is usually a query error.
Thus a whole bunch of query result tabs build up.
Is this bug being addressed? Is there a place where these bugs can be looked up? Or that status of a bug checked?
Thanks for any assistance.
(I am on 2.1.0.63. On Windows.)
--MichaelThe bug you have found will be somewhere in the list of work for the SQL Developer team and should get fixed and included in a public release/patch eventually.
It sounds like your issue with the workaround (statement being identified based on cursor position) is with SQL Developer's pickiness with what is the end of a statement. As a general rule, SQL Developer will only consider a ; at the end of a line or a / starting a new line as the end of a statement - it does not consider a blank line the end of a statement. For example, the following is all considered a single statement:
select * from dual
select * from dual;theFurryOne -
Numbering query results with a line number in SQL*Plus
Doesn't it stand to reason that in SQL*Plus there would be a way to number each query results sequentially with line numbers starting at 1 to n -- something option like from a SET command? I'm not talking about linesize.
There's a column rownum the engine adds into the result sets, just add it to the select list. Can use it to limit the result set (with some limitations) i.e.:
select rownum, ... from ... where rownum <= 100
Can't use ">=", that condition will never be met but a subset could be used:
select * from ( select rownum as linenr, tab1.* from ... ) where linenr between 10 and 20 -
How to display query result like this
I got a query...gives list of names.
i want to display
11. Peter
12. Jessica
32. Leo
15. Jamie
36. Edward
how i get static number infront of my query result.
static number is not in order.Amm85 wrote:
I got a query...gives list of names.
i want to display
11. Peter
12. Jessica
32. Leo
15. Jamie
36. Edward
how i get static number infront of my query result.
static number is not in order.
You could use the function queryAddColumn to add the numbers as a separate column to the query.
Let us suppose the name of the query is "myQuery". Then you could proceed as follows
<!---Define your "static" list of numbers --->
<cfset staticList = "11,12,32,15,36,13,23,14,33,16,44,31,17,34,18">
<!--- Create an array from the static list. --->
<cfset staticNrArray = ArrayNew(1)>
<cfset staticNrArray = listToArray(staticList)>
<!--- Add the array as a column to the query. --->
<cfset nColumnNumber = QueryAddColumn(myQuery, "staticNr", "integer", staticNrArray)>
<!--- Verify whether it works as expected--->
<cfdump var="#myQuery#">
The list I have given here has 15 numbers. This will naturally instruct ColdFusion to add a new column named staticNr, having 15 rows. You might like to know that the queryAddColumn function enables padding.
Here is how it works. Suppose that the query originally had only 8 rows before you added the column(of 15 rows). Then, in the new query, ColdFusion would pad the last 7 rows of the other columns with null values. If the original query had 20 rows instead, then Coldfusion would pad the last 5 rows corresponding to the staticNr-column with null values.
Maybe you are looking for
-
Open port issues with Direct Print functionality
Hi, I have been fighting with HP call support about the Photosmart 7525 printer. Originally I setup and had performed all the functions to enable both web support and WIFI. Within an hour the printer would not respond to wireless communication, thoug
-
I have two phones under the same apple ID and I want to put them on separate apple IDs, how do I do this??
-
Does anyone know if there is a way to write data to a local xml file using the Connection refresh Button??
-
Hi I am getting this error while creating mapper xml for Transform activity. So i am not able to save the file.I am not able to move further bcoz of this error.. error: Required attribute version missing from element xsl:stylesheet Pls help me with t
-
My music won't sync and unkown music files
#1-i have ringtones and test music files that appear in my music files and i dont know where they come from. #2-I also have voice files for maps in my music files. ironically though, the voice files are not working with maps....i want to remove them