Create or replace force view

Back again - cleanup did not fix. Why am I getting 'missing keyword' error?
Thanks for your eyes!
Alexandra
code
CREATE OR REPLACE FORCE VIEW "DISC_AUTH_ECR_VW" ("DISC_AUTH_ID", "DISC_DT", "REQUESTOR", "BRANDING", "REASON", "WU_COST_DT", "DC_RECEIVED_DT", "RUNOUT_TYPE", "STOCK_DISPO", "INV_ADJ_CODE", "INVOICE_CUSTO", "INVOICE_CMNT", "CUST_BILLTO", "BILL_TO_STATUS", "CUST_NAME", "CUST_PHONE", "CUST_EMAIL", "FINAL_DISPO_DT", "CNTRLR_DT", "CNTRLR_SIG", "SM_DT", "SM_SIG", "RELEASE_TO_ECR", "REJECT_RSN", "SHELF_LIFE", "QTY_OH", "ITEM_COST", "FINAL_CUST_COST", "GRAND_TOT_CMPNTS_FG", "GRAND_TOT_FINAL_CUSTO", "ITEM_LVL_RI", "ITEM_LVL_PKG", "ITEM_LVL_BL", "ITEM_LVL_SUB_ASSY", "ITEM_LVL_FG", "RO_TYPE_SUMMARY", "DISCNO", "PL_NAME", "DTRMN_WO_DESCR", "CUST_OTHER_STREET", "CUST_OTHER_CITY", "CUST_OTHER_STATE", "CUST_OTHER_ZIP", "CURRENT_DISCNO", "ECR_FORM_ID", "ECRNO")
select
cast("DOC_DISC_AUTHORIZATION"."DISC_AUTH_ID" as number(6,0)) AS "DISC_AUTH_ID",
cast("DOC_DISC_AUTHORIZATION"."DISC_DT" as varchar2(15)) AS "DISC_DT",
cast("DOC_DISC_AUTHORIZATION"."REQUESTOR" as varchar2(30)) AS "REQUESTOR",
cast("DOC_DISC_AUTHORIZATION"."BRANDING" as varchar2(30)) AS "BRANDING",
cast("DOC_DISC_AUTHORIZATION"."REASON" as varchar2(1000)) AS "REASON",
cast("DOC_DISC_AUTHORIZATION"."WU_COST_DT" as varchar2(15)) AS "WI_COST_DT",
cast("DOC_DISC_AUTHORIZATION"."DC_RECEIVED_DT" as varchar2(15)) AS "DC_RECEIVED_DT",
cast("DOC_DISC_AUTHORIZATION"."RUNOUT_TYPE" as varchar2(30) AS "RUNOUT_TYPE",
cast("DOC_DISC_AUTHORIZATION"."STOCK_DISPO" as varchar2(30)) AS "STOCK_DISPO",
cast("DOC_DISC_AUTHORIZATION"."INV_ADJ_CODE" as varchar2(30)) AS "INV_ADJ_CODE",
cast("DOC_DISC_AUTHORIZATION"."INVOICE_CUSTO" as varchar2(30)) AS "INVOICE_CUSTO",
cast("DOC_DISC_AUTHORIZATION"."INVOICE_CMNT" as varchar2(2000)) AS "INVOICE_CMNT",
cast("DOC_DISC_AUTHORIZATION"."CUST_BILLTO" as varchar2(30)) AS "CUST_BILLTO",
cast("DOC_DISC_AUTHORIZATION"."BILL_TO_STATUS" as varchar2(30)) AS "BILL_TO_STATUS",
cast("DOC_DISC_AUTHORIZATION"."CUST_NAME" as varchar2(100)) AS "CUST_NAME",
cast("DOC_DISC_AUTHORIZATION"."CUST_PHONE" as varchar2(30)) AS "CUST_PHONE",
cast("DOC_DISC_AUTHORIZATION"."CUST_EMAIL" as varchar2(100)) AS "CUST_EMAIL",
cast("DOC_DISC_AUTHORIZATION"."FINAL_DISPO_DT" as varchar2(15)) AS "FINAL_DISPO",
cast("DOC_DISC_AUTHORIZATION"."CNTRLR_DT" as varchar2(15)) AS "CNTRLR_DT",
cast("DOC_DISC_AUTHORIZATION"."CNTRLR_SIG" as varchar2(10)) AS "CNTRLR_SIG",
cast("DOC_DISC_AUTHORIZATION"."SM_DT" as varchar2(15)) AS "SM_DT",
cast("DOC_DISC_AUTHORIZATION"."SM_SIG" as varchar2(10)) AS "SM_SIG",
cast("DOC_DISC_AUTHORIZATION"."RELEASE_TO_ECR" as varchar2(30)) AS "RELEASE_TO_ECR",
cast("DOC_DISC_AUTHORIZATION"."REJECT_RSN" as varchar2(4000)) AS "REJECT_RSN",
cast("DOC_DISC_AUTHORIZATION"."SHELF_LIFE" as varchar2(30)) AS "SHELF_LIFE",
cast("DOC_DISC_AUTHORIZATION"."QTY_OH" as number(10,4)) AS "QTY_OH",
cast("DOC_DISC_AUTHORIZATION"."ITEM_COST" as number(10,4)) AS "ITEM_COST",
cast("DOC_DISC_AUTHORIZATION"."FINAL_CUST_COST" as number(10,4)) AS "FINAL_CUST_COST",
cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_CMPNTS_FG" as number(10,4)) AS "GRAND_TOT_CMPNTS_FG",
cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_FINAL_CUSTO" as number(10,4)) AS "GRAND_TOT_FINAL_CUSTO",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_RI" as varchar2(30)) AS "ITEM_LVL_RI",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_PKG" as varchar2(30)) AS "ITEM_LVL_PKG",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_BL" as varchar2(30)) AS "ITEM_LVL_BL",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_SUB_ASSY" as varchar2(30)) AS "ITEM_LVL_SUB_ASSY",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_FG" as varchar2(30)) AS "ITEM_LVL_FG",
cast("DOC_DISC_AUTHORIZATION"."RO_TYPE_SUMMARY" as varchar2(1000)) AS "RO_TYPE_SUMMARY",
cast("DOC_DISC_AUTHORIZATION"."DISCNO" as varchar2(30)) AS "DISCNO",
cast("DOC_DISC_AUTHORIZATION"."PL_NAME" as varchar2(100)) AS "PL_NAME",
cast("DOC_DISC_AUTHORIZATION"."DTRMN_WO_DESCR" as varchar2(30)) AS "DTRMN_WO_DESCR",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STREET" as varchar2(100)) AS "CUST_OTHER_STREET",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_CITY" as varchar2(30)) AS "CUST_OTHER_CITY",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STATE" as varchar2(10)) AS "CUST_OTHER_STATE",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_ZIP" as varchar2(15)) AS "CUST_OTHER_ZIP",
cast("DOC_DISC_AUTHORIZATION"."CURRENT_DISCNO" as varchar2(10)) AS "CURRENT_DISCNO",
cast("DOC_ECR_FORM"."ECR_FORM_ID" as varchar2(10)) AS "ECR_FORM_ID",
cast("DOC_ECR_FORM"."ECRNO" as varchar2(10)) AS "ECRNO"
FROM "DOC_DISC_AUTHORIZATION" "DOC_DISC_AUTHORIZATION", "DOC_ECR_FORM" "DOC_ECR_FORM"
WHERE "DOC_DISC_AUTHORIZATION"."ECR_FORM_ID" = "DOC_ECR_FORM"."ECR_FORM_ID"
/code
Edited by: userRRRYB on Aug 22, 2012 8:51 PM

Here it is in full working form. It's always good to have a second set of eyes and a great boss.
code/
CREATE OR REPLACE FORCE VIEW "DISC_AUTH_ECR_VW" ("DISC_AUTH_ID", "DISC_DT", "REQUESTOR", "BRANDING", "REASON", "WU_COST_DT", "DC_RECEIVED_DT", "RUNOUT_TYPE", "STOCK_DISPO", "INV_ADJ_CODE", "INVOICE_CUSTO", "INVOICE_CMNT", "CUST_BILLTO", "BILL_TO_STATUS", "CUST_NAME", "CUST_PHONE", "CUST_EMAIL", "FINAL_DISPO_DT", "CNTRLR_DT", "CNTRLR_SIG", "SM_DT", "SM_SIG", "RELEASE_TO_ECR", "REJECT_RSN", "SHELF_LIFE", "QTY_OH", "ITEM_COST", "FINAL_CUST_COST", "GRAND_TOT_CMPNTS_FG", "GRAND_TOT_FINAL_CUSTO", "ITEM_LVL_RI", "ITEM_LVL_PKG", "ITEM_LVL_BL", "ITEM_LVL_SUB_ASSY", "ITEM_LVL_FG", "RO_TYPE_SUMMARY", "DISCNO", "PL_NAME", "DTRMN_WO_DESCR", "CUST_OTHER_STREET", "CUST_OTHER_CITY", "CUST_OTHER_STATE", "CUST_OTHER_ZIP", "CURRENT_DISCNO", "ECR_FORM_ID", "ECRNO") AS
select
cast("DOC_DISC_AUTHORIZATION"."DISC_AUTH_ID" as number(6,0)) AS "DISC_AUTH_ID",
cast("DOC_DISC_AUTHORIZATION"."DISC_DT" as varchar2(15)) AS "DISC_DT",
cast("DOC_DISC_AUTHORIZATION"."REQUESTOR" as varchar2(30)) AS "REQUESTOR",
cast("DOC_DISC_AUTHORIZATION"."BRANDING" as varchar2(30)) AS "BRANDING",
cast("DOC_DISC_AUTHORIZATION"."REASON" as varchar2(1000)) AS "REASON",
cast("DOC_DISC_AUTHORIZATION"."WU_COST_DT" as varchar2(15)) AS "WI_COST_DT",
cast("DOC_DISC_AUTHORIZATION"."DC_RECEIVED_DT" as varchar2(15)) AS "DC_RECEIVED_DT",
cast("DOC_DISC_AUTHORIZATION"."RUNOUT_TYPE" as varchar2(30)) AS "RUNOUT_TYPE",
cast("DOC_DISC_AUTHORIZATION"."STOCK_DISPO" as varchar2(30)) AS "STOCK_DISPO",
cast("DOC_DISC_AUTHORIZATION"."INV_ADJ_CODE" as varchar2(30)) AS "INV_ADJ_CODE",
cast("DOC_DISC_AUTHORIZATION"."INVOICE_CUSTO" as varchar2(30)) AS "INVOICE_CUSTO",
cast("DOC_DISC_AUTHORIZATION"."INVOICE_CMNT" as varchar2(2000)) AS "INVOICE_CMNT",
cast("DOC_DISC_AUTHORIZATION"."CUST_BILLTO" as varchar2(30)) AS "CUST_BILLTO",
cast("DOC_DISC_AUTHORIZATION"."BILL_TO_STATUS" as varchar2(30)) AS "BILL_TO_STATUS",
cast("DOC_DISC_AUTHORIZATION"."CUST_NAME" as varchar2(100)) AS "CUST_NAME",
cast("DOC_DISC_AUTHORIZATION"."CUST_PHONE" as varchar2(30)) AS "CUST_PHONE",
cast("DOC_DISC_AUTHORIZATION"."CUST_EMAIL" as varchar2(100)) AS "CUST_EMAIL",
cast("DOC_DISC_AUTHORIZATION"."FINAL_DISPO_DT" as varchar2(15)) AS "FINAL_DISPO",
cast("DOC_DISC_AUTHORIZATION"."CNTRLR_DT" as varchar2(15)) AS "CNTRLR_DT",
cast("DOC_DISC_AUTHORIZATION"."CNTRLR_SIG" as varchar2(10)) AS "CNTRLR_SIG",
cast("DOC_DISC_AUTHORIZATION"."SM_DT" as varchar2(15)) AS "SM_DT",
cast("DOC_DISC_AUTHORIZATION"."SM_SIG" as varchar2(10)) AS "SM_SIG",
cast("DOC_DISC_AUTHORIZATION"."RELEASE_TO_ECR" as varchar2(30)) AS "RELEASE_TO_ECR",
cast("DOC_DISC_AUTHORIZATION"."REJECT_RSN" as varchar2(4000)) AS "REJECT_RSN",
cast("DOC_DISC_AUTHORIZATION"."SHELF_LIFE" as varchar2(30)) AS "SHELF_LIFE",
cast("DOC_DISC_AUTHORIZATION"."QTY_OH" as number(10,4)) AS "QTY_OH",
cast("DOC_DISC_AUTHORIZATION"."ITEM_COST" as number(10,4)) AS "ITEM_COST",
cast("DOC_DISC_AUTHORIZATION"."FINAL_CUST_COST" as number(10,4)) AS "FINAL_CUST_COST",
cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_CMPNTS_FG" as number(10,4)) AS "GRAND_TOT_CMPNTS_FG",
cast("DOC_DISC_AUTHORIZATION"."GRAND_TOT_FINAL_CUSTO" as number(10,4)) AS "GRAND_TOT_FINAL_CUSTO",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_RI" as varchar2(30)) AS "ITEM_LVL_RI",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_PKG" as varchar2(30)) AS "ITEM_LVL_PKG",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_BL" as varchar2(30)) AS "ITEM_LVL_BL",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_SUB_ASSY" as varchar2(30)) AS "ITEM_LVL_SUB_ASSY",
cast("DOC_DISC_AUTHORIZATION"."ITEM_LVL_FG" as varchar2(30)) AS "ITEM_LVL_FG",
cast("DOC_DISC_AUTHORIZATION"."RO_TYPE_SUMMARY" as varchar2(1000)) AS "RO_TYPE_SUMMARY",
cast("DOC_DISC_AUTHORIZATION"."DISCNO" as varchar2(30)) AS "DISCNO",
cast("DOC_DISC_AUTHORIZATION"."PL_NAME" as varchar2(100)) AS "PL_NAME",
cast("DOC_DISC_AUTHORIZATION"."DTRMN_WO_DESCR" as varchar2(30)) AS "DTRMN_WO_DESCR",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STREET" as varchar2(100)) AS "CUST_OTHER_STREET",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_CITY" as varchar2(30)) AS "CUST_OTHER_CITY",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_STATE" as varchar2(10)) AS "CUST_OTHER_STATE",
cast("DOC_DISC_AUTHORIZATION"."CUST_OTHER_ZIP" as varchar2(15)) AS "CUST_OTHER_ZIP",
cast("DOC_DISC_AUTHORIZATION"."CURRENT_DISCNO" as varchar2(10)) AS "CURRENT_DISCNO",
cast("DOC_ECR_FORM"."ECR_FORM_ID" as varchar2(10)) AS "ECR_FORM_ID",
cast("DOC_ECR_FORM"."ECRNO" as varchar2(10)) AS "ECRNO"
FROM "DOC_DISC_AUTHORIZATION" "DOC_DISC_AUTHORIZATION", "DOC_ECR_FORM" "DOC_ECR_FORM"
WHERE "DOC_DISC_AUTHORIZATION"."ECR_FORM_ID" = "DOC_ECR_FORM"."ECR_FORM_ID"
/code

Similar Messages

  • Force view

    Hello Guys,
    Can you tell me what is the use of view when we create with FORCE option if underliying table is not available ?
    CREATE OR REPLACE FORCE VIEW MY_VIEW AS SELECT * FROM EMP;
    Now View My_View will be created even if the emp table is not available. But where we can use this view ?. What is the applicatin of My_View when we know that EMP table is not available ?.
    Thanking you.

    Simple demonstration...
    SQL> create or replace view my_view as select * from empdept;
    create or replace view my_view as select * from empdept
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> create or replace force view my_view as select * from empdept;
    Warning: View created with compilation errors.
    SQL> select * from my_view;
    select * from my_view
    ERROR at line 1:
    ORA-04063: view "SCOTT.MY_VIEW" has errors
    SQL> create table empdept as select ename, deptno from emp;
    Table created.
    SQL> select * from my_view;
    ENAME          DEPTNO
    SMITH              20
    ALLEN              30
    WARD
    JONES              20
    MARTIN             30
    BLAKE
    CLARK              10
    SCOTT              20
    KING               10
    TURNER             30
    ADAMS              20
    JAMES              30
    FORD               20
    MILLER             10
    14 rows selected.
    SQL>

  • Create Force View

    Hi all,
    When I import the dumpfile I get the follwing errors...
    IMP-00041: Warning: object created with compilation warnings
    "CREATE FORCE VIEW "uni"."V_F_OFS_REQUEST_DETAIL" "
    " ("RECID","XMLRECORD","APPLICATION","NAPPLICATION","VERSION","NVERSION","F"
    "UNCTION","NFUNCTION","TRANS_REFERENCE","NTRANS_REFERENCE","USER_NAME","NUSE"
    "R_NAME","COMPANY","NCOMPANY","DATE_TIME_RECD","NDATE_TIME_RECD","DATE_TIME_"
    "QUEUE","NDATE_TIME_QUEUE","DATE_TIME_PROC","NDATE_TIME_PROC","STATUS","NSTA"
    "TUS","MSG_IN","NMSG_IN","MSG_OUT","NMSG_OUT","ACTION","NACTION","GTS_CONTRO"
    "L","NGTS_CONTROL","NO_OF_AUTH","NNO_OF_AUTH") AS "
    "SELECT x.RECID, x.XMLRECORD.getClobVal() "XMLRECORD""
    ",NVL(extractValue(x.xmlrecord,'/row/c1'),'^A') "APPLICATION",NVL(NUMCAST(ex"
    "tractValue(x.xmlrecord,'/row/c1')),0) "nAPPLICATION",NVL(extractValue(x.xml"
    "record,'/row/c2'),'^A') "VERSION",NVL(NUMCAST(extractValue(x.xmlrecord,'/ro"
    "w/c2')),0) "nVERSION",NVL(extractValue(x.xmlrecord,'/row/c3'),'^A') "FUNCTI"
    "ON",NVL(NUMCAST(extractValue(x.xmlrecord,'/row/c3')),0) "nFUNCTION",NVL(ext"
    "ractValue(x.xmlrecord,'/row/c4'),'^A') "TRANS_REFERENCE",NVL(NUMCAST(extrac"
    "tValue(x.xmlrecord,'/row/c4')),0) "nTRANS_REFERENCE",NVL(extractValue(x.xml"
    "record,'/row/c5'),'^A') "USER_NAME",NVL(NUMCAST(extractValue(x.xmlrecord,'/"
    "row/c5')),0) "nUSER_NAME",NVL(extractValue(x.xmlrecord,'/row/c6'),'^A') "CO"
    "MPANY",NVL(NUMCAST(extractValue(x.xmlrecord,'/row/c6')),0) "nCOMPANY",NVL(e"
    How to overcome this? and how to avoid this? Pls suggest me
    Thanks in advance..

    Yes, force view command never gives an error, its always a warning. And if you are getting this error during import, dont worry, view have been created in your schema by import command. This might happen when view is refers to any table that actually is not present. In your case it might be a case when view in the current schema refers table in another schema. So i think you should just try to query that view in the schema where you have just done the import.
    Also to verify that why error came, you can go to the source schema and check for the base table of the view under consideration. From there you can get useful information about the actual base table and why import showing up the warning.

  • Replace Materialized View with Flashback?

    I'm building a Data Warehouse with the following:
    1. Tables populated throughout the day using CDC from the Application DB
    2. MVs on those tables to keep a daily snapshot of the tables for reporting.
    3. End users access the data through views with VPD applied, on the MVs
    My systems team would like the solution to use as little storage as possible and currently I effectively have a copy of the app DB in the DW tables and would need another copy in the Daily MVs. (It is an insurance DB, so it is complex with lots of data, > 1.5 TB)
    One way to reduce the storage could be to use flashback to keep a static daily version of the tables, so
    At midnight I'd recreate the views like:
    CREATE OR REPLACE VIEW client
    AS SELECT *
       FROM   client_tab
       AS OF TIMESTAMP (TO_TIMESTAMP(TRUNC(SYSDATE)));This would replace my refresh MV script. The end users would then refer to the client view in their reports
    We would obviously need enough undo to store a days worth of data to ensure the flashback views remain consistent, but this is much less than the space required for a full copy. On a busy day there would be about 1% data change.
    No DDL will occur on the tables during the day
    Is there anything else I should be aware of? Can you let me know if (and why) this would not be a good idea?
    This will run on Oracle 11.2.0.1
    Thanks,
    Ben

    I guess I'm having some trouble visualizing the basic data model...
    In most data warehouses that I've seen in the financial industry, reporting the position/ balance/ etc. at a given date involves scanning a single daily partition of each fact table involved and then hitting dimension tables that may or may not be partitioned (slowly changing dimensions would often have effective and expiration date columns to store the range of time a row was valid for, for example). Year-over-year reporting, then, just has to scan two fact table partitions-- the one for today and the one for a year ago. You may not store every intermediate change if there are potentially hundreds of transactions per account per day, but you'd generally put the end state for a given day in a single partition.
    In one of your updates, it sounded like the 1.5 TB of data was just for the data that constituted end-of-day yesterday plus the 1% of changes made today which would imply that there was at least 15 GB of UNDO generated every day that would need to be applied to make flashback query work. That quantity of UNDO would make me pretty concerned from a performance perspective.
    I would also tend to wager that VPD policies applied to views that are doing flashback query would be problematic. I haven't tried it and haven't really worked through all the testing scenarios in my mind, but I would be somewhat surprised if that didn't introduce some sort of hurdle that you'd have to work through/ work around.
    Justin

  • Create sequence, function and view all at once -script or something similar

    Hi I would like to know in what way can I write a script or something like that which would define names for a sequence, function and a view in the beginning (for example TEST_SEQ, TEST_FJ, TEST_VIEW...) and after that create this sequence, function and view with definitions like
    CREATE SEQUENCE  TEST_SEQ
    MINVALUE 1 MAXVALUE 999999999999999999999999999
    INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE;
    create or replace FUNCTION TEST_FJ RETURN NUMBER AS
    tmp number;
    BEGIN
    select TEST_SEQ.NEXTVAL  into tmp from dual
    RETURN tmp;
    END TEST_FJ;
    and so on...
    In the end I would also like to grant some rights on these objects I just created:
    grant select on TEST_SEQ to public;
    grant execute on TEST_FJ to public;
    So my question is how to package all these things together so I can execute them from a single file in SQL Developer, and if i need to change the names of these tables I want do it in one place in the beginning of this script (or something like a script, I'm not sure what)...
    Thanks in advance!

    hi,
    hope help you...
    this is my basic generic solution...
    create or replace procedure createSequence( psequenceName in varchar2 ) is
    begin
    execute immediate 'create sequence ' || psequenceName ;
    execute immediate 'grant select on ' || psequenceName || ' to public ';
    end ;
    create or replace function getNextVal( psequenceName in varchar2 ) return number is
    queryText varchar2(100) := 'select <sequence_name>.nextval into :next_value from DUAL' ;
    next_value number ;
    begin
    queryText := replace(queryText,'<sequence_name>',psequenceName);
    execute immediate queryText into next_value ;
    return( next_value ) ;
    end ;
    Edited by: edogt on Nov 27, 2008 5:33 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM

  • Reg: Force View

    Kindly let me know in what situation force view created apart from doesn't have base table

    http://tinyurl.com/yhp92vm

  • Replace standard view with alternative view

    Hi Gurus,
    In CRM 5.0 we were able to replace a view with a different view (whether it was SAP standard or bespoke) by adding the appropriate substition controller details in the Runtime Framework Profile.
    We are now trying to do the same in CRM 2007 but we have not been successful.  I have gone into the SPRO entry "Maintain Runtime Framework Profile" and created "Z_RUNTIME" which is called in the Business Role.  It is set up with the following Work Area Definition:
    Application: BSPWD_BASICS
    View Set Name: WorkAreaHostViewSet
    View Area Name: WorkAreaView
    I have tried to replace the following controller as a test to change the standard view:
    BSP Application: ICCMP_BT_TIMERC
    Controller To Be Replaced: SrvTTimeRep
    BSP Application: IC_KNOWS_SEARCH
    Replacement Controller: MainWindow
    This hasnt worked, the view SrvTTimeRep still showed. 
    Just to reiterate, I'm not trying to enhance a view, I am trying to replace it with a totally different one.
    Any help offered is greatly appreciated, and will be reqarded with points!  Thanks in advance!
    Andrew G.

    Andrew,
    The difference is in CRM 2007 is that you don't modify the runtime framework profile globally.  Instead each application has concept of a component repository.xml that needs to be adjusted.  You actually need to enhance each component where you want to include the view into the viewset.  This will then create a Z-component repository of enhancements for the application, including a copy of the respository.xml file.  You then adjust the repository.xml using the tools provided to replace adjust the viewset defintion.  Now if your view lives in another component you will also have to define the proper component usages to use the view.
    I would recommend downloading or getting access to the CRM 2007 OKP materials or taking the CRM UI class which has an example of this method in further detail.
    Take care,
    Stephen

  • Create Or Replace Function Error

    Hello,
    I'm doing text mining using Oracle SQL Developer: ODMiner.. I imported the data "WEBLOG" into a table.. This weblog data consist of users activity, date, time, url, etc. The first step I took was to use a function to transform date and time that I have in the data table, into a number representing the 40 mins since 01-01-1990. I did this by dividing it by 2400 (seconds in 40 mins). The main purpose is to have a time frame for the sessions.
    I used the following code,
    CREATE OR REPLACE FUNCTION ssnDate(
    DATE IN VARCHAR2 DEFAULT 03-01-18,
    TIME IN VARCHAR2
    ) RETURN NUMBER
    AS
    BEGIN
    RETURN TRUNC((to_date(DATE||' '||TIME, 'DD-MM-YY HH:MM:SS')- to_date('01-JAN-1990','DD-MON-YYYY')) * (86400/2400);
    END ssnDate;
    This was what appeared in the log after running the statement,
    FUNCTION ssnDate compiled
    Warning: execution completed with warning
    After this, I tried to create a VIEW to transform the DATE and TIME with the ssnDate that was created earlier on, and concatenate the CS_URI_STEM (which is the resource accessed), and CS_URI_QUERY (which is the the query, if any, the client was trying to perform)into a new field called WEB_LINK.
    This is the code used,
    CREATE OR REPLACE VIEW WEBLOG_VIEWS("C_IP", "WEB_LINK", "CS_USER_AGENT", "SESSION")
    AS
    SELECT ssnDate(LOG_DATE, LOG_TIME) AS 'SESSION',
    C_IP,
    CS_USER_AGENT,
    (CS_URI_STEM||'?'||CS_URI_QUERY) AS WEB_LINK
    FROM WEBLOG;
    Now from this I got the following error..
    Error starting at line 1 in command:
    CREATE OR REPLACE VIEW WEBLOG_VIEWS("C_IP", "WEB_LINK", "CS_USER_AGENT", "SESSION")
    AS
    SELECT ssnDate(LOG_DATE, LOG_TIME) AS 'SESSION',
    C_IP,
    CS_USER_AGENT,
    (CS_URI_STEM||'?'||CS_URI_QUERY) AS WEB_LINK
    FROM WEBLOG
    Error at Command Line:3 Column:38
    Error report:
    SQL Error: ORA-00923: FROM keyword not found where expected
    00923. 00000 - "FROM keyword not found where expected"
    *Cause:
    *Action:
    I don't get where I'm going wrong with this.. This is the data preparation stage which requires me to prep the data before applying modeling techniques or algorithms.. The next step would be grouping the data, based on the session time, ip and the user agent of each session along with the web_links fields visited by the user in that session.
    I would really be grateful for any inputs on where I'm going wrong and any solutions for that!

    Ok, not sure I really understand, but I posted the query and this is the output I got..
    ORA-31603: object "WEBLOG" of type TABLE not found in schema "WEBLOG_TABLE_OWNER_NAME"
    ORA-06512: at "SYS.DBMS_METADATA", line 2625
    ORA-06512: at "SYS.DBMS_METADATA", line 2668
    ORA-06512: at "SYS.DBMS_METADATA", line 2983
    ORA-06512: at "SYS.DBMS_METADATA", line 3897
    ORA-06512: at "SYS.DBMS_METADATA", line 5678
    ORA-06512: at line 1
    31603. 00000 - "object \"%s\" of type %s not found in schema \"%s\""
    *Cause:    The specified object was not found in the database.
    *Action:   Correct the object specification and try the call again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • CREATE OR REPLACE PROCEDURE return data like SELECT statement

    "SELECT * FROM SEARCH_KEYWORD" is successfully done and return the data of the tables. Now, I want to run that on server side using PROCEDURE.
    I successfully executed the below scripts. Please teach me how to call the sp_test procedure. OR if you have other way or maybe my scripts are wrong.
    CREATE OR REPLACE PACKAGE GLOBALPKG
    AS
         TYPE RCT1 IS REF CURSOR;
         TRANCOUNT INTEGER := 0;
         IDENTITY INTEGER;
    END;
    CREATE OR REPLACE PROCEDURE LPG.sp_test
         RCT1 IN OUT      GLOBALPKG.RCT1
    AS
    BEGIN
         OPEN RCT1 FOR
         SELECT *
         FROM SEARCH_KEYWORD;
    END;
    Here is my table definition:
    CREATE TABLE LPG.SEARCH_KEYWORD
    FRACTION VARCHAR2(50),
    KEYWORD VARCHAR2(50),
    PURPOSE VARCHAR2(50),
    REMARKS VARCHAR2(50),
    DATE_INSERTED DATE DEFAULT sysdate
    PCTFREE 10
    PCTUSED 40
    MAXTRANS 255
    TABLESPACE SYSTEM
    STORAGE(INITIAL 64K MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    NOCACHE
    LOGGING
    Eros
    Japan

    Wrong forum. You should ask this question in the SQL and PL/SQL forum.
    Couple of comments though. Oracle is not SQL-Server. So calling a procedure that returns a ref cursor is different from a T-SQL macro procedure that functions like a view.
    Also, there is no need to use the SQL-Server standard (and silly one at that) of prefixing stored procedures using the text "sp_". In fact, the whole concept of Hungarian-like notation is something of the past and has no place in today's paradigm of software engineering.
    As for calling a a proc that returns a ref cursor, from SQL*Plus it will look as follows:
    SQL> var c refcursor
    SQL>
    SQL> exec LPG.sp_test( :c )
    SQL> print c
    Ref cursor needs to be supported by the client language you use to make this call to Oracle.

  • Create or replace

    Hi friends,
    I know timestamp column in the user objects will change when the parameters in the procedure changes.. But I would like to know will 'create or replace procedure' change the last_ddl_time in user_objects view? I ran 'create or replace procedure' last_ddl_time was updated in test database but not in the production database.. not sure why... any help please
    Thanks so much
    Edited by: newbiegal on Mar 11, 2013 7:01 AM

    Girish Sharma wrote:
    Only create or replace of a procedure do not updates last_ddl_time. Last_ddl_time is only updated on the compilation of procedure; so just try to execute the procedure and now check last_ddl_time.
    A good example at below link :
    http://oraclespin.wordpress.com/tag/last_ddl_time/
    Regards
    Girish SharmaYes, recompilation modify the last_ddl_time.
    Look my example:
    Create a new procedure:
    SQL> create or replace procedure test_new is
    begin
       dbms_output.put_line('Hello World!');
    end;
    Procedure created.
    SQL> select to_char(created,'dd/mm/yyyy hh24:mi:ss'), to_char(last_ddl_time,'dd/mm/yyyy hh24:mi:ss'), timestamp
    from dba_objects
    where owner='SYSTEM'
    and object_name='TEST_NEW';  2    3    4
    TO_CHAR(CREATED,'DD TO_CHAR(LAST_DDL_TI TIMESTAMP
    11/03/2013 15:31:08 11/03/2013 15:31:08 2013-03-11:15:31:08Perform a create or replace :
    SQL> create or replace procedure test_new is
    begin
       dbms_output.put_line('Hello World!');
    end;
    /  2    3    4    5
    Procedure created.
    SQL> select to_char(created,'dd/mm/yyyy hh24:mi:ss'), to_char(last_ddl_time,'dd/mm/yyyy hh24:mi:ss'), timestamp
    from dba_objects
    where owner='SYSTEM'
    and object_name='TEST_NEW';  2    3    4
    TO_CHAR(CREATED,'DD TO_CHAR(LAST_DDL_TI TIMESTAMP
    11/03/2013 15:31:08 11/03/2013 15:31:08 2013-03-11:15:31:08Date is not changed.
    Now perfom an alter:
    SQL> alter procedure TEST_NEW compile;
    Procedure altered.
    SQL> select to_char(created,'dd/mm/yyyy hh24:mi:ss'), to_char(last_ddl_time,'dd/mm/yyyy hh24:mi:ss'), timestamp
    from dba_objects
    where owner='SYSTEM'
    and object_name='TEST_NEW';  2    3    4
    TO_CHAR(CREATED,'DD TO_CHAR(LAST_DDL_TI TIMESTAMP
    11/03/2013 15:31:08 11/03/2013 15:39:35 2013-03-11:15:36:53last_ddl_time is changed.
    Edited by: Mr.D. on 11-mar-2013 7.42

  • Wat is the advantage of force view?

    hello,
    only i know that it is created object in db and after tat we can create the table as per requirement.
    please tell me wat is the main advantage of Force View?
    Tks
    PM

    Hello PM,
    if you have mutual dependencies, e.g. between a package and a view, then you cannot create the view because of an invalid package and you cannot validate the package because the view does not exist.
    A workaround has been to create a dummy view, compile the package and create the actual view. Now you can force Oracle to create the view and then compile the package.
    Regards
    Marcus

  • Uses of force view

    Hi All,
    Can you tell me what are the uses of force view?
    Thanks in advance.

    It's relatively common to find in install scripts (and/or in import & export). If you're going to create dozens of different views which depend on various other views and/or tables, figuring out the proper order to drop and/or create each view and ensuring that the build script is updated with that information every time can be rather painful and tedious. It's much easier to FORCE the creation of the views in some human-reasonable order (i.e. alphabetically) and compile everything at the end.
    Justin

  • Ampersand substitution in create or replace procedure statement

    Hi Guys,
    I wonder why my ampersand substitution does not work in a create or replace stored procedure statement.
    CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
    UNDEFINE DimSales;
    UNDEFINE FactTable;
    DEFINE DimSales = 'TESTTAB';
    DEFINE FactTable = myfact;
    BEGIN
    Error(5,20): PLS-00103: Encountered the symbol "=" when expecting one of the following: := . ( @ % ; not null range default character
    If I then assign the value with := I get the error "invalid table" later on for the INSERT statemnt:
    CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS
    UNDEFINE DimSales;
    UNDEFINE FactTable;
    DEFINE DimSales := 'x2';
    DEFINE FactTable := 'x1';
    BEGIN
    INSERT INTO &DimSales  (column1, column2,...)
    Why does ampersand substitution not work within a stored procedure?

    Hi,
    Thanks for the suggestion.
    The IF---ELSE Logic I have to write is quite complex.
    I dont think joins will not do the trick and limiting the collection size to smaller than 4000 seems not very practical. there
    is no poin using a collection if I have to use X amout of them.
    UNDEFINE DimSALES;
    UNDEFINE FactTable;
    DEFINE DimSALES = 'TESTTAB';
    DEFINE FactTable = 'testfact';
    --Collect all distinct SELLERNr into materialized views
    CREATE MATERIALIZED VIEW v1 AS select distinct SELLERnr from &FactTable;
    CREATE MATERIALIZED VIEW v2 AS select distinct SELLER_ID from &DimSALES;
    DECLARE
    v_SELLERNr VarChar(9);
    CURSOR v1_cursor IS Select * from v1;
    l_exists INTEGER;
    BEGIN
    OPEN v1_cursor;
    LOOP
    FETCH v1_cursor INTO v_SELLERNr;
    EXIT WHEN v1_cursor%NOTFOUND;
    SELECT COUNT(*) INTO l_exists FROM v2 WHERE SELLER_id =v_SELLERNr AND ROWNUM = 1;
    IF l_exists <> 1 THEN
    INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
    (SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr);
    commit;
    ELSE
    --Update old combination(s), invalidate (DATE)
    UPDATE &DimSALES SET VALID_TO = SYSDATE -1 WHERE REG||BVL||DS||VS||RS||SELLERNR||VK IN(
    --In case the SELLER and combinations exists and differs from what is in the dimension then invalidate old combinations and insert new ones
    SELECT * FROM(
    SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &FactTable;
    MINUS
    SELECT REG||BVL||DS||VS||RS||SELLERNR||VK WHERE SELLERNR = v_SELLERNr FROM &DimSALES;)
    commit;
    --Insert new combination
    INSERT INTO &DimSALES (K_SALES,REG,BVL,DS, VS,RS,SELLER_ID,VK,VALID_FROM)
    (SELECT SEQ_DIM_SALES.NEXTVAL ,REG, BVL,DS, VS,RS,SELLERNR,VK,sysdate from &FactTable where SELLERNR =v_SELLERNr) subselect;
    WHERE &DimSALES.SELLER_Id=v_SELLERNr AND subselect.REG||BVL||DS||VS||RS||SELLERNR||VK NOT IN &DimSALES.REG||BVL||DS||VS||RS||SELLERNR||VK
    commit;
    END IF;
    END LOOP;
    CLOSE v1_cursor;
    END;
    DROP MATERIALIZED VIEW v1;
    DROP MATERIALIZED VIEW v2;
    -----------------

  • CREATE OR REPLACE TABLE

    Hi, i need to write a script that re-creates a table. Something similar to CREATE OR REPLACE VIEW. I came up with the following
    DECLARE
       does_not_exist   EXCEPTION;
       PRAGMA EXCEPTION_INIT (does_not_exist, -942);
    BEGIN
       EXECUTE IMMEDIATE 'DROP TABLE foobar';
    EXCEPTION
       WHEN does_not_exist
       THEN
          NULL;
    END;
    CREATE TABLE foobar (c1 INT);I wonder if there's an easier way. Is there?
    TIA, Markus

    Hi, Markus,
    I don't know of anything simpler.
    In SQL*Plus, you can do something that's about as complicated:
    SET     PAGESIZSE     0
    SPOOL     next_step.sql
    SELECT     CASE
              WHEN  ( SELECT  1
                         FROM     user_tables
                   WHERE     table_name     = 'FOOBAR'
              THEN  'DROP TABLE FOOBAR;'
              ELSE  'PROMPT  Table did not exist'
         END
    FROM     dual;
    SPOOL     OFF
    @next_stepAll this supposes you really need something that doesn't raise an error.

  • How create just one Oracle view

    Hi,
    I've table TAB_ID
    COD_ID
    G0DE-0-10047514
    M0DF-1-10000281
    T0DH-3-20500819
    R0DJ-2-10603746
    G0DY-0-20006783
    G0DZ-0-20049734
    G0E0-0-10004325
    G0E1-0-10049593
    A20T-0-EMS00038
    D20T-0-EMS00039
    S20T-0-EMS00041
    M20T-0-EMS00234
    I'd like to creare just one view with this output:
    COD_ID
    10-47514
    10-281
    20-500819
    10-603746
    20-6783
    20-49734
    10-4325
    10-49593
    EMS00038
    EMS00039
    EMS00041
    EMS00234
    If SUBSTR(COD_ID,8) is number THEN substr(COD_ID,1,2)||'-'||
    REPLACE(LTRIM(REPLACE(SUBSTR(COD_ID,3),'0',' ')),' ','0')
    If SUBSTR(COD_ID,8) is alphanumeric THEN SUBSTR(COD_ID,8)
    If I create 2 oracle view seems that I get correct output:
    create or replace view v_cod (cod_id)
    as
    select substr(cod_id,8) cod_id
    from tab_id
    create or replace view v_cod_id (cod_id)
    as
    select substr(COD_ID,1,2)||'-'||
    REPLACE(LTRIM(REPLACE(SUBSTR(COD_ID,3),'0',' ')),' ','0') cod_id
    from v_cod
    where cod_id > '00000000'
    AND cod_id < '99999999'
    union all
    select substr(COD_ID,1,2)||'-'||
    REPLACE(LTRIM(REPLACE(SUBSTR(COD_ID,3),'0',' ')),' ','0') cod_id
    from v_cod
    where COD_ID not between '00000000' and '99999999'
    But I must create Just one view
    Can I create only one Oracle View (from TAB_ID) to get this output?
    Thanks in advance!

    If all your data conforms to the pattern given above then this (warning! untested code ahead) will work:
    CREATE OR REPLACE VIEW just1view AS
    SELECT CASE WHEN SUBSTR(cod_id,8,1) BETWEEN '0' AND '9'
                THEN SUBSTR(cod_id,8,2)||'-'||REPLACE(SUBSTR(cod_id,10),'0',NULL);
                ELSE SUBSTR(cod_id,8) AS cod_id
    FROM   tab_id
    /Otherwise, you'll need to use a slightly more sophisticated format checker. I suggest you look at Re: How to test a variable to determine whether it is a CHARACTER on use of TRANSLATE().
    Cheers, APC

Maybe you are looking for

  • Need to run multiple copies of portal on one machine

    This is a little involved to explain so I'll try to be clear. Right now we have multiple developers working on our single copy of our portal running on one machine at another location. No good can come of this and much bad has already happened. What

  • Ping error in RWB for J2SE Adapter Engine

    Hi, we have several external J2SE adapter engines and they function great other than from a monitoring perspective. In RWB "Ping Status" I'm getting the following: HTTP request failed. Error code: "401". Error message: "Authorization Required" Sugges

  • "Spotify desktop client communication failed."

    Thanks predatorx, such solution was suggested also elsewhere in this community help, but I was not looking for such remedy - probably it would work :) Somewhere I read the FB connect has had a bug in it, related to JS and certain ports. It just might

  • Newbie-help with transitions--ripple dissolve not acting right

    I'm a FCP newbie and having a problem with ripple dissolve. This is what I did: in the TL put clip 1 followed by clip 2. Took the video of clip two and dragged it above clip 1 at the point I want the transition to start. Click on the in point (where

  • I already have CS6 Ext. installed.

    Do I need to do anything prior to the 17th?