Query problems with cfqueryparm
Any ideas to why this wouldn't be working properly.
<cfparam name="FORM.login" default="1">
<cfquery name="Recordset1" datasource="userLogin2">
SELECT welcome
FROM Book1
WHERE user_name =
<cfqueryparam value="#FORM.login#" cfsqltype="cf_sql_clob"
maxlength="255">
</cfquery>
Welcome
<cfoutput>#Recordset1.welcome#</cfoutput>, thank-you
for signing in.
> Any ideas to why this wouldn't be working properly.
Not without you giving us some hint as to why you think it's
not "working
properly", no (*).
I can confidently say that no-one using these forums seems
telepathic.
Adam
(*) actually, I have an idea, but unless yuo more accurately
describe your
problem, I dunno.
Similar Messages
-
Query problem with accumulated key figures
Hi BI Gurus!
I have a report problem that I hope you can help me with!
In my report I have 2 key figures. One for accumulated revenue previous year (KF1) and one for accumulated revenue current year (KF2). Both key figures should be presented in a graph in monthly buckets.
January figures from both the key figures shoule be presented in the same bucket. Therfore I can't use 0CALYEAR since we have the "year" information in there. Instead I'm using 0CALMONTH2 which is only two digits, 01 for January. That way I can map figures from both previous year and current year in the same bucket.
I need the figures to be accumulated and this is what I have problem with. When I run the report today in February 2010 it looks like this:
Month KF1 KF2
01 10 15
02 10 20
03 15
04 10
05 20
06 10
07 10
08 15
09 15
10 20
11 20
12 10
This is how I would like the report to look like:
Month KF1 KF2
01 10 15
02 20 35
03 35
04 45
05 65
06 75
07 85
08 100
09 115
10 135
11 155
12 165
I have tried to use the setting "accumulated" for the key figures but then I get this result:
Month KF1 KF2
01 10 15
02 20 35
03 35 35
04 45 35
05 65 35
06 75 35
07 85 35
08 100 35
09 115 35
10 135 35
11 155 35
12 165 35
Since the KF2 is revenue for current year and I run the report in February I don't want any figures to be displayed in Mars...
I have tried to restrict the key figures by 0CALMONTH2 and 0CALYEAR. The KF1 is havein a restriction to only show values for 0CALYEAR - 1 and an interval for 0CALMONTH2 from JAN - DEC.
The KF2 is having a restriction to only show values in the interval "first month in year - current month" (in this example JAN - FEB) for 0CALMONTH2. And current year for 0CALYEAR.
Despite my restrictions for KF2 the numpers repeats itself for every month...
Any suggestion how I can resolve this?
Best regards
Anders FlorinHi Khaled and thank you for trying to help me!
I agree with you and think the users should accept the report as it is. But they are claiming that top management will not accept this and they would really want this to be fixed the whay that they want. I have tried to push back on this and said that I'm not sure that it can be resoleved and that it could cost them a lot of money if I try.
But I will try to resolve it for them if I have spare time in the end of the project. I have not promised them anything but it would really be nice if I could fix it.
So when you say I need to use a structure and a calculated key figure. How should the calculated key figure and the structure be configured?
If I use a structure in the rows I guess I can't use same object in calc.key.figure right? Like if I use 0CALMONTH2 in the structure I'm not able to restrict the key figure with the same object? If that is correct I also have a ZMONTH object, different story why I have that... , that I can use in the same way as 0CALMONTH2. Or is this only a problem when I use "local" formulas within the query and not using a "global" calculated key figure? Cause I have only used the "loacal" formula calculated key figure in this report....
Br
Anders -
Query problem with hierarchy filter
Hello everybody,
i have a problem with a BEx Query 3.5 on a BW 7.01-System. This query includes the cha cost category as free characteristic which is filtered on a node. When we execute this query everythin works correktly. When I now select a filter value in BEx fpr this char the formula value in the row does not change. When I drilldown on this char the correct data was shown. This problem occurs only with this hierarchy node. With other selected nodes this problem does not occur.
We have regenerated this query in rsrt but that don't fix this issue.
Has anybody an answer?hello,
the problem is known. You may check whether implementing the following note solves the issue:
1434532
best regards,
Jerome -
SQL Query problems with Mysql - possible Java bug
I have a query that works fine on mysql, but does not work in my jsp page.... my db connection and all that jazz is fine.
select somefields from table order by (integerfield / doublefield)
two notes... the query works without the order by. And the query works with the order by when I'm working directly with the db. Any ideas? This is driving me nuts!!!!
Thanks,
TysonNevermind, just a dumb mistake... finally figured it out.
-
Adhoc query-Problem with Personnel no output field
Hi Gurus,
We are trying to run an adhoc query using a customized Info set(PNPCE logical database).
While running the query,we had selected Personnel no(from Payroll status P0003 table) as output field and Company code(from Org assignment P0001) as input field in the selection.
Problem is in the output field we are seeing the Personnel name details in place of Personnel no.Could anyone please suggest what could be the reason behind this and how to fix it.
Your help will be highly appreciated.
Warm Rgds
SushilHi Sushil,
The default output for fields with a text and a value (Name = text, PERNR = value) is the text. You can change this by right clicking on the output box in Ad Hoc and selecting "Value". If you want both name and number, select "Value and Text".
You can also change this default to Value from Text if in Ad Hoc, you go to Edit --> Settings. On the last tab, change the radio buttion for output default to Value from Text. This will change it for all fields so you would see the eight digit number rather than the name of the position or org unit. Thus, you may want to keep it at Text and use the right click to change specific fields as needed.
By the way, it is usually best to utilize the personnel number field from IT0000-Actions, although it can be obtained from any infotype if you include that field in the field group when creating your infoset.
Paul -
Master-Detail query problem with composite key
I have tested a MD form with EMP and DEPT tables and the MD query works okay.
I have created two tables both with two fields EMP_ID and REPORT_DATE as a composite key. The problem I am having with the MD form is that it does not query back the results when I select the QUERY button. I have verified that the join is setup during the creation of the form.I have recreated the form and the MD query works fine.
-
SQL date query problem with century/ year
We have an oracle database with about 6 million records. There is a date field called Entered Date that ranges from 1985 to the present.
The majority of these records were entered prior to Jan 1 2000.
If I run a query like
select count(*) from (tablename) where entered_date < '01-JAN-00' I get 0
if I do
select count(*) from (tablename) where entered_date < '31-DEC-99' I get 0
BUT IF I DO
select count(*) from (tablename) where entered_date < '01-JAN-00' I get 6 million records
or
select count(*) from TREASURY.ctrc where entrydate > '31-DEC-99' I get 6 million records
I've tried the same queries using 4 digit years but get the same results; it thinks that 2000 is the less than 1999
How do I get around this?
thanksHi,
975204 wrote:
there are 6 million records on the table
about two thirds have a date prior to Jan 1 , 2000How do you know that? From knowledge of the application, you may know that two thirds of them are supposed to have dates prior to 2000, but if
SELECT COUNT (*)
FROM TABLE_NAME
WHERE ENTRYDATE < TO_DATE ( '01-JAN-2000'
, 'DD-MON-YYYY'
;returns 0, that's pretty strong proof that none of them actually do.
When I look at the dates , they display as 31-DEC-86Another example of why using 2-digit years is such a bad idea.
I cant actually provide dump of this clients confidential dataSeriously; you can't provide one DUMP output? You've already said that it displays as 31-DEC-86, so even if the fact that 1 entry in the 6-million row table was done on December 31, 1986 was such a big secret, it's already out, and you won't be causing any more harm by showing the DUMP results.
I ran the query with the same format as the date ie
SELECT COUNT(*) FROM TREASURY.CTRC WHERE ENTRYDATE < TO_DATE ( '31-DEC-99'
, 'DD-MON-YY'
but same results
if the column is defined as a DATE type, does Oracle make a distinction based on how the data displays, meaning does it think that 31-DEC-86 is different than 31-DEC-1986?No, all DATE columns have the same format. A DATE may be displayed one way of the other, but it is stored as neither.
Do I need to convert all the data to a 4 digit year? You should always display dates with a 4-digit year.
Run an update query that says if year >= 80 and <= 99 add 19 in front of the year, else add 20 in front of the yearLet's find out exactly what the problem is, first.
Did you see Ascheffer's message? ^1^ It was dated just a couple of minutes before your last message, so you might not have noticed it. Run it to see what the actual 4-digit years are.
If it shows, for example, that there are a lot of entrydates in the years 2080 to 2099, and you decide that all of those really should be 100 years earlier, then use ADD_MONTHS to correct them:
UPDATE table_name
SET entrydate = ADD_MONTHS ( entrydate
, -100 * 12
WHERE entrydate >= TO_DATE ( '01-JAN-2080'
, 'DD-MON-YYYY'
AND entrydate < TO_DATE ( '01-JAN-2100'
, 'DD-MON-YYYY'
;Edited by: Frank Kulash on Mar 15, 2013 6:09 PM
^1^ Obviously, you did see Ascheffer's message; I was still typing the message above when you posted another one. -
Adhoc Query- problem with the output file format
Hi Gurus,
I have a problem in exporting the output of an adhoc query to Excel format.
The menu option I chose to export the report data into Excel is List>Export>Spreadsheet.
However,I think I've just pressed the wrong option to export my report and now I can't seem to change it from a HTML file option.
Can anybody help me correct this output setting.
Points assured for apt help...Hi Sushil,
There are two ways to save the output in the excel format.
As you have mentioned, you can use
List -> Export-> Spreadsheet.
Then select table. Now the output will open in a spreadsheet.
The other way is
List -> Export-> Local File
Here you need to select the option spreadsheet. Then mention the path where you want the file to be stored. Also mention the format as .xls
Hope this helps
Regards,
Brinda -
I have a query that needs to pull data between a date range.
I've tried several things and nothing seems to work.
Any help would be greatly appreciated.
Here's the code:
<cftransaction>
<cfquery name="QryFollowUp"
datasource="NBProdReports">
SELECT TblContractInfo_SubMenuTable.User_ID,
TblContractInfo_SubMenuTable.Contract_Number,
TblContractInfo_SubMenuTable.Transaction_Type,
TblContractInfo_SubMenuTable.Notes,
TblContractInfo_SubMenuTable.Num_Checks_Trans,
TblMasterTrans.Date_Opened
from TblContractInfo_SubMenuTable ,tblMasterTrans
WHERE Transaction_Type = 'FollowUp'
And TblContractInfo_SubMenuTable.Task_Number =
tblMasterTrans.Task_Number
And TblMasterTrans.Date_Opened BETWEEN #form.StartDate# AND
#form.EndDate#
ORDER BY TblMasterTrans.Date_Opened ASC,
TblContractInfo_SubMenuTable.User_id ASC
</cfquery>
</cftransaction>Any help would be greatly appreciated.
Ok, why are you using a <cftransaction...> around a
single select query?
It should be unnecessary.
This is probably not helpful to your original question. There
is
nothing obviously wrong with your query at least to my glance
through.
Thus this important question, the one without which you are
unlikely to
get any helpful advice, "How does this not work?" Error
Messages? No
Data? Wrong Data? Serves you coffee instead of tea?
It would also probably be helpful to know how your date data
is
represented in the database and the form controls, depending
on what
your difficulties are. -
BEx Query Problem with variable
Hi experts,
I want to create a report with month variable such that when the user enters (let say)October the report will look like this:
October November December
I want to see the October column as cumulative(sum of Jan-Oct) and the remainings as single values.How can I achieve this?
Thanks and regards,
SunnyHi,
As far as i understand your problem you need three things to display.
Suppose you have a key figure sales and you want to display cumulative sales (current year till month entered by user) and another sales of next two months.
For next months based on user entry you can work around with offset only.Restrict your keyfigure with 0calmonth offset1 and offset2.
FOr yeat till month requirement you need to make one customer exit variable.Please check the below link for the same.
Variable Exit
Hope it helps.
Regards,
AL -
Named query problem with "like" statement
I'm having issues with a named query that contains a 'like' statement in it. I have other named queries that have like statements that have hardcoded like values in them that work fine.
(i.e. select * from foo where foo.col1 like 'foo%' )
But when the like value to be tested is a parameter, it doesn't seem to work at all, no matter what variation i've tried, other than no wildcards.
(i.e.
this DOES work
select * from foo where foo.col1 like #fooParm
this DOES NOT work
select * from foo where foo.col1 like '%#fooParm%'
Any suggestions on how to get this to work?
Thanks in advanceTry building your select statement in a different way.
Instead of:
select * from foo where foo.col1 like '%#fooParm%'
Try something like:
select * from foo where foo.col1 like '#fooParm'
And include the wild cards in the parameter.
i.e. if fooParam was 'abc', make fooParm = '%abc%' -
Query Problem With Exception Aggregation
Hello,
I have two I/O 0Customer and 0Cont_Acct and also I have a Infoset made out of both. Here is the problem i am trying to solve,
I want to figure out the customers who has more than five contract accounts associated with each customer number.
Here is the solution I approached....
1) Created a formula variable counter on the KF # of data records (which is provided in the Infoset automatically ) with exception aggregation total while referencing the contract acct I/O.
2) Kept my customer # and Contract acct on my rows area.
The results I am getting is less than satisfying. I am expecting this output below.
Customer # Cont Acct Total No of Cont.acct
A 1001 1
1002 1
1003 1
3
B 1007 1
I would appreciate anybody's help in this. Thanks a lot.
-AHi,
We have the same problem and raised an OSS ticket. They replied us with the note 1257455 which offers all ways of improving performance in such cases. I guess there s nothing else to do, but to precalculate this exception aggregated formula in data model via transformations or ABAP.
By the way, cache can not help you in this case since exc. agg. is calculated after cache retrieval.
Hope this helps,
Sunil -
SELECT query - problem with SORT
Hi,
Same select query behaves different way on development and quality server
on Development it returns unsorted and Quality returns sorted
it can be resolved by SORT but why does it behave differently
Do you know what is setting in database
thanksFrom F1 on SELECT:
Orders the records in a SELECT statement. Without the ORDER-BY clause, the order
in which the selected lines are supplied is undefined. This means that two similar SELECT
statements may produce lines in a different order.
Rob -
Query problem with multiple date fields.
I need to select the greatest date from six different fields in each record and identify from which column was selected.
date01 date02 date03 date04 date05 date06
010190 010107 010190 010190 010190 010190
010190 010190 010105 010190 010190 010190
010103 010190 010190 010190 010190 010190
1)if greatest is in date01 then S = 1
2)if greatest is in date02 then S = 2
3)if greatest is in date03 then S = 3
4)if greatest is in date04 then S = 4
5)if greatest is in date05 then S = 5
6)if greatest is in date06 then S = 5
Do you have any idea on how to acomplish this?
ThanksAnother way (won't work for null dates):
with
the_data as
(select to_date('01011990','DDMMYYYY') col1,to_date('01012007','DDMMYYYY') col2,to_date('01011990','DDMMYYYY') col3,
to_date('01011990','DDMMYYYY') col4,to_date('01011990','DDMMYYYY') col5,to_date('01011990','DDMMYYYY') col6
from dual union all
select to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY'),
to_date('01011990','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012005','DDMMYYYY')
from dual union all
select to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),
to_date('01011990','DDMMYYYY'),to_date('01012003','DDMMYYYY'),to_date('01011990','DDMMYYYY')
from dual
the_setup as
(select rownum the_row,col1,col2,col3,col4,col5,col6,greatest(col1,col2,col3,col4,col5,col6) the_greatest,
to_char(col1,'DDMMYYYY') || to_char(col2,'DDMMYYYY') || to_char(col3,'DDMMYYYY') ||
to_char(col4,'DDMMYYYY') || to_char(col5,'DDMMYYYY') || to_char(col6,'DDMMYYYY') dates
from the_data
the_columns as
(select the_row,
max(decode(position,1,'1,')) || max(decode(position,2,'2,')) || max(decode(position,3,'3,')) ||
max(decode(position,4,'4,')) || max(decode(position,5,'5,')) || max(decode(position,6,'6,')) the_cols
from (select distinct the_row,level position
from the_setup
where substr(dates,8 * (level - 1) + 1,8) = the_greatest
connect by level <= 6
group by the_row
select col1,col2,col3,col4,col5,col6,the_greatest,rtrim(the_cols,',') the_columns
from the_setup s,the_columns c
where s.the_row = c.the_row
order by s.the_row
==========================================================================================================
COL1 | COL2 | COL3 | COL4 | COL5 | COL6 | THE_GREATEST | THE_COLUMNS
==========================================================================================================
01.01.1990 | 01.01.2007 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.1990 | 01.01.2007 | 2
01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.1990 | 01.01.1990 | 01.01.2005 | 01.01.2005 | 3,6
01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003 | 01.01.1990 | 01.01.2003 | 1,3,5Regards
Etbin -
SQL query problem with sorting
Hi,
I have question regarding sql query . Right now I am getting the results like this if i use this sql query
select ID,Name,Desc,Priority from emp order by Priority ;
Priority is varchar field. I don't want to change the Priority field and cannot add a new column in the table. Because i don't have permission to do that.
ID Name Desc Priority
=============================================
234 paul paul desc Highest
3452 mike mike desc High
4342 smith smith desc Low
6565 kelly kelly desc Low
9878 nate nate desc Medium
3223 deb deb desc High
============================================
I need a query to get the results like that.
ID Name Desc Priority
=============================================
234 paul paul desc Highest
3452 mike mike desc High
3223 deb deb desc High
9878 nate nate desc Medium
4342 smith smith desc Low
6565 kelly kelly desc Low
============================================
If any one knows about this one, please let me know.
Thanks,
BalaYou are aware that there are differences in the SQL implementation between Sqlserver and Oracle? You could try something like this, if there's a INSTR function:
ORDER BY INSTR('Highest,High,Medium,Low,', Priority || ',')You may have to change the "Priority || ," to a "Priority + ','), if string concatenation is done differently in sqlserver. Don't know about the ('), maybe you need (").
C.
Maybe you are looking for
-
Hi all In the component overview screen of CO01 I want to disable the requrement quantity screen.I want to make it as output screen only. how to do this.which exit to use for that screen (screen no : 120 of SAPLCOMK ) Kindly help. Regards Visw
-
Pros/cons of NFS vs local RAID
Hi: We're buying a new Unix platform for out Oracle server. The CS group is inclined to house our DB files on networked disks (using NFS) as opposed to local RAID arrays. Which is faster and/or more reliable? Are there any metrics on this? Thanks in
-
Itune.exe - itune.dll error when open with windows 7
Hey tehre friends. I´m brand new ipod 5gs owner, but i having problemn with Itunes. Every time o try to execute him, i get this error: Faulting application name: iTunes.exe, version: 9.0.1.8, time stamp: 0x4ab809c1 Faulting module name: iTunes.dll, v
-
XML import = missing entities (common HTML tags)?
I have a very simple XML doc, mostly text, but with common HTML tags (nbsp, for example). Upon import, I get an error for several of these tags - "Entity _____ was not found." These are common HTML characters - what can I do so that InDesign recogniz
-
What do I have to do? I have paid for acrobat pro and it won't let me download the software, says error 1310 - Error writing file... verify you have access to directory. I need help Thank you