Condition in BI 7.0 query works in BPS layout?
Hello Experts
I know in BI 7.0, it is possible to define BW query with input-enabled feature, and BI integrated planning can use this query for input layout. But I wonder whether the "condition" for BW query(old BW query feature to restrict on keyfgs, say show data larger than amount 100)still works for BI integrated planning?
Thanks Patrick
Hi Deepu,
Please can you advise how I can set the iView to point to my 3.5 template. I have set the 3.5 template 0ANALYZER in SPRO under the 3.5 settings and all the queries run in the test portal for this QA environment show the rendering of queries in 0ANALYZER which works. But its QD that gives the error message:
<b>Error during conversion of the Web template "0ANALYSIS_PATTERN from the master system</b>
Still shows in QD for QA environments.
Will this be fixed if I restarted the Java engine?
Thanks
DV
Similar Messages
-
Variable Range not working in BPS-Layout.
Hi BI Guru's,
I am facing Problem in BPS - Layout.
My requirement is to get YTD Budget Quantity in Single Coulumn. For Example, I need Quantiy for the Period 001.2009 to 12.2009 in single Column as Budget YTD 2009.
For this I defined a variable on the Planning area, with the characteristics "fiscper" and in the selection condition i entered the range 001.2009 to 012.2009, but when i executed the layout it is showing the quantity for the perios 001.2009 only and not for the entire range.
I tried with the User Exit also, where i copied the standard function module "UPF_VARIABLE_USER_EXIT" to 'Z' function and modified to my requirement.
Following is my Code for the Function Module
clear eto_charsel.
data ls_charsel type upc_ys_charsel.
clear ls_charsel.
i_area = 'ZUCOPA'.
I_CHANM = 'FISCPER'.
i_variable = 'ZACTDYTD1'.
ls_charsel-chanm = i_chanm.
ls_charsel-seqno = '1'.
ls_charsel-sign = 'I'.
ls_charsel-opt = 'BT'.
ls_charsel-low = '2009001'.
ls_charsel-HIGH = '2009012'.
insert ls_charsel into table eto_charsel.
But the after using the Function Module in the User Exit area of Variable also, I am getting the Quantity for the Period 001.2009 only and not for the entire range ( 001.2009 to 012.2009 ).
Please suggest some solution ASAP.
Thanks in advance.
Regards,
VD.Hi Marc,
Thanks For your Reply,
I changed the Layout as suggested by you, where i have now 12 columns for Budget Quantity and a Total column( C1C2....C12).
I do not want to show this 12 column and instead want to show only the total column, so I hide this columnn's in the change layout but after saving the layout these columns again appear in the layout.
How do i hide these columns in the layout????
Thanks
VD -
Multiple Conditions in BEx 3.5 Query
Hello All,
I am using BEx 3.5 and I have two single line conditions in my query. One is set to "All Characteristics in the Drilldown Independently" and the other is set to "Single Characteristics or Comginations of Characteristics". Each Condition works when only one is active. When both are active, the one set to "All Characteristics in the Drilldown Independently" does not work. It has a check in front of it indicating that it is active, but it does not work properly. Is it possible to have two conditions active at the same time when one is set to "All ....." and the other is set to "Single....".
Any help would be appreciated!!
Thanks!
TinaHI Tina,
2 conditions at same time can't work on one characteristic in 2 different way. this is something like finding 1 red apple or 2 green apple in a pack up 4 apples say. which is not possible either you have 1st search for 1 and then for 2 or 1st 2 and then for 1.
when both the conditions are active i think the condition "Single Characteristics or Comginations of Characteristics" was after the condition "All Characteristics in the Drilldown Independently" in the designer and thats why its overwriting the other. you may decide logically which condition should be applied 1st and then from that out come, if the other condition is applicable then if it works for the desired out put. else you can make both the condition of same type either All char or single char.
i think you should put the condition "all char" for both and it should work.
you can also decide one primary condition and apply that one only and the other condition you can achieve using a RKF.
hope this helps. -
IIf condition between dates using mdx query
Hi,
how to check IIF condition between dates using mdx query.
I able to check single year,plese check below mdx query.I need to check members between years.
my requirement is member is belongs to between years(2007 to 2010),display "yes" else "NO";
Could you please give me exact mdx query.
From,to-2007,2010,if member belongs to 2007to 2010 then disply "yes"else "no".
how to pass two members in IIf condition.
WITH
MEMBER Measures.[test]
AS Iif([Date].[Calendar Year].currentmember
is [Date].[Calendar Year].&[2007],"no","yes")
SELECT {Measures.[test]}
on 0
,[Product].[Subcategory].[Subcategory].MEMBERS * [Date].[Calendar Year].[Calendar Year]
ON 1
FROM [Adventure Works]
induHi Sriindu,
consider the following:
WITH
MEMBER measures.[test] AS
IIF
Exists
[Date].[Calendar Year].CurrentMember
[Date].[Calendar Year].&[2007] : [Date].[Calendar Year].&[20010]
).Item(0)
IS
[Date].[Calendar Year].CurrentMember
,"yes"
,"no"
SELECT
{measures.[test]} ON 0
[Product].[Subcategory].[Subcategory].MEMBERS
[Date].[Calendar Year].[Calendar Year] ON 1
FROM [Adventure Works];
Philip, -
Can we put condition for color in bex query designer
hi all,
can any one guide me how to put a condition for color settings in query designer
for example:
i have a key figure like ANSWERED%.in analyser it should display in red if answered% exceeds 95%.
please help me in this issue.
regards
Vamshi D Krishna.Hi,
Use Exceptions while designing your Query.
Please go through the link
http://help.sap.com/saphelp_nw04s/helpdata/en/43/21b4cd14cd06f4e10000000a422035/frameset.htm -
SQL query works in access 2000 but not through JDBC
Hello to all as my first posted message, I have a bit of a pickle on my hands. I have a query which is critical to for my application to function.
In Access 2000
SELECT sb.SeatName
FROM SeatBooking sb, Movie m, MovieSession ms, Booking b
WHERE m.MovieId = ms.MovieId
AND ms.MovieSessionId = b.MovieSessionId
AND b.BookingId = sb.BookingId
AND ms.DateOfSession = #2003/04/16 07:15:00 PM#;
This query works fine. When I insert it into my code
String query = "SELECT sb.SeatName \n" +
"FROM SeatBooking sb, Movie m, MovieSession ms, Booking b \n" +
"WHERE m.MovieId = ms.MovieId \n" +
"AND ms.MovieSessionId = b.MovieSessionId \n" +
"AND b.BookingId = sb.BookingId \n" +
"AND ms.DateOfSession = #" +
cp.getMovieSessionAt(i).getTrueTimeOfSession() + "#;";
The last line of code returns #2003/04/16 07:15:00 PM#; Which is the exact same as in Access.
To rule out some possibilities
- there are other less complicated queries which access the same database but work fine. so my code seems to be ok
- I have tried to use Format() on ms.DateOfSession to match the return value of the java statement (Which is a general date in Access in the format of 16/04/2003 7:15:00 PM)
Any suggestions would be appreciated!Hi Simon,
On my Windows XP system with J2SE SDK version 1.4.1_02 and Micro$oft Access 2002, I have the following table:
column name column type
id Number
name Text
updated Date/TimeUsing the JDBC-ODBC bridge driver (that is part of the J2SE distribution), the following code uses the JDBC "escape" syntax -- and it works.
import java.sql.*;
public class JdbcOdbc {
public static void main(String[] args) {
Connection dbConn = null;
ResultSet rs = null;
Statement stmt = null;
String sql =
"SELECT * FROM Table1 WHERE updated = {ts '2003-04-13 07:53:23'}";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbConn = DriverManager.getConnection("jdbc:odbc:db1");
stmt = dbConn.createStatement();
rs = stmt.executeQuery(sql);
if (rs.next()) {
System.out.println("id = " + rs.getInt(1));
System.out.println("name = " + rs.getString(2));
System.out.println("updated = " + rs.getTimestamp(3));
catch (SQLException sqlEx) {
System.err.println("Database operation failed.");
sqlEx.printStackTrace();
catch (ClassNotFoundException cnfEx) {
System.err.println("JDBC driver class not found");
cnfEx.printStackTrace();
finally {
if (rs != null) {
try {
rs.close();
catch (SQLException sqlEx) {
System.err.println("ERROR: Failed to close result set");
sqlEx.printStackTrace();
if (stmt != null) {
try {
stmt.close();
catch (SQLException sqlEx) {
System.err.println("ERROR: Failed to close statement");
sqlEx.printStackTrace();
if (dbConn != null) {
try {
dbConn.close();
catch (SQLException sqlEx) {
System.err.println("ERROR: Failed to close DB connection");
sqlEx.printStackTrace();
}More details about the JDBC escape syntax are available here:
http://java.sun.com/j2se/1.4.1/docs/guide/jdbc/getstart/statement.html#999472
Hope this helps you.
Good Luck,
Avi. -
Query works fine in DEV instance but not in PROD instance
Hi,
I got an exceptional situation. I wrote a query to get the sign-on audit information. The query works fine in Development instance and executes within 2 seconds. But if i run the same query in production instance it does not finish execution. I checked for around 2 hours and after that i just stopped it. Does any one have any idea to find about the problem like to check temporary table space or any other thing please let me know. so that i can suggest the DBA to check for those parameters.
RDBMS : 11.1.0.7.0
Oracle Applications : 12.1.3
I am using Oracle SQL Developer 2.1.1.64
I am missing TOAD so much. My current organization dont have license to use TOAD.
Regards,
SyedIf your compnay does not have a Toad License, then you can use OracleSqlDeveloper.
Its free to use and made by Oracle.
You should post a query execution plan
explain plan for <your sql_statement>
and then issue this command:
select * from table(dbms_xplan.display());It's best if you spool the output through sqlplus and then post it up here.
I see you are using Sqldeveloper. The latest release is 3.2 which was only released within the last month.
Edited by: Keith Jamieson on Oct 25, 2012 1:21 PM
Added sqldeveloper note -
Cursor query works in anonymous block but not in procedure
Hello,
My cursor query works fine in anonymous blcok but fails in pl/sql block.
Anonymous block:
declare
cursor c1 is
select object_name
from all_objects
where owner='IRIS_DATA'
and object_type='SEQUENCE';
v_string varchar2(2000);
begin
for c2 in c1 loop
v_string := 'DROP SEQUENCE IRIS_DATA.'||c2.object_name;
execute immediate v_string;
end loop;
commit;
exception
when others then
dbms_output.put_line('Exception :'||sqlerrm);
end;
works fine.
but inside the procedure the it doesn't go inside the cursor loop
procedure get_sequence is
l_dp_handle NUMBER;
v_job_state varchar2(4000);
l_last_job_state VARCHAR2(30) := 'UNDEFINED';
l_job_state VARCHAR2(30) := 'UNDEFINED';
l_sts KU$_STATUS;
v_logs ku$_LogEntry;
v_row PLS_INTEGER;
v_string1 varchar2(2000);
cursor seq_obj is
select object_name
from all_objects
where owner='IRIS_DATA'
and object_type='SEQUENCE';
begin
log_status('get_sequence started.');
--Cursor records to drop the sequences before importing.
for seq_obj_rec in seq_obj loop
log_status('get_sequence: Dropping sequence started.');
v_string1 := 'DROP SEQUENCE IRIS_DATA.'||seq_obj_rec.object_name;
execute immediate v_string1;
end loop;
log_status('get_sequence: Dropping sequence completed.');
exception
WHEN OTHERS THEN
log_status('get_sequence: exception.');
end get_sequence;
it's not going into the seq_obj_rec cursor.
I granted select on all_objects to the user.this user is also having the DBA role as well.
Please advice.PROCEDURE Get_sequence
IS
l_dp_handle NUMBER;
v_job_state VARCHAR2(4000);
l_last_job_state VARCHAR2(30) := 'UNDEFINED';
l_job_state VARCHAR2(30) := 'UNDEFINED';
l_sts KU$_STATUS;
v_logs KU$_LOGENTRY;
v_row PLS_INTEGER;
v_string1 VARCHAR2(2000);
CURSOR seq_obj IS
SELECT object_name
FROM all_objects
WHERE owner = 'IRIS_DATA'
AND object_type = 'SEQUENCE';
BEGIN
Log_status('get_sequence started.');
--Cursor records to drop the sequences before importing.
FOR seq_obj_rec IN seq_obj LOOP
Log_status('get_sequence: Dropping sequence started.');
v_string1 := 'DROP SEQUENCE IRIS_DATA.'
||seq_obj_rec.object_name;
EXECUTE IMMEDIATE v_string1;
END LOOP;
Log_status('get_sequence: Dropping sequence completed.');
EXCEPTION
WHEN OTHERS THEN
Log_status('get_sequence: exception.');
END get_sequence; How do I ask a question on the forums?
SQL and PL/SQL FAQ
scroll down to #9 & use tags in the future. -
Query works in DB GUI, but not in CF
Hello,
I keep getting a CF error of "invalid character" for the
attached query.
Detailed error message: [Macromedia][Oracle JDBC
Driver][Oracle]ORA-00911: invalid character
I realize that's an Oracle error code, but the query works in
an Oracle db GUI (Toad).
Has anyone experienced this kind of situation?
Thank you.I've never tried using DDL in a CFQUERY myself with an Oracle
db, but you might try putting the entire statement inline (as in a
single line), rather than breaking it out like you did. It would be
hard to read, but it might parse better....... just a thought. I've
had similar problems with EXECUTE statements within a CFQUERY that
worked just fine when I rewrote them with no line breaks, etc.
Phil -
Why will a query work in SQL Developer but not in Apex?
Here's a good one. I created a dynamic LOV with the following query.
select
e.DESCR d,
ee.ENTRD_EVNT_SK r
from
PT_EVNT_IN_DIV eid,
PT_ENTRD_EVNT ee,
PT_EVNT e
where ee.PGNT_SK = :PGNT_SK
and ee.CNTSNT_SK = :CNTSNT_SK
and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
and eid.EVNT_SK = e.EVNT_SK
and ee.ENTRD_EVNT_SK not in
(select js.ENTRD_EVNT_SK
from PT_JDG_SCR js
where js.JDG_SK = :JDG_SK
and js.PGNT_SK = :ai_pgnt_sk
and js.CNTSNT_SK = :CNTSNT_SK)
order by 1
The query works fine in SQL Developer, but Apex gives the following error when compiling it in the LOV editor.
"1 error has occurred
- LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
I tried rearranging the entries in the From clause, but that didn't do any good.
Do you see what I can do to make Apex accept it?
Thanks,
KimKim
Kim2012 wrote:
select
e.DESCR d,
ee.ENTRD_EVNT_SK r
from
PT_EVNT_IN_DIV eid,
PT_ENTRD_EVNT ee,
PT_EVNT e
where ee.PGNT_SK = :PGNT_SK
and ee.CNTSNT_SK = :CNTSNT_SK
and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
and eid.EVNT_SK = e.EVNT_SK
and ee.ENTRD_EVNT_SK not in
(select js.ENTRD_EVNT_SK
from PT_JDG_SCR js
where js.JDG_SK = :JDG_SK
and js.PGNT_SK = :ai_pgnt_sk
and js.CNTSNT_SK = :CNTSNT_SK)
order by 1
The column named ENTRD_EVNT_SK is used twice in a select. Once in the main select and once in the inline query.
The validation maybe choking on that.
Try giving the column in the inline query an alias and see if that helps.
Nicolette -
Query working fine in toad but not in forms 6i
i have following coding on when button press triger
declare
CURSOR C1(year number,month number) IS
SELECT ITM_NO,ITM_NAME,XAQ QTY,XAQ*TP VAL,gp
FROM
select ci.itm_no ITM_NO,ci.itm_name ITM_NAME ,cpg.group_id gp ,xaq ,ALLIED.CORP_PRIC_TP( ci.itm_no)TP from
select prod_no,sum(xaq)*1 xaq
from
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_01_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_02_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_03_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_04_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
group by prod_no
) A,allied.corp_inv ci,allied.corp_01_01 c01, allied.corp_01_02 c02,allied.corp_prod_group cpg,allied.v_prod_grp vpg
where ci.itm_no=a.prod_no
and ci.itm_no=c02.itm_no
and c01.grp_id=c02.grp_id
and c01.grp_id in(55,56,57,58,59)
and vpg.prod_no =ci.itm_no
and vpg.group_id=cpg.group_id
where XAQ <>0;
Begin
delete from fiaz.tmp_topten_prod;
for i in c1(:year,:month)
loop
insert into fiaz.tmp_topten_prod
values(i.itm_no,i.itm_name,i.qty,i.val,i.gp,0);
end loop;
standard.commit;
message('inserted in temp');
exception when others then
message (dbms_error_text);
message (dbms_error_text);
End;
Same Query (as used in cursor c1) works fine in toad but giving wrong result from forms... and the problem is xaq field i.e returns incorrect qty...
i guess union clause is not working in this situation...
plz suggest me the appropriate changes in the query to work well from form as well...
combination:Forms 6i,Oracle 8.0.6
Regards,
Usman AfzalAs per your suggestion i have created a stored procedure but the followin error prevents procedure creation
create or replace procedure fiaz.topten_prod(v_yr number,v_mn number) is
begin
delete from fiaz.tmp_topten_prod;
insert into fiaz.tmp_topten_prod(itm_no,itm_name,qty,val,grp_id,prority)
SELECT ITM_NO,ITM_NAME,XAQ QTY,XAQ*TP VAL,gp,0
FROM
select ci.itm_no ITM_NO,ci.itm_name ITM_NAME ,cpg.group_id gp ,xaq ,ALLIED.CORP_PRIC_TP( ci.itm_no)TP from
select prod_no,sum(xaq) xaq
from
select prod_no, sum(nvl(xrd_sqty,0)) Xaq from allied.mrk_01_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_02_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_03_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_04_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
group by prod_no
) A,allied.corp_inv ci,allied.corp_01_01 c01, allied.corp_01_02 c02,allied.corp_prod_group cpg,allied.v_prod_grp vpg
where ci.itm_no=a.prod_no
and ci.itm_no=c02.itm_no
and c01.grp_id=c02.grp_id
and c01.grp_id in(55,56,57,58,59)
and vpg.prod_no =ci.itm_no
and vpg.group_id=cpg.group_id
where XAQ <>0;
commit;
end;
Error:
"PLS-00201: identifier ALLIED.MRK_01_02 must be declared "
i have not changed any thing in query working fine in toad without create procedure text and if i describe this table it shows the structure (desc allied.mrk_01_02)
Now where is the problemmmmm
Plz Help -
Query works in Access but not CF
I wrote this query initially in access to extract the data I
wanted out of my table. In MS Access, the query works fine, returns
the desired data. When I run the query from my CF page, i get the
following error:
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 2.
Can anyone tell me why? Below is my queryAs the IIF function is a valid CF function, it may not be
getting passed as 'plain text' to Access, instead CF
may be attempting to compile the function and pass the
result. If you can turn on debugging and for a short time set it to
include the SQL being passed in error messages, you can see what is
really going on.
Another option is to create/save the query in the Access
database and reference that instead of a table in your CFQUERY
call. Since you are just running a staright query and not passing
anything from CF (unless I am mistaken), calling the Access query
for your results would work fine.
<CFQUERY ...>
SELECT * FROM myQueryName
</CFQUERY>
HTH,
CR -
Query works in Report but not during Edit session
I have a report based on an SQL query, and it works perfectly from the menu in Development. It's also in Test and Production, and it works there, too. I want to change the template it's on, so I went in through the Navigator to open up and change the report. The Edit session opens up to the query, but I cannot move to any of the other tags, because it says the query is "not valid".
It won't allow me to save the query 'as is', because it supposedly isn't valid. The report isn't locked, and prior versions (I went back to view five of them) have the same trouble. How can the query work off the menu, but not be 'valid'? We installed a patch recently, but even so, why would the query work in one spot and not another?
Anyone have any ideas on what I can do?
Pat MurrayHi,
Please give me the query and the error the error you are getting.
Thanks,
Sharmila -
Simple Query working on 10G and not working on 11gR2 after upgrade
Hi Folks,
This is the first time i am posting the query in this Blog.
I have a small issue which preventing the UAT Sigoff.
Simple query working fine on 10.2.0.1 and after upgrade to 11.2.0.1 its error out
10.2.0.4:
=====
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
COUNT(*)
1
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001;
COUNT(*)
1
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1;
ATTRIBUTE1
00001
11.2.0.1:
=====
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=1
ERROR at line 1:
ORA-01722: invalid number
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1=00001
ERROR at line 1:
ORA-01722: invalid number
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='1';
no rows selected
SQL> SELECT COUNT(*) FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
COUNT(*)
1
SQL> select ATTRIBUTE1 FROM APPS.HZ_PARTIES HP WHERE ATTRIBUTE_CATEGORY= 'PROPERTY' AND ATTRIBUTE1='00001';
ATTRIBUTE1
00001
++++++++++++++++++++++++++++++++++++++++++++++
SQL > desc APPS.HZ_PARTIES
Name Type
======== ======
ATTRIBUTE1 VARCHAR2(150)
++++++++++++++++++++++++++++++++++++++++++++++
Changes:
Recently i upgraded the DB from 10.2.0.4 to 11.2.0.1
Query:
1.If the type of that row is VARCHAR,why it is working in 10.2.0.4 and why not working in 11.2.0.1
2.after upgrade i analyzed the table with "analyze table " query for all AP,AR,GL,HR,BEN,APPS Schemas--Is it got impact if we run analyze table.
Please provide me the answer for above two questions or refer the document is also well enough to understand.Based on the Answer client will sigoff to-day.
Thanks,
P KumarWhiteHat wrote:
the issue has already been identified: in oracle versions prior to 11, there was an implicit conversion of numbers to characters. your database has a character field which you are attempting to compare to a number.
i.e. the string '000001' is not in any way equivalent to the number 1. but Oracle 10 converts '000001' to a number because you are asking it to compare to the number you have provided.
version 11 doesn't do this anymore (and rightly so).
the issue is with the bad code design. you can either: use characters in the predicate (where field = 'parameter') or you can do a conversion of the field prior to comparing (where to_num(field) = parameter).
I would suggest that you should fix your code and don't assume that '000001' = 1I don't think that the above is completely correct, and a simple demonstration will show why. First, a simple table on Oracle Database 10.2.0.4:
CREATE TABLE T1(C1 VARCHAR2(20));
INSERT INTO T1 VALUES ('1');
INSERT INTO T1 VALUES ('0001');
COMMIT;A select from the above table, relying on implicit data type conversion:
SELECT
FROM
T1
WHERE
C1=1;
C1
1
0001Technically, the second row should not have been returned as an exact match. Why was it returned, let's take a look at the actual execution plan:
SELECT
FROM
TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
SQL_ID g6gvbpsgj1dvf, child number 0
SELECT * FROM T1 WHERE C1=1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 2 | 24 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(TO_NUMBER("C1")=1)
Note
- dynamic sampling used for this statementNotice that the VARCHAR2 column was converted to a NUMBER, so if there was any data in that column that could not be converted to a number (or NULL), we should receive an error (unless the bad rows are already removed due to another predicate in the WHERE clause). For example:
INSERT INTO T1 VALUES ('.0001.');
SELECT
FROM
T1
WHERE
C1=1;
SQL> SELECT
2 *
3 FROM
4 T1
5 WHERE
6 C1=1;
ERROR:
ORA-01722: invalid numberNow the same test on Oracle Database 11.1.0.7:
CREATE TABLE T1(C1 VARCHAR2(20));
INSERT INTO T1 VALUES ('1');
INSERT INTO T1 VALUES ('0001');
COMMIT;
SELECT
FROM
T1
WHERE
C1=1;
C1
1
0001
SELECT
FROM
TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,NULL));
SQL_ID g6gvbpsgj1dvf, child number 0
SELECT * FROM T1 WHERE C1=1
Plan hash value: 3617692013
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
|* 1 | TABLE ACCESS FULL| T1 | 2 | 24 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(TO_NUMBER("C1")=1)
Note
- dynamic sampling used for this statement
INSERT INTO T1 VALUES ('.0001.');
SELECT
FROM
T1
WHERE
C1=1;
SQL> SELECT
2 *
3 FROM
4 T1
5 WHERE
6 C1=1;
ERROR:
ORA-01722: invalid numberAs you can see, exactly the same actual execution plan, and the same end result.
The OP needs to determine if non-numeric data now exists in the column. Was the database characterset possibly changed during/after the upgrade?
Charles Hooper
Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
http://hoopercharles.wordpress.com/
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
SQL query works for Access but not mySQL
*I'm using the Database Connectivity VIs* Can anyone give me a clue as to why the following query works with an MS Access File DSN but not a mySQL File DSN:
SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
Thank you, your help is much appreciatedHi,
I don't think MySQL supports nested queries.
Regards,
Wiebe.
"optobionics" wrote in message
news:[email protected]..
> *I'm using the Database Connectivity VIs* Can anyone give me a clue
> as to why the following query works with an MS Access File DSN but not
> a mySQL File DSN:
> SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE
> '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime >
> 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
> Thank you, your help is much appreciated
Maybe you are looking for
-
Since there is no XML validation currently in the Flex/Flash framework, I've decided to start a class that parses a string in an effort to validate the markup, returning whether the XML is valid. I have a need for it in my non-server based applicatio
-
User exit for release strategy
Dear Sappers I want to reset the release strategy after change in price field for PO or Scheduling agreement .( When the price less than the ex-price then PO never goes to release ) For this, We have to required the user exit can u please tell me whi
-
How to config nfs client in netware 6 SP5
Hello, I'm with some problems to find some information. It becomes difficult to find on a system already without support. I need to access an NFS from NetWare 6 SP5, and the truth can not find anything, so some links are broken. Anyone have any idea.
-
Richfaces and AdfBindings and FacesCtrlRangeBinding question.
I am trying out using Richfaces 3.1 along with ADF bindings and using Jdev 10.1.3.1. <rich:scrollableDataTable value="#{bindings.EmpView1.collectionModel}" var="row" <column> <af:outputText value="#{row.EmpName}" /> </column> </rich:scrollableDataTab
-
Atomic Primary Key or Composite ? Which approach is better ?
Hi all, I have a table that has its composite primary key (infact foriegn keys of other tables make pk in this table). But due to large project complexity, i just want to have an atomic primary key, so that i could use a sequence for it, instead of u