Create Or Replace function error

Hello

I do the search of texts using Oracle SQL Developer: ODMiner... I imported the "WEBLOG" data into a table... These weblog data consists of the activity of users, date, time, url, etc. The first step I took was to use a function to convert the date and time I have in the data table, in a number representing the 40 minutes since 01/01/1990. I did it by dividing by 2400 (seconds in 40 minutes). The main objective is to have a period of time for the sessions.
I used the following code,

(SsnDate) CREATE or REPLACE FUNCTION
DEFAULT VARCHAR2 03/01/18 EFFECTIVE DATE,
TIME IN VARCHAR2
) RETURN NUMBER
AS
BEGIN
RETURN TRUNC ((to_date(DATE||) e '|| TIME, ' Hh: mm: DD-MM-YY ')-to_date('01-JAN-1990','DD-MON-YYYY')) * (86400/2400);
END ssnDate;

This is what appeared in the newspaper after the execution of the statement,

SsnDate compiled FUNCTION
WARNING: the execution is completed with warning

After that, I tried to create a VIEW to change the DATE and TIME with the ssnDate that was created earlier and concatenate the CS_URI_STEM (which is the accessible resource) and CS_URI_QUERY (which is the query, if any, the client was trying to perform) in 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
OF THE WEB BLOG.

Now that I got the following error...

Error from the 1 in the command line:
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
WEBLOG
Error in the command line: 3 column: 38
Error report:
SQL error: ORA-00923: KEYWORD not found where expected
00923 00000 - "FROM keyword not found where expected"
* Cause:
* Action:

I do not understand where I am going wrong with this... It comes to the data preparation step that requires me to prepare the data before applying the techniques of modeling or algorithms... The next step might be to group the data, based on the time of the session, ip and the user agent of each session as well as the fields web_links visited by the user of the session.

I would be really grateful for all entries on where I'm wrong and all the solutions for it!

Good. Please close the message.

Concerning
Girish Sharma

Tags: Database

Similar Questions

  • CREATE (or REPLACE) procedure_definition | function definition

    A manual I read says to use the function CREATE or REPLACE function, but my function will not compile with one of these. It compiles only when I use the FUNCTION itself. The CREATION or replacement is no longer used in Oracle 10 g?

    Thank you

    Rich75 wrote:
    I tried in SQL * more and it worked for me too, but I usually use SQL Navigator. That's where I got the error.

    I'm pretty new to Oracle, so I probably don't understand some things too well. I realized that when I created the function in SQL * Plus, it appeared in SQL Navigator under functions. I created this function in a package, so I think it's a little different than the creation of a global function.

    Published by: Rich75 on January 27, 2010 10:02

    Yes, OK if you create a function inside a package, then you do not have to give create or replace keywords.

  • The shift from collection to function error

    Hello world.  I am a novice in PL/SQL and I get an error and I don't know why.  Here is my code.

    FUNCTION validate_column(
        in_columns IN CHAR_TBL,
        in_column_str IN VARCHAR2)
    RETURN VARCHAR2
    AS
        avail INT := 0;
    BEGIN
        SELECT COUNT(*) INTO avail FROM in_columns WHERE column_name = UPPER(in_column_str);
    RETURN '';
    END validate_column;
    
    
    
    FUNCTION test(
        in_table IN VARCHAR2)
    RETURN VARCHAR2
    AS
      COLS CHAR_TBL;
    BEGIN
        SELECT column_name BULK COLLECT INTO COLS FROM user_tab_columns WHERE table_name = in_table;
        validate_column(COLS, 'abc');
        RETURN '';
    END test;
    

    CREATE OR REPLACE TYPE CHAR_TBL
    AS
      TABLE OF VARCHAR2(4000);
    

    When I compile this code, I get an error on line 7 above.  ORA-00942: table or view does not exist.

    NOTE: user_tab_columns is integrated oracle table.

    What I am doing wrong?  I am not able to pass a collection as a parameter to a function?

    Thank you

    There are quite a few errors, see the example below:

    CREATE OR REPLACE TYPE CHAR_TBL

    AS

    TABLE OF THE VARCHAR2 (4000);

    /

    (Validate_column) CREATE or REPLACE FUNCTION

    in_columns IN CHAR_TBL,

    in_column_str IN VARCHAR2)

    RETURN NUMBER

    AS

    avail INT: = 0;

    BEGIN

    COUNT (*) of SELECT INTO TABLE OF (in_columns) WHERE COLUMN_VALUE available = UPPER (in_column_str);

    RETURN nothing.

    END validate_column;

    /

    CREATE or REPLACE the FUNCTION test)

    in_table IN VARCHAR2)

    RETURN NUMBER

    AS

    PASSES CHAR_TBL.

    v_cnt NUMBER;

    BEGIN

    SELECT column_name BULK COLLECT INTO PASSES FROM user_tab_columns WHERE table_name = in_table;

    v_cnt: = validate_column (PASSES, 'abc');

    RETURN v_cnt;

    END test;

    /

  • Say this function error

    create or replace function m_sup

    (m_sup_rec to fab_sr_mast.sup_rec%type)

    return varchar2

    is

    m.sup_rec_no fab_sr_mast.sup_rec_no%type: = 0;

    Start

    IF: NEW. SUP_REC = "SUP" THEN

    SELECT 'SHRINK' |' 1' || TO_CHAR (SYSDATE, 'YYMM') | (MAX (SUBSTR(SUP_REC_NO,9)) + 1)

    IN: NEW. SUP_REC_NO

    OF FAB_SR_MAST;

    ELSIF: NEW. SUP_REC = "REC" THEN

    SELECT 'ANSC' |' 1' || TO_CHAR (SYSDATE, 'YYMM') | (MAX (SUBSTR(SUP_REC_NO,9)) + 1)

    IN: NEW. SUP_REC_NO

    OF FAB_SR_MAST;

    END IF;

    end m_sup

    If you work in a single transaction, then you can insert the parent record first, without committing, then insert the child records and commit after these two inserts. So that you can control the order of inserts.

    If you cannot control the order of inserts, or there are other things happening under the operation, you can assign to the constraint CF to be can be delayed which postponed the assessment of the constrint until the commit

    And give details on this script for tables and try same values in the two tables in DB

  • TDMS Create or Replace returns an error

    This example using FPGA (towards the end of the page):

    http://zone.NI.com/DevZone/CDA/tut/p/ID/11198#toc4

    Step #26 under FPGA section implements the open or create TDMS files.

    It always returns error #7 of the PDM create or replace VI.  When you create a new file, it should not return error "file not found".

    You are receving error 7 the path of the file that you specify. Make sure you use the correct path to the file. If you still have problems is an article in the knowledge base that may shed more light on what goes wrong.

    http://digital.NI.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF?OpenDocument

    Kind regards

    David has.

  • 'HRMS Create Document' function errors

    Hello

    I created a web ADI to download the data of the DIS.

    The responsibility for the integration of Office I can create and use the document to download the data and its success.

    Now I want to assign the document to create the end user if I include the "HRMS create a Document" function in the menu of the responsibility. The function is displayed on the screen, but when I click it, it says "web page not found."

    Also, I tried to associate the custom function by running the Integrator "HR ADI seeded Integrator Associations of shape functions. He has successfully completed. I added the custom liability function, but it is not there. I saw the definition of function, its almost empty. When I updated the definition with some dummy URLs, it seems.

    How can I give access to the document create for just this Integrator for the end user?

    Abdul Wahid

    Hi all

    Solved. In the call of html, instead of "oracle.apps.bne.webui.BneApplicationService", only "BneApplicationService" should be placed.

    Abdul Wahid

  • create the default function for table

    Oracle Erro PLS-00593
    What is this problem?

    Is possible to create?

    exec default_values (51, p_seq_cessao_servidor_canc = > varray_1);
    or
    exec default_values (51, p_seq_cessao_servidor_upd = > varray_2);


    CREATE OR REPLACE TYPE 'SISARR '. "' VARRAYNUMTYP ' is varray (500) number;

    function test (p_seq_debito IN sisarr.debito.seq_debito%TYPE
    p_sig_usuario IN sisarr.deb_cessao_servidores.sig_usuario%type
    p_seq_cessao_servidor_canc IN varraynumtyp by default varraynumtyp()
    (, p_seq_cessao_servidor_upd IN varraynumtyp varraynumtyp() default) return is varchar2

    vMsg Varchar2 (4000);

    Start
    --
    end;

    Thank you!

    Published by: user10830594 on 06/03/2009 05:52

    Hello

    user10830594 wrote:
    Oracle Erro PLS-00593
    What is this problem?

    Oracle error: PLS-00593
    the default value of the parameter 'string' in the body must match spec

    Cause
    Initialization by default value of a parameter in a body of subroutine contained in a package body did not match that of the specification of subprogram corresponding to the corresponding package specification.

    Action
    Change the default initialization of the parameter in the body must match the spec.

    SQL> create or replace type test_v is VARRAY(500) of number;
      2  /
    
    Type created.
    
    SQL> create function test_f (x test_v default NULL)
      2  return number
      3  as
      4  begin
      5  return 1;
      6  end;
      7  /
    
    Function created.
    
  • Synonym of ALTER with Create or replace synonym

    Oracle 9i Release 2 database

    I need to change the thesaurus during execution to point to a new owner of the table. But I'm running into errors of "insufficient privileges".

    SQL> select grantee,owner,table_name,privilege from dba_tab_privs
      2  where table_name IN ('OE4PNFGETDATA','OEBGGETDATA','OEGETDATA');
    
    GRANTEE       OWNER     TABLE_NAME        PRIVILEGE
    ------------- --------- ----------------- -----------
    OEMUSER       OEM2      OE4PNFGETDATA     EXECUTE
    OEMUSER       OEM2      OEBGGETDATA       EXECUTE
    OEMUSER       OEM2      OEGETDATA         EXECUTE
    OEMUSER       OEM1      OEBGGETDATA       EXECUTE
    OEMUSER       OEM1      OEGETDATA         EXECUTE
    OEMUSER       OEM1      OE4PNFGETDATA     EXECUTE
    
    SQL> sho user
    USER is "OEMUSER"
    SQL> select synonym_name,table_owner,table_name from user_synonyms ;
    
    SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME
    ------------------------------ ------------------------------ ------------------------------
    OE4PNFGETDATA                  OEM1                           OE4PNFGETDATA
    OEBGGETDATA                    OEM1                           OEBGGETDATA
    OEGETDATA                      OEM1                           OEGETDATA
    
    

    I need to change the owner of the table to OEM2. Using create or replace synonym in a procedure:

    CREATE OR REPLACE PROCEDURE oemuser.p_switch_users (  i_nonactive_user  IN  VARCHAR2
                                                        , o_msg             OUT VARCHAR2 )
    AS
       v_synonym_name VARCHAR2(30) ;
       v_table_owner  VARCHAR2(30) := i_nonactive_user ;
       v_table_name   VARCHAR2(30) ;
       v_sql          VARCHAR2(255);
    BEGIN
       FOR   rec   IN   ( select synonym_name, table_owner, table_name from user_synonyms )
       LOOP
          v_synonym_name := rec.synonym_name ;
          v_table_name   := rec.table_name   ;
          v_sql := 'CREATE OR REPLACE SYNONYM ' || v_synonym_name || ' FOR ' || v_table_owner || 
                   '.' || v_table_name ;
          EXECUTE IMMEDIATE v_sql ;
    
       END LOOP ;
       
       o_msg := 'Completed successfully' ;
       
       EXCEPTION
          WHEN  others  THEN
             o_msg := 'Error_Stack...' || Chr(10) ||
                      DBMS_UTILITY.FORMAT_ERROR_STACK ;
             RAISE ;
    END p_switch_users ;
    /
    
    var o_msg varchar2(512)
    var i_user varchar2(10)
    exec :i_user := 'OEM2'
    
    exec p_switch_users(:i_user,:o_msg)
    
    ORA-01031: insufficient privileges
    ORA-06512: at "OEMUSER.P_SWITCH_USE
    RS", line 
    
    

    I have not tried to drop the synonyms and re - create, but I expect the same error. Any suggestions?

    Hello

    the owner of the procedure should the privilege of creating its own synonyms if i_nonactive_user is defined on its own behalf (this case has no interest), and he has the privilege to create ANY synonym in other... At first glance, I would say that this is not a good idea.

    Note: you can also save a job: no need to redefine a synonym to point to the same thing, so I would limit synonyms selected in the loop:

    FOR rec IN (SELECT u.synonym_name, u.table_owner, u.table_name

    U user_synonyms

    WHERE u.table_owner! = v_table_owner

    )

    Best regards

    Bruno Vroman

  • Conditional replace Function

    Good afternoon everyone,

    I am trying to assign which I am certain is a basic replace function on certain values in the first column of a table depends on the value of the second column. So if I run the SELECT simple below I get the following:

    -SCRIPT-

    SELECT Col_name_1, Col_name_2

    Table_Name FROM

    -Results-

    Col_name_1 Col_name_2

    13                    0

    23                    0

    44                    1

    47                    1

    50                    0

    Now, say I wanted to replace the values of "Col_name_1" for negative values if the value in the same line of "Col_name_2" is 1. Which gives the following result.

    Col_name_1 Col_name_2

    13                    0

    23                    0

    -44                    1

    -47                    1

    50                    0


    , What would be the most effective way to do it. I thought using logic in the sense of if (Col_name_2 = 1), and then replace (col_name_1, '-&col_name_1') the syntax of this is obviously incorrect, I was wondering how I could produce a "function to replace conditional" which affect only certain rows in the table of results depends on the State.

    Thank you very much

    Charlie

    Hello

    7eb33dbf-5ba7-4248-8088-339e77b11c5e wrote:

    Hi, thanks for you far pointers. Some real examples of data. Col_name_1 was actually 'TARGKEY' and Col_name_2 'CHANGESIGN' then the digital operations to find the reverse (*-1) won't work.

    I guess that means I'm trying to add a hyphen to the TARGKEY value indicates if the value of CHANGESIGN is 1

    To clarify, yes I'm trying only to change the values in the table of results and not "up-to-date" the table of origin.

    It comes to my script.

    SELECT TARGKEY, CHANGESIGN

    OF FDM_SAB. TDATAMAP

    TARGKEY CHANGESIGN
    P0126010 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    1078 0
    1078 1
    1078 0
    [NONE] 0

    Once more, always post CREATE TABLE and INSERT statements for the sample data and show the exact results you want from this data.

    If targkey is a string, you can prepend a hyphen with the |   operator, like this:

    SELECT THE CHECK BOX

    WHEN changesign = 1

    THEN '-' | targkey

    Of OTHER targkey

    END AS new_targkey

    changesign

    OF tdatamap

    ;

    It is preceded by a hyphen to targkey when changesign = 1.  That is what you want, or there are a few exceptions (for example, targekey already begins with a hyphen or is null)?  If there is no special cases like this one, include examples in the sample data, results and explanations.

  • How to create the constructor function for a pl/sql table?

    I created a PL/SQL type as table below:

    create or replace type typ_tbl_des_text is table of the typ_tof_des_text

    OK so far, but I would like to have a constructor function which would be subject to validations and raise_application_error when a validation condition is not met.

    How to do this?

    The typ_tof_des_text that I created with a constructor function, so that the record-level validation are performed in the constructor. And I think the postings between several records shall be made in a constructor for typ_tbl_des_tex, but cannot figure out how to create such a constructor.

    BEDE wrote:

    So, if I have understood correctly, to a plsql table type, I can't have a member procedure. Or can I? I mean, just as for a type of failure I can have one or more constructors and possibly several procedures of Member.

    For the standard tables in PL/SQL, you will need to create your own API (using procedures and functions) to handle beyond the basics provided by the language. No constructors and methods as it is no o - o.

    After thinking a little deeper, I reformulate what I said earlier and actually wants to have a member procedure called add_item, who would be first to check if an item with a key value exists and, if so, it would be up-to-date and so not only extend the plsql table.

    Two options.

    As we already mentioned, an associative array can be considered - note however that this structure of table has name-value pairs.

    Another method is to use a TWG (global temporary table). You define the structure of the once initial table. When a session uses the structure of the table, private copying is instantiated for this session. When the session ends, this copy is destroyed. The table is a temporary structure for this session only.

    It can include indexes and so on – which means you can use the constraints of primary keys, unique indexes, secondary indexes and so on.

    TWG scales are much better than collections or arrays that require a PGA (expensive private server) memory. In addition, SQL can be used natively against a GTT - unlike the arrays and collections.

  • How to create a sentry function


    Hi all

    I want to build a custom authentication scheme that combines a custom authentication and SSO functionality.

    1. If the REMOTE_USER Variable HTTP header is set, this user must be a valid user. (Single Sign On feature)

    2. If the HTTP header Variable is not set, the LOGIN Page should appear. (local user Administration)

    3. the combination user/passowrd of the login page must be validated by my own authentication

    I think I need to create a sentry function, which is a combination of the Sentinel-functions that are used in the projects 'tailor-made' and 'HTTP header Variable.

    I tried to find an implementation of these functions in the diagram APEX_040200 database, but without success.

    @APEX-team: can you provide the implementation of these functions-Sentinel or at least documentation.

    @all: is there anyone who have implemented a similar authentication model.

    Thank you

    Richard

    Hi Richard,

    a sentry function sets whether the application should be allowed to deal with, because the session is ok. Since the 4.1, we have a function additional Invalid session which runs if the Sentinel returns false, before redirecting to the login page. A callback function can be used to continue the treatment when the login page is external. It runs when the external login is successful and redirects to the APEX. Authentication is used in combination with internal login pages to verify that the credentials of the user (username / password) are ok. If it returns true, the session is updated with the username. Otherwise, the login page must present again, with an error message. The poster disconnection feature runs after the user has disconnected. It is sometimes useful for the cleaning of data for the session or twist the redirection.

    In your case, the sentry function is probably not necessary. By default already checks if corresponding to the session id and session cookies, this should be enough. If you try to implement single sign-out, a sentry could check if the session is already authenticated, but the REMOTE_USER will be void. Invalid session function is called when the Sentinel (you're a custom or default) fails. If REMOTE_USER is not null, it can simply call APEX_AUTHENTICATION. POST_LOGIN to save the value of the header under the username, instead of making the normal redirection to the login page. It authenticates the user without checking with authentication credentials. The callback function is not necessary in your case. The authentication function is called when the user connects using the login page for the application (101). It can check the name of user and password for cases where $remote_user@-part is null.

    This can be implemented either as a plugin for authentication with the custom authentication scheme. The former is to be preferred to the production code, the latter is sometimes useful for prototyping. The texts point help plugin and authentication for the various functions include example code. If they are not enough, just respond here and I will try to come up with more concrete examples.

    Kind regards
    Christian

  • SQL > create or replace procedure sp_Validate3 (p_acr_no IN varchar2 2)

    Hi all

    11.2.0.1

    Can you help me to debug what is that pl/sql code error? Thank you
    SQL> create or replace procedure sp_Validate3(p_acr_no    IN  varchar2
      2                                         ,p_recordset OUT sys_refcursor
      3                                         ) as
      4  begin
      5   open p_recordset for
      6      select am.acr_no as acr_no
      7            ,'TEST' as lastname
      8            ,nvl(a.or_no,'0') as ecc_orno
      9            ,nvl(b.or_no,'0') as rp_orno
     10            ,nvl(c.or_no,'0') as ar_orno
     11      from   tab t
     12                        join acr_master     am on (trim(acr_no) = p_acr_no)
     13             left outer join payment_master a  on (payment_type = 'ECC' and trim(acr_no) = p_acr_no)
     14             left outer join payment_master b  on (payment_type = 'RP'  and trim(acr_no) = p_acr_no)
     15             left outer join payment_master c  on (payment_type = 'AR'  and trim(acr_no) = p_acr_no);
     16  end;
     17  / 
     
    Warning: Procedure created with compilation errors.
     
    SQL> show error
    Errors for PROCEDURE SP_VALIDATE3:
     
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    6/5      PL/SQL: SQL Statement ignored
    13/80    PL/SQL: ORA-00918: column ambiguously defined
    SQL>
    create table acr_master(acr_no varchar2(10))
    
    drop table payment_master
    
    create table payment_master(or_no varchar2(10),acr_no varchar2(10),payment_type varchar2(10))
    
    /* Formatted on 06/06/2013 6:06:58 PM (QP5 v5.126.903.23003) */
    CREATE OR REPLACE PROCEDURE sp_Validate3 (p_acr_no      IN     VARCHAR2,
                                              p_recordset      OUT sys_refcursor)
    AS
    BEGIN
       OPEN p_recordset FOR
          SELECT   am.acr_no AS acr_no,
                   'TEST' AS lastname,
                   NVL (a.or_no, '0') AS ecc_orno,
                   NVL (b.or_no, '0') AS rp_orno,
                   NVL (c.or_no, '0') AS ar_orno
            FROM               tab t
                            JOIN
                               acr_master am
                            ON (TRIM (acr_no) = p_acr_no)
                         LEFT OUTER JOIN
                            payment_master a
                         ON (payment_type = 'ECC' AND TRIM (acr_no) = p_acr_no)
                      LEFT OUTER JOIN
                         payment_master b
                      ON (payment_type = 'RP' AND TRIM (acr_no) = p_acr_no)
                   LEFT OUTER JOIN
                      payment_master c
                   ON (payment_type = 'AR' AND TRIM (acr_no) = p_acr_no);
    END;
    /
    
    SQL> show error
    Errors for PROCEDURE SP_VALIDATE3:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    6/5      PL/SQL: SQL Statement ignored
    13/80    PL/SQL: ORA-00918: column ambiguously defined
    SQL>
    
    --In the below code after keeping alias names of the tables, the procedure compiled successfully 
    
    /* Formatted on 06/06/2013 6:06:58 PM (QP5 v5.126.903.23003) */
    CREATE OR REPLACE PROCEDURE sp_Validate3 (p_acr_no      IN     VARCHAR2,
                                              p_recordset      OUT sys_refcursor)
    AS
    BEGIN
       OPEN p_recordset FOR
          SELECT   am.acr_no AS acr_no,
                   'TEST' AS lastname,
                   NVL (a.or_no, '0') AS ecc_orno,
                   NVL (b.or_no, '0') AS rp_orno,
                   NVL (c.or_no, '0') AS ar_orno
            FROM               tab t
                            JOIN
                               acr_master am
                            ON (TRIM (acr_no) = p_acr_no)
                         LEFT OUTER JOIN
                            payment_master a
                         ON (a.payment_type = 'ECC' AND TRIM (a.acr_no) = p_acr_no)
                      LEFT OUTER JOIN
                         payment_master b
                      ON (b.payment_type = 'RP' AND TRIM (b.acr_no) = p_acr_no)
                   LEFT OUTER JOIN
                      payment_master c
                   ON (c.payment_type = 'AR' AND TRIM (c.acr_no) = p_acr_no);
    END;
    /
    
  • Ampersand substitution in create or replace procedure statement

    Hi guys,.

    I wonder why my replacement ampersand works in a create or replace statement of the stored procedure.

    CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS


    Cancel the DEFINITION DimSales;
    Cancel the DEFINITION FactTable;
    SET DimSales = 'TESTTAB;
    SET FactTable = myfact;


    BEGIN
    *...*

    Error (5,20): PLS-00103: encountered the symbol "=" when expected as follows: =. (@ %; not null default range character)


    If I assign the value with: = I get the error "invalid table" thereafter for the statemnt of INSERTION:

    CREATE OR REPLACE PROCEDURE UPDATE_DIM_SALES AS


    Cancel the DEFINITION DimSales;
    Cancel the DEFINITION FactTable;
    SET DimSales: = ' x 2';
    SET FactTable: = ' x 1';


    BEGIN
    INSERT INTO & DimSales (column1, column2,...)

    Why not the ampersand substitution work in a stored procedure?

    No problem with the carpet. Display. But you don't need to create and drop them again. Simply create a time and refresh just before departure if necessary. I expect the creation and updating of points of view is fast comparibly. Also access to the seller_id should be indexed.

    Your original pl/sql block is slow due to several reasons. One might be that you agree to each line. Engage is an extremely slow process. He avoid as much as possible. Another part might be that you make all the changes of context of pl/sql. The obvious way to avoid this would be to BULK operations (bulk-select + Forall). It is not so difficult. The size of the collection must be limited to a lower amount.

    Best way would be to measure the performance of pl/sql parts using a tool such as DBMS_PROFILER. Then you can decide what part is slow and must be granted.

    A simple insert could be faster. Did you test that?

    example not tested

    INSERT /*+append */
    INTO &DimSales (K_Sales,REG,BVL,DS, VS,RS,GS,VK)
    (SELECT trim(leading '0' from RS||GS) ,REG, BVL,DS, VS,RS,GS,VK
    from &FactTable f
    join &testsales s on f.SellerNo =s.Seller_No;
    
    commit;
    

    You can run the other issues, but this is generally the fastest approach. Try to avoid the separate if possible. This requires a sort and will slow down the insert of a lot.

    Published by: Sven w. on November 30, 2010 17:10

  • Create a RELATIONSHIP Contact error

    Create Organization Contact API error: cannot create a new relationship for a period of time that spans the period of time of an existing relationship with the same id of the object, the code of the relationship and the id of the object

    I can't find this error on a forum - or on the internet also.

    Contacts relationship CRM to a party or organization have a date I don't see?

    J

    This error basically means that you create duplicate reports.

    When you create a contact org using the API to create contact, a record is created in HZ_ORG_CONTACTS and at the same time, that a record of the relationship is created in HZ_RELATIONSHIPS. This last painting has a start date and end date. Please check if already a contact relationship already exists between the Group and the HZ_RELATIONSHIPS table object.

    Note that when you create a relationship in HZ_RELATIONSHIPS, it is not necessary that a record is created in HZ_ORG_CONTACTS. This is optional based on a user in function parameter. I'll have to check if on this last point. I remember it was how it worked.

  • CREATE or REPLACE 2 dependent object types

    I have the task to create or replace the 2 types of dependent object, i.e.

    CREATE or REPLACE TYPE myObject AS OBJECT
    (
    name varchar2 (200),
    Age number
    )

    CREATE or REPLACE TYPE myObjectTable IS TABLE OF myObject
    /

    If I run these two statements, the first time, they are very good.
    If I run them again they do not
    ORA-02303: cannot drop or replace a type load type or table.
    The reason is clear: myObjectTable depends on myObject

    If I now inserts a DROP TYPE myObjectTable before these 2 instructions, they work very well, because the myObjectTable of the object exists.
    But if these 3 instructions are now executed from scratch they deliver the error ORA-04043: myObjectTable of the object does not exist.

    Now I need a solution that can deal with two situations:
    A. types already exist
    B. types do not yet exist

    Is there a way to DROP TYPE something and remove the error "object does not exist"?
    Is it possible to use CREATE or REPLACE and use something like a 'FORCE' option to remove the dependency problems?

    Thank you
    Frank

    You can remove your ora-04043 following this approach:

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:286816015990 #51943736724660

    !! Don't forget: the example is on a TABLE, you have an OBJECT, where a different error code!

      object_does_not_exist exception;
      pragma exception_init( object_does_not_exist, -4043 );
    

Maybe you are looking for