Problem while creating summary view
Hi frnds i am trying to creating a view that contains only summary but i am getting error pls find my script below getting error sql command not properly ended,What's the wrong
create or replace view call_stat_v
(Tot_usr,Act_usr,call_rcv) as
(select count(*) from call_logs) Tot_usr,
(select count(*) from call_logs where trunc(last_login) >= trunc(sysdate - 9))Act_usr,
(select count(*)
from call_agt_all a,call_leads b
where a.BATCHNO = b.BATCHNO
and a.SERNO=b.SERNO
and b.status is null and
trunc(a.C_DATE) >=trunc(sysdate -9))call_rcv
there is no way solution from blushadow to cause the error you mention
Proof Of Concept
===========
SQL> create table call_logs ( last_login date);
Table created.
SQL> create table call_agt_all ( batchno number, serno number, status varchar2(1), c_date date)
2 .
SQL> create table call_agt_all ( batchno number, serno number, c_date date);
Table created.
SQL> create table call_leads ( batchno number, serno number, status varchar2(1));
Table created.
SQL> ed
Wrote file afiedt.buf
1 select
2 ( select count(*) from call_logs ) c1,
3 ( select count(*) from call_logs where trunc(last_login)>=sysdate ) c2,
4 ( select count(*) from call_agt_all a, call_leads b
5 where a.batchno = b.batchno
6 and a.serno = b.serno
7 and b.status is null
8 and trunc( a.c_date ) >= sysdate ) c3
9* from dual
SQL> /
C1 C2 C3
0 0 0
SQL> insert into call_logs values (sysdate);
1 row created.
SQL> insert into call_logs values (sysdate);
1 row created.
SQL> insert into call_logs values (sysdate);
1 row created.
SQL> commit;
Commit complete.
SQL> insert into call_logs values (sysdate+10);
1 row created.
SQL> insert into call_logs values (sysdate+10);
1 row created.
SQL> insert into call_logs values (sysdate+10);
1 row created.
SQL> select
2 ( select count(*) from call_logs ) c1,
3 ( select count(*) from call_logs where trunc(last_login)>=sysdate ) c2,
4 ( select count(*) from call_agt_all a, call_leads b
5 where a.batchno = b.batchno
6 and a.serno = b.serno
7 and b.status is null
8 and trunc( a.c_date ) >= sysdate ) c3
9 from dual;
C1 C2 C3
6 3 0
SQL> insert into call_agt_all (batchno, serno, c_date) values (1,1,sysdate);
1 row created.
SQL> insert into call_agt_all (batchno, serno, c_date) values (2,2,sysdate);
1 row created.
SQL> insert into call_agt_all (batchno, serno, c_date) values (3,3,sysdate);
1 row created.
SQL> insert into call_agt_all (batchno, serno, c_date) values (4,4,sysdate+10);
1 row created.
SQL> insert into call_agt_all (batchno, serno, c_date) values (5,5,sysdate+10);
1 row created.
SQL> insert into call_agt_all (batchno, serno, c_date) values (6,6,sysdate+10);
1 row created.
SQL> insert into call_leads (batchno, serno) values (1,1);
1 row created.
SQL> insert into call_leads (batchno, serno) values (2,2);
1 row created.
SQL> insert into call_leads (batchno, serno) values (6,6);
1 row created.
SQL> insert into call_leads (batchno, serno) values (5,5);
1 row created.
SQL> commit;
Commit complete.
SQL> select
2 ( select count(*) from call_logs ) c1,
3 ( select count(*) from call_logs where trunc(last_login)>=sysdate ) c2,
4 ( select count(*) from call_agt_all a, call_leads b
5 where a.batchno = b.batchno
6 and a.serno = b.serno
7 and b.status is null
8 and trunc( a.c_date ) >= sysdate ) c3
9 from dual;
C1 C2 C3
6 3 2
SQL> create or replace view lili as
2 select
3 ( select count(*) from call_logs ) c1,
4 ( select count(*) from call_logs where trunc(last_login)>=sysdate ) c2,
5 ( select count(*) from call_agt_all a, call_leads b
6 where a.batchno = b.batchno
7 and a.serno = b.serno
8 and b.status is null
9 and trunc( a.c_date ) >= sysdate ) c3
10 from dual;
View created.
SQL> select * from lili;
C1 C2 C3
6 3 2
SQL> insert into call_logs select * from call_logs;
6 rows created.
SQL> insert into call_agt_all select * from call_agt_all;
6 rows created.
SQL> insert into call_leads select * from call_leads;
4 rows created.
SQL> select * from lili;
C1 C2 C3
12 6 8
SQL>
Similar Messages
-
TP CONFIGURATION PROBLEM ( While creating a View Controller in Component )
Hi All,
I have a problem in TP Config while creating a View Controller in a component i am getting this Exception
Parameter lsm(&1) not in version 0004(&2) of tp configuration .
This Exception Raised from this Function Module : RS_ACCESS_PERMISSION
Any on can please help me to come out of this issue.
Regards And Thank you,
Nirmala.KSounds like you should be using one of the Apps forums, perhaps {forum:id=210}
-
Problem while creating help view.
hi experts,
i'm creating a help view.
my base table is mara.
i've to link it up with mast table.
while creating help view, when i see its relationship with mast table its under the section ("Relationships with unsuitable cardinality").
when i click on it and then click on copy.
it doesnot get copied.
what is the reason and how should i go about it.
plz help.hi
good
go through this link ,which ll give you detail idea about the help view
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed13446011d189700000e8322d00/content.htm
thanks
mrutyun^ -
Facing problems while creating tree view
Hi gurus,
I am facing problems while crating the tree view can please explain me what are the basic requirements for creating tree view and explain me which are the methods i need to redefine.
any answer is appreciated.
Regards,
Chetan AgaliHi Chetan,
Maybe Poonam Assudani weblog may help you a little more. Check it's location here:
/people/poonam.assudani/blog/2009/06/24/create-a-tree-view-display-in-crm-web-ui
Kind regards,
Garcia -
Problem While Creating Classification View in mm01
Hi Friends,
I have useing 'BAPI_OBJCL_CREATE' for creating Classfication View
I am passing mat no, class , class type ..
How can i find characteristic values for particular Class..
Means How can i find values which r passed through
ALLOCVALUESNUM , ALLOCVALUESCHAR, ALLOCVALUESCURR tables
I have code like this
{ CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
OBJECTKEYNEW = P_MATNR
OBJECTTABLENEW = 'MARA'
CLASSNUMNEW = IT_MATMAS-CLASS
CLASSTYPENEW = IT_MATMAS-KLART
STATUS = '1'
KEYDATE = SY-DATUM
TABLES
ALLOCVALUESNUM =
ALLOCVALUESCHAR =
ALLOCVALUESCURR =
RETURN = IT_RETURN2.Hi,
You need to use the BAPI 'BAPI_OBJCL_CREATE' to create characteristics for a material.
The characteristics are need to be passed in the table ALLOCVALUESCHAR.
If you do not know the values for a particular characteristics then you canmake use of FM
BAPI_CLASS_GET_CHARACTERISTICS and BAPI_CHARACT_GETDETAIL to get the values.
Regards,
Ankur Parab -
Problems while facing Materialized Views
Hello All,
I am facing some problems while creating Materialized Views.
Senario.
SCOTT USER:
sql> Grant select on emp to Public;
sql> Create materialized view log on emp;
Connected to LDB User
sql> CREATE MATERIALIZED VIEW mt_emp
Refresh fast
as select * FROM scott.emp;
I am getting error.. Stating that Table doesnt Exist.
Please tell me the Reason..
Note:
If there is No Log on table Emp then it is throwing the error that there in no LOG on the EMP Table.
Now when I create a Log on EMP table --> Then it is giving the Problem that Table doesn't Exist.Hello paragjp
The Below are the Steps I am Implementing..
Connect as Scott User.
SQL> Grant select on Emp to Public;
SQL> Create materialized view log on emp with primar key;
Now I will be Connecting to Other User Say LDB
Connect as LDB User
SQL> CREATE MATERIALIZED VIEW mt_emp
Refresh fast
as select * FROM scott.emp;
-- The Below Errors are comming
ERROR at line 3:
ORA-12018: following error encountered during code generation for "K5ESK_LDB2"."MT_EMP"
ORA-00942: table or view does not exist -
While creating Summary on some of the folders based on custom views using ASM or mannually, I am getting this fine grain access policy error.
ORA-30372: fine grain access policy conflicts with materialized view
While creating Summary using query statistics, I am getting this following error.
ORA-30353: expression not supported for query rewrite
We are using Discoverer 10g. We have an APPS mode EUL and I am doing this by logging into Discoverer Admin as EUL owner, which is EUL_US. This user has all the previlages specified in Discoverer Admin Doc.
ORA-30372, I could figure out is the problem with tables HZ_ORGANIZATION_PROFILES and HZ_PERSON_PROFILES which I used in the view for the folder I need to summarize.
Tried creating materialized views on these folders seperately in SQL plus, but have the same error.
Can Somebody help me to get through this?Hi
I am not saying you cannot use summaries but that you have to be aware of the underlying security. Most of the time you will need to use an external summary table not one that has been created for you by Discoverer.
The following snippet, which will help, is taken from the Oracle Business Intelligence Discoverer Administration Guide, found here: http://download-east.oracle.com/docs/html/B13916_04/orapps_supp.htm#sthref1165
As the Discoverer manager of an Oracle Applications mode EUL you must be aware of the following:
1. Some Oracle Applications database views contain row level security and return differing result sets depending upon the currently active responsibility. This means that materialized views (summary tables in Oracle Standard Edition databases) will contain different data depending on the responsibility of the user refreshing the external summary folder.
2. A summary folder based on an Oracle Applications secure view or Oracle Applications business view must be registered in Discoverer as an external summary folder (for more information, see Chapter 14, "How to create summary folders based on external summary tables").
3. Where an external summary folder is mapped against a table or view with Oracle Applications row level security, it is your responsibility as Discoverer manager to make sure the external table or view provides secure access. If you are not sure, ask your database administrator.
4. If a managed summary folder is found that satisfies a query (based on data with Oracle Applications row level security), Discoverer informs the end user that no rows satisfy the query criteria. Discoverer does this to ensure that end users do not see data they should not have access to.
5. If a managed summary folder is found that satisfies a query (based on data without Oracle Applications row level security), Discoverer returns the rows unaffected. Discoverer does this because the data can be safely accessed by all end users.
6. Some Oracle Applications views with row-level security support "public" rows (particularly Human Resources).
I hope this helps
Best wishes
Michael Armstrong-Smith
URL: http://learndiscoverer.com
Blog: http://learndiscoverer.blogspot.com -
Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?
Hi All,
I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
2 REFRESH ON DEMAND
3 WITH PRIMARY KEY
4 AS
5 SELECT name,id
6 FROM syn_t;
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
2 WITH PRIMARY KEY
3 (name)
4 INCLUDING NEW VALUES;
Materialized view log created.
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
REFRESH ON DEMAND
WITH PRIMARY KEY
AS
2 3 4 5 SELECT name,id
FROM syn_t; 6
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
WITH PRIMARY KEY
(name)
INCLUDING NEW VALUES; 2 3 4
CREATE MATERIALIZED VIEW LOG ON MV_t
ERROR at line 1:
ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
Message was edited by:
Avinash Tripathi
nullHi Nicloei,
Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
Regards
Avinash -
Problem while creating sales order
Hi
We are facing a problem while creating a sales order in R/3. The sales order number is getting generated. But we are not able to view the same in the backend meaning it is not there in the database. Any inputs would be of help.
regs
SteveHi everybody,
I've got a problem with this too. I use the BAPI_SALESORDER_CREATEFROMDAT2 with BAPI_TRANSACTION_COMMIT and the webdynpro shows me the document number created in R3 with a Success message. But when I go to R3 and try to display the created sales order, it doesn't exists. So... Maybe I'm doing something wrong with the BAPI_TRANSACTION_COMMIT. ¿Can anybody help me with this?
The code I use is this:
When the user pushes the SAVE button in the WebDynpro, this code executes:
//@@begin onActionSave(ServerEvent)
wdThis.wdGetSOCreaCustController().executeBapi_Salesorder_Createfromdat2();
wdThis.wdGetSOCreaCustController().executeBapi_Transaction_Commit();
//@@end
In the custom Controller I've got the code for those executions:
public void executeBapi_Salesorder_Createfromdat2( )
//@@begin executeBapi_Salesorder_Createfromdat2()
try {
wdContext.currentBapi_Salesorder_Createfromdat2Element().modelObject().execute();
catch (Exception ex) {
wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
wdContext.nodeOutput().invalidate();
//@@end
public void executeBapi_Transaction_Commit( )
try {
wdContext.currentBapi_Transaction_CommitElement().modelObject().execute();
catch (Exception ex) {
wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
wdContext.nodeOutput().invalidate();
//@@end
¿Is something wrong? ¿Is something missing? -
Error while creating parameterise view
I m getting below error while creating parameterise view
CREATE OR REPLACE VIEW rdr_le_info_view (v_run_number , v_isin_cob )
AS
SELECT l.strategic_le
,cun.ucn cunucn
,cun.date
,cccs.ucn ucn
,cccs.agr_num
FROM strat_le l
,ucn_name cun
,customer_setup cccs
WHERE l.gfa_until_dt = '31-dec-9999'
AND l.glas_until_dt = '31-dec-9999'
AND l.int_until_dt = '31-dec-9999'
AND cccs.run_num = v_run_num
AND cccs.ucn_lead_office = cun.ucn
AND cun.OID = l.client_oid;
AND cccs.run_num = v_run_num
ERROR at line 13:
ORA-00904: "V_RUN_NUM": invalid identifier
Plese help me in above.Try
CREATE OR REPLACE VIEW rdr_le_info_view
AS
SELECT l.strategic_le
,cun.ucn cunucn
,cun.date
,cccs.ucn ucn
,cccs.agr_num
FROM strat_le l
,ucn_name cun
,customer_setup cccs
,cccs.run_num run_num
WHERE l.gfa_until_dt = '31-dec-9999'
AND l.glas_until_dt = '31-dec-9999'
AND l.int_until_dt = '31-dec-9999'
AND cccs.ucn_lead_office = cun.ucn
AND cun.OID = l.client_oid;Then call it like:
select *
from rdr_le_info_view
where run_num = v_run_num; -
Error While Creating Materialized View
Hello,
I am getting error ORA-22818: subquery expressions not allowed here while creating materialized view. I am using Oracle9i Enterprise Edition Release 9.2.0.1.0. Below pasted is my SQL Script.
Any help is highly appreciable.
Thanks
*********SQL************
select distinct(id),NAME,(select count(GRADE) from employees where
nationality like '%US%'and id=a.organization_id and grade=a.grade
group by ID,GRADE) US,(select count(GRADE) from employees where
nationality not like '%US%' and organization_id=a.organization_id and grade=a.grade
group by ORGANIZATION_ID,GRADE) NON_US,grade from employees a
where grade is not null
group by GRADE,ID,name
order by to_number(grade) descHi,
This is a documented restriction on MVs. You cannot have a scalar express (i.e a select statement) in the select list.
You can get round this by joining your select count(grade).. expression in as an inline view in your FROM clause. Or you can create a normal view without the scalar expression, create your MV as a select from this view, then re-define your view to contain the query you want.
Hope that helps,
Rod West -
Error while creating Materialized View step 3 of 6 using wizard
have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
Statement:----------------
/*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
Stack Trace:----------------
ORA-00942: table or view does not exist.
ORA-02063: preceding line from masterdbname.
All parameters for replication are correct.
Please help me early.
ThanksHello,
In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
Regards, -
Error while creating Materialized View step 3 of 6
I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
Statement:----------------
/*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
Stack Trace:----------------
ORA-00942: table or view does not exist.
ORA-02063: preceding line from masterdbname.
All parameters for replication are correct.
Please help me early.
ThanksHello,
In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
Regards, -
Problem: While creating a project in iDVD, it plays perfectly on the computer, but after burning the sound is off. Video soundtrack is not in the right place. HELP!
Have you checked out the topics at the right in the More Like This section?
OT -
Hi all, i'm new to Mac book & Xcode. I'm learning and facing problems while creating a new file for Xcode. Before i upgrade the software, i have no issue to create simple steps in apps. After upgrade Xcode to 4.6 version, i'm facing lot's of issue eg.
1) "the identity "iphone developer" doesn't match any valid certificate/ private key pair",
2) can't select the box "with XIB for user interface" if the subclass is "UIViewController"..
Appreciate for any help rendered.Mikko777 wrote:So what is the best?
I wouldn't judge. I've been to Arch for a week, you know? But as said, it's VERY close to it.
What I dislike after a week is makepkg not handling dependencies automatically (which would be overhead, so probably not appropriate).
Mikko777 wrote:Also theres KDEmod for modular kde, dunno if its for 64 bits tho.
Don't actually need that as said ... I see no real benefit of having that other than not beeing a KDE user or having Gentoos useflags.
Mikko777 wrote:PS:You produce a lot of text and welcome smile
Yeah. Wonder why I'm still employed? So do I ...
Maybe you are looking for
-
How to use a different port in RMI
Hi , We cannot use default port 1099 in RMI due to some restrictions. I want to user port: 8000 instead. Can some one please help how to use a different port? Thanks Arun
-
HT5655 I installed latest Adobe Flash Player BUT Safari still says its blocked out of date!
anyone has any solutions?
-
Track Shipments in Mail add More services
Through the "data detectors" coded into OS X , Safari and Mail is able to detect a tracking number from USPS, UPS, and FedEx. I wonder if I can add more Postal Office like DHL, china post, Argentina post,etc to track the shipments. Thanks.
-
I am trying to reset my AppleID password and when clicking on 'send new password via email' iTunes comes back with, that a new password has been sent. However, when I am going into my email account, there is no email from iTunes. Tried this about 10
-
Can't plug my blackberry pearl on my computer with USB, supplied software is useless
I installed version 4.5 and 4.6 but it still doesn't work. When I plug my device to the computer using USB , the computer prompts it doesn't recognize the device.