Pl/Sql Error while creating a trigger

Hello everyone m trying to make a trigger whose purpose is not to allow any update insert or delete to be done on the table Work if the day is sunday.I tried this code but it is giving me error
create or replace trigger No_work_on_Sunday
After insert or update or delete
on Work When owner='MAX'
for each row
begin
        if (select to_char(sysdate,'D')=1) then
                 raise_application_error(-20001,'no work on sunday');
      end if;
end;
on Work when owner='MAX'
ERROR at line 3:
ORA-04077: WHEN clause cannot be used with table level triggers Pls help
Edited by: 781207 on Jul 16, 2010 7:43 AM

create or replace trigger No_work_on_Sunday
before insert or update or delete
for each row
on Work When owner='MAX'
begin
        if to_char(sysdate,'D')=1 then
                 raise_application_error(-20001,'no work on sunday');
      end if;
end;
/Keep in mind to_char(sysdate,'D')=1 is NLS dependent. In US week starts Sunday in most european some coutries week starts Monday. In middle east it can be Friday or Saturday...
SY.
Edited by: Solomon Yakobson on Jul 16, 2010 7:50 AM

Similar Messages

  • SQL Error while creating data Owner certification in SRM 5.0.3

    Hi , In SRM 5.0.3, while creating data Owner certification by choosing data owner, I m getting the following error. database i upgraded and the migration script is also run.
    java.sql.SQLException: Violation of PRIMARY KEY constraint 'pk_id_attr_val_users'. Cannot insert duplicate key in object 'dbo.id_attr_val_users'. Since Primary key is clustered(cert_id,user_id,attr_val_id) and we have updated currentvalue of CertificationID in sequences table, We are not sure if SRM is trying to enter duplicate attribute value for same user in D.O certification. Any pointers regarding this error will be of great help, thanks.

    Solved but not happy!
    VIN is not compatible with a web UI that uses standard ports, i.e. TCP 80 and 443. No notes (at least that I seen) in the documents stating this as a requirement.
    KB 2065986
    VMware KB: VMware vRealize Infrastructure Navigator is not accessible when the vSphere Web Client is not running on …

  • Whats this error while creating a trigger

    HI ,
    I was creating a trigger and getting the following Error . What is this
    1 CREATE OR REPLACE TRIGGER TRG_AUDIT_LOGON AFTER
    2 LOGON ON DATABASE
    3 Declare
    4 v_sid v$session.sid%type ;
    5 v_serial v$session.serial# %type;
    6 v_username v$session.username%type;
    7 v_osuserid v$session.osuser%type;
    8 v_machinename v$session.machine%type;
    9 v_PROGRAM v$session.program%type;
    10 v_TERMINAL v$session.terminal%type;
    11 v_hostname v$instance.host_name%type;
    12 v_instance_name v$instance.instance_name%type;
    13 v_application_id v$database.dbid%type;
    14 v_logon_time date;
    15 v_Audit_tab_check varchar2(30);
    16 v_system_users_tab_check varchar2(30);
    17 v_sql_Audit_upload varchar2(1000) := 'INSERT INTO dbaoper.T_AUDIT (HOST_NAME, APPLICATION_ID, INSTANCE_NAME, SID, SERIAL#, USERNAME, OSUSERID, MACHINENAME, PROGRAM, TERMINAL, LOGON_TIME) VALUES (:v_hostname,:v_application_id,:v_instance_name, :v_sid, :v_serial, :v_username ,:v_osuserid,: v_machinename, :v_program,:v_TERMINAL,:v_logon_time ) ';
    18 type c_audit_cur_typ is ref cursor;
    19 C_Audit c_audit_cur_typ ;
    20 V_system_users_tab := 'T_SYSTEM_USERS';
    21 No_Audit_records Exception;
    22 Begin
    23 Select table_name into v_Audit_tab_check from dba_tables where owner='DBAOPER' and table_name='T_AUDIT';
    24 Select table_name into v_system_users_tab_check from dba_tables where owner='DBAOPER' and table_name='T_SYSTEM_USERS';
    25 Open c_Audit for ' SELECT sid, serial#, username, osuser, machine, program, terminal FROM v$session WHERE audsid = userenv (''''sessionid'''') and program not like ''''oracle@%J0%'''' and username not in (select * from dbaoper.' || V_system_users_tab||' ) and type!=''''BACKGROUND'''' ' ;
    26 Fetch c_Audit into v_sid, v_serial, v_username, v_osuserid, v_machinename,v_program,v_TERMINAL ;
    27 If c_Audit%Notfound then
    28 Raise No_Audit_records ;
    29 Else
    30 Select host_name, instance_name into v_hostname, v_instance_name from v$instance;
    31 select dbid into v_application_id from v$database;
    32 select sysdate into v_logon_time from dual;
    33 execute immediate v_sql_Audit_upload using v_hostname,v_application_id,v_instance_name,v_sid,v_serial,v_username,v_osuserid,v_machinename,v_program,v_TERMINAL,v_logon_time;
    34 end if;
    35 close C_Audit;
    36 exception
    37 when no_data_found then
    38 dbms_system.ksdwrt(2, ' ORA-20001 Audit tables T_AUDIT or T_SYSTEM_USERS not found Audit information is not being captured'
    39 );
    40 When No_Audit_records then
    41 dbms_output.put_line ('No Audit records to insert ');
    42* end;
    SQL> /
    Warning: Trigger created with compilation errors.
    SQL> sho err
    Errors for TRIGGER TRG_AUDIT_LOGON:
    LINE/COL ERROR
    18/20 PLS-00103: Encountered the symbol "=" when expecting one of the
    following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar
    The symbol "<an identifier>" was substituted for "=" to
    continue.
    Thanks
    Pramod

    Hi
    I am sorry...i am getting the following error once trigger is created and one of the user is trying to connect....what might be the reason ?
    Enter user-name: test
    Enter password:
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00907: missing right parenthesis
    ORA-06512: at line 23
    Thanks
    Prmaod

  • Error in Forms while creating the trigger- WHEN-CREATE-RECORD

    Hello,
    Right now I am using 11g client side and 10g database.
    I am constantly getting an error while creating triggers in 11g.
    I have created a sequence in SQL developer using the following code:
    create sequence loc_id_sequence
    start with 14;
    After creating the sequence. I am trying to write the PL/SQL code in forms builder for the trigger WHEN-CREATE-RECORD
    declare
    loc_id number;
    begin
    loc_id := loc_id_sequence.nextval;
    end;
    But I have been getting the following error constantly. Can anyone please help me?
    "Error 0 at line 5, column 4
    SQL statement ignored".
    Can anyone please tell me why I am getting that error

    In fact, even I thought there might be some problem with the connectivity with the 10g database and 11g client but the other DB related code works.
    I just have the problem with using sequence for the trigger WHEN-CREATE-RECORD.
    In fact I also tried using WHEN-NEW-RECORD-INSTANCE smart trigger instead of WHEN-CREATE-RECORD for the same sequence. But even that doesn't work.
    Do u have any idea of what that error means?
    "Error 0 at line 5, column 4
    SQL statement ignored"
    Edited by: Pooja 1985 on Feb 26, 2013 5:43 PM
    Edited by: Pooja 1985 on Feb 26, 2013 5:44 PM

  • Getting error while creating trigger!!

    Hi Guys,
    I am getting the following error while creating trigger in Oracle10g Database in TOAD environment.
    Error: PLS-00306: wrong number or types of arguments in call to '='
    Table details:
    One of the column having BLOB Data type in the table.
    In the trigger, I have compared :old and :new values.
    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_NEW(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    Any one knows about this issue, please let me know with the proper solution.
    Thanks for your immediate response!
    Regards,
    Lakshman

    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_AUD(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    I am getting the error in line at If condition
    Error: PLS-00306: Wrong number or tpyes of arguments in call '='
    Please let me know if any one knows exact solution!
    Thanks in advance!
    Regards,
    Lakshman

  • Error while creating sequence - related to xdb installation?

    I'm getting the following error while creating a sequence -
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: Trigger xdb_installation_trigger does not support object creation of
    type SEQUENCE
    ORA-06512: at line 32
    oracle xml db was installed on this instance.
    Is there a way around it? We want oracle xml db installed but we still want to be able to create and drop sequences!

    Hi Expert,
    In T-Code: OB52, We need to open the period 001 for Year - 2012 for the Account Type - S and for GL Account - 799999.
    Configure as shown below for your Posting Period Variant:
    Account Type: S
    From Account: (Only provide any GL Accounts From Range, If you require any specific GL Accounts to be open. Else leave blank)
    To Account:(Only provide any GL Accounts To Range, If you require any specific GL Accounts to be open. Else leave blank)
    From Period: 01
    Year: 2012
    To Period:01
    Year:2012
    From Period:13
    Year:2012
    To Period:16
    Year:2012
    Save
    Regards,
    GK
    SAP

  • Getting error while creating Communication capability

    Hi,
    I am getting this error while creating communication capability of Host. I have successfully configured the TP communication capability. Even I have tried many times after changing the names given by me during configuration.
    Error creating Communication Capability
    java.lang.Exception : Error -: AIP-16012: Parameter: uri is unique for object Endpoint: Error -: AIP-11052: Writing following objects: Endpoint failed due to following constraint violation: ENDPOINT_UK. UNIQUE CONSTRAINT VIOLATION: java.sql.SQLException: ORA-20003: Endpoint_UK. Unique constraint violation ORA-06512: at "B2B.TRG_ENDPOINT_INS", line 17 ORA-01403: no data found ORA-04088: error during execution of trigger 'B2B.TRG_ENDPOINT_INS'
    Please tell me what is the source of error.
    Thanks in advance.
    Regards,
    Anuj Dwivedi

    Hi I am getting this error while creating communication capability --
    Error creating Communication Capability
    java.lang.Exception : Error -: AIP-16012: Parameter: trading Partner is unique for object Certificate: Error -: AIP-11052: Writing following objects: Certificate failed due to following constraint violation: CERTIFICATE_UK. UNIQUE CONSTRAINT VIOLATION: java.sql.SQLException: ORA-20003: Certificate_UK. Unique constraint violation ORA-06512: at "B2B.TRG_CERTIFICATE_INS", line 20 ORA-01403: no data found ORA-04088: error during execution of trigger 'B2B.TRG_CERTIFICATE_INS'
    Please tell that where could be the problem?
    Thanks.
    Regards.
    Anuj Dwivedi

  • Error while Creating forms

    Hello,
    Right now I am using 11g client side and 10g database.
    I am constantly getting an error while creating triggers in 11g.
    I have created a sequence in SQL developer using the following code:
    create sequence loc_id_sequence
    start with 14;
    After creating the sequence. I am trying to write the PL/SQL code in forms builder for the trigger WHEN-CREATE-RECORD
    declare
    loc_id number;
    begin
    loc_id := loc_id_sequence.nextval;
    end;
    But I have been getting the following error constantly. Can anyone please help me?
    "Error 0 at line 5, column 4
    SQL statement ignored".
    Can anyone please tell me why I am getting that error

    990252 wrote:
    Hello,
    Right now I am using 11g client side and 10g database.
    I am constantly getting an error while creating triggers in 11g.
    I have created a sequence in SQL developer using the following code:
    create sequence loc_id_sequence
    start with 14;
    After creating the sequence. I am trying to write the PL/SQL code in forms builder for the trigger WHEN-CREATE-RECORD
    declare
    loc_id number;
    begin
    loc_id := loc_id_sequence.nextval;
    end;
    But I have been getting the following error constantly. Can anyone please help me?
    "Error 0 at line 5, column 4
    SQL statement ignored".
    Can anyone please tell me why I am getting that errorit works OK for me
    SQL> create sequence loc_id_sequence
    start with 14;  2 
    Sequence created.
    SQL> declare
    loc_id number;
    begin
    loc_id := loc_id_sequence.nextval;
    end;  2    3    4    5 
      6  /
    PL/SQL procedure successfully completed.
    SQL>

  • SQL error while purging configuration

    Hi Gurus,
    We are getting AIP-11016:SQL error while purging the configurations
    Please find the extract of ui.log below.
    2009.07.14 at 09:59:08:656: PURGE_MANAGER_THREAD: Repository - (ERROR) PurgeManager: Purge op failed
    2009.07.14 at 09:59:08:656: PURGE_MANAGER_THREAD: Repository - (ERROR) PurgeManager: PurgeManager failed: Error -: AIP-11016: SQL error: java.sql.SQLException: ORA-02430: cannot enable constraint (TIP_ATTACHMENTSTORAGE_RFK) - no such constraint
    ORA-06512: at "B2B.IP_PURGE", line 47
    ORA-06512: at line 1
    2009.07.14 at 09:59:17:250: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) In getVersionOnly()
    2009.07.14 at 10:00:30:343: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) Executing Query::SELECT DISTINCT C.ID, C.CLASSTYPE, C.name, C.LifeCycleState, CA.aud_modified FROM TIP_Configuration_t C, TIP_Configuration_t_AUD CA WHERE C.ID = CA.ID AND C.LifeCycleState IN ('Active','Validated','Quiescing','Quiesced') AND CA.aud_modified IN ( SELECT MAX(aud_modified) FROM TIP_Configuration_t_AUD WHERE ID = C.ID GROUP BY ID) ORDER BY CA.aud_modified DESC
    2009.07.14 at 10:00:30:375: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) In getVersionOnly()
    2009.07.14 at 10:01:02:343: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) Rendering Page::pages/deployment/config_list
    2009.07.14 at 10:01:02:343: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) Executing Query::SELECT DISTINCT C.ID, C.CLASSTYPE, C.name, C.LifeCycleState, CA.aud_modified FROM TIP_Configuration_t C, TIP_Configuration_t_AUD CA WHERE C.ID = CA.ID AND C.LifeCycleState IN ('Active','Validated','Quiescing','Quiesced') AND CA.aud_modified IN ( SELECT MAX(aud_modified) FROM TIP_Configuration_t_AUD WHERE ID = C.ID GROUP BY ID) ORDER BY CA.aud_modified DESC
    2009.07.14 at 10:01:02:375: AJPRequestHandler-ApplicationServerThread-6: UI - (ERROR) In getVersionOnly()
    Could you please tell us where could be the problem?
    Thanks in advance,
    Nag

    Hi,
    I had got an error while applying MLR 11 patch set. Please find error stack trace below.
    Failure for task [TCP20SeedTask] : Error -: AIP-16012: Parameter: transport Protocol is unique for object Transport Protocol Parameter: Error -: AIP-11052: Writing following objects: Transport Protocol Parameter failed due to following constraint violation: TRANSPORTPROTOCOLPARAMETER_UK. UNIQUE CONSTRAINT VIOLATION: java.sql.SQLException: ORA-20003: TransportProtocolParameter_UK. Unique constraint violation
    ORA-06512: at "B2B.TRG_PARAMETER_INS", line 104
    ORA-01403: no data found
    ORA-04088: error during execution of trigger 'B2B.TRG_PARAMETER_INS'
         at oracle.tip.repos.core.persistency.BaseObject.createObject(BaseObject.java:988)
         at oracle.tip.model.b2b.protocol.TransportProtocolParameter.create(TransportProtocolParameter.java:200)
         at oracle.tip.seed.GenericTCPSeedTask.createTransportProtocolParameter(GenericTCPSeedTask.java:247)
         at oracle.tip.seed.GenericTCPSeedTask.addParameter(GenericTCPSeedTask.java:162)
         at oracle.tip.seed.GenericTCPSeedTask.createTCPParameterSeed(GenericTCPSeedTask.java:112)
         at oracle.tip.seed.GenericTCPSeedTask.createTCPSeed(GenericTCPSeedTask.java:94)
         at oracle.tip.seed.GenericTCPSeedTask.doWork(GenericTCPSeedTask.java:66)
         at oracle.tip.seed.SeedDriver.processTasks(SeedDriver.java:222)
         at oracle.tip.seed.SeedDriver.go(SeedDriver.java:283)
         at oracle.tip.seed.GenericTCPSeedDriver.main(GenericTCPSeedDriver.java:61)
    Caused by: Error -: AIP-11052: Writing following objects: Transport Protocol Parameter failed due to following constraint violation: TRANSPORTPROTOCOLPARAMETER_UK. UNIQUE CONSTRAINT VIOLATION: java.sql.SQLException: ORA-20003: TransportProtocolParameter_UK. Unique constraint violation
    ORA-06512: at "B2B.TRG_PARAMETER_INS", line 104
    ORA-01403: no data found
    ORA-04088: error during execution of trigger 'B2B.TRG_PARAMETER_INS'
         at oracle.tip.repos.core.driver.CatalogWriteDriver.writeObjectList(CatalogWriteDriver.java:825)
         at oracle.tip.repos.core.driver.CatalogDriver.writeObjectList(CatalogDriver.java:1419)
         at oracle.tip.repos.core.driver.CatalogTransaction.flush(CatalogTransaction.java:477)
         at oracle.tip.repos.core.persistency.BaseObject.createObject(BaseObject.java:955)
         ... 9 more
    Caused by: java.sql.SQLException: ORA-20003: TransportProtocolParameter_UK. Unique constraint violation
    ORA-06512: at "B2B.TRG_PARAMETER_INS", line 104
    ORA-01403: no data found
    ORA-04088: error during execution of trigger 'B2B.TRG_PARAMETER_INS'
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:315)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:281)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:638)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:184)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:632)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1085)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2983)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3056)
         at oracle.tip.repos.core.driver.CatalogWriteDriver.writeObjectList(CatalogWriteDriver.java:756)
         ... 12 more
    I'm still using the same patch level. Is there any chance that these errors observed are the reason behind the problem I'm facing in purging configs. If so, is there any workarounds for this?
    Thanks in advance.
    Regards,
    Nagasudhan

  • Error while creating presentation variable in Dashboard prompts.

    Hi Team
    I have been going through the guidelines and procedures to create a presentation variable to use it in the dashboard prompt ( mentioned in the previous blogs ) .I followed the below link :
    http://oraclebi.blog.com/example-of-presentation-variable-in-obiee/
    I am using the following query :
    ========================================================
    SELECT case when 1=0 then "D2 Market"."M04 Region"
    else 1
    end
    FROM "Sample Sales"
    UNION ALL
    select case when 1=0 then "D2 Market"."M04 Region"
    else 2
    end
    FROM "Sample Sales"
    =========================================================
    I just wanted to create 2 dummy choices i.e 1 and 2 .But while soing so I am getting erros in the case statements :
    =========================================================
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27005] Unresolved column: "D2 Market"."M04 Region". (HY000)
    SQL Issued: SELECT case when 1=0 then "D2 Market"."M04 Region" else 1 end FROM "Sample Sales" UNION ALL select case when 1=0 then "D2 Market"."M04 Region" else 2 end FROM "Sample Sales"
    =========================================================.
    Please suggest and let me know if there is any other method to have 2 chioces in drop down i.e 1 and 2 using SQL statements while creating the dashboard prompts.
    Thanks

    Hi Rachit
    You answered my doubt.This one really works . Thanks a lot !
    But i have one more doubt i.e if have created the Presentation variable in the dashboard prompt and I want to use it in a report
    i.e the scenario is If I have created a new column i.e " Revised Salary " in the Presentation Services and want the values to be entered there dynamically upon end users choice. For ex the end user selecrts value of 1 then the report would display an increament of 500 to all the employees in the " Revised Salary " column and if the end user select value of 2 .. the report would display a decrement of 500 in the " Revised salary column".
    I am getting the following error :
    ========================================================================
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59001] Binary Logical operation is not permitted on VARBINARY, INTEGER operand(s). (HY000)
    SQL Issued: SELECT "D0 Time"."T05 Per Name Year" saw_0, "D2 Market"."M04 Region" saw_1, "D4 Product"."P01 Product" saw_2, "D1 Customer"."C1 Cust Name" saw_3, "F1 Revenue"."1-01 Revenue (Sum All)" saw_4, CASE WHEN 0='1' then "F1 Revenue"."1-01 Revenue (Sum All)" +500 else "F1 Revenue"."1-01 Revenue (Sum All)" - 500 end saw_5 FROM "Sample Sales" ORDER BY saw_0, saw_1, saw_2, saw_3
    ========================================================================
    Please NOTE : The column on which I want to do an increament is : "F1 Revenue"."1-01 Revenue (Sum All)"
    Thanks

  • Error while creating a task for creating an generic task  /app/dac/CustomSQ

    Hi ,
    I have created a sql file in DAC server /app/dac/CustomSQLs/ ,just to fire an update sql in database
    In DAC task tab i have created a task with the following:
    Command for incremental load :/app/dac/CustomSQLs/DBNameBeforeLoad.sql
    Primary source :flatfileconnection
    target source:DBCONNECTION_OLAP
    Execution type:SQL FILE
    Task phase:GENERAL
    I created subject area and assembled ,then created a Execution plan.
    When i try to execute this EP ,it shows the following error in DAC log:
    ANOMALY INFO::: Error while creating a task for creating an generic task /app/dac/CustomSQLs/DBNameBeforeLoad.sql
    MESSAGE:::/app/dac/CustomSQLs/DBNameBeforeLoad.sql - invalide template name!
    EXCEPTION CLASS::: com.siebel.analytics.etl.etltask.TaskInitializationException
    com.siebel.analytics.etl.etltask.SQLFileTask.doInit(SQLFileTask.java:69)
    com.siebel.analytics.etl.etltask.GenericTaskImpl.init(GenericTaskImpl.java:194)
    Does my above configuration is correct ..?

    verify the following settings:
    1. mapping of ECC plant and storage location and logical system number with the appropriate availability group code since this links the stock types in EWM to ECC org elements (SPRO -> EWM -> Interfaces -> ERP Integration -> Goods movement)
    2. ensure the availability group configuration is correct (SPRO -> EWM -> GR Process -> Configure availability group for putaway) - check all applicable nodes in this configuration since the availability group code is assigned in the pertinent storage types

  • Error while Creating form on remote Database

    Hi All
    I m getting error while creating form on remote database thru
    Database link
    Line/Column Error
    7099/21 PLS-00454: with a returning into clause, the table
    expression cannot be remote or a subquery
    7099/9 PL/SQL: SQL Statement ignored
    7749/16 PLS-00454: with a returning into clause, the table
    expression cannot be remote or a subquery
    7749/9 PL/SQL: SQL Statement ignored
    and statement at line specified is insert statement. and at end
    of insert statement Returning caluse is there as follows
    RETURNING ROWID INTO "_ROWID";
    This returning clause is causing error. Does anybody knows how
    to handel it??
    Thanks
    Yogesh

    Yogesh
    I haven't seen the ora-03116 problem.
    What version of Portal are you running? Are the databases at the same version? Does your table have longs or anything strange in it?
    Can you query the table via the synonyms and link in sqlplus as the application schema? This is a good test because it eliminates Portal.
    You should try setting up synonyms etc for the emp table. If you still get the problem then Oracle may be able to replicate it. If not, then there's sth funny about your table maybe.
    I agree with Vishnu about creating everything in sqlplus. I create all my links and synonyms in sqlplus. They are all public. I have 2 synonyms: one takes you over the link the other takes you to the right schema. It's flexible and it works.
    data database: D grants to P (local schema) on table T
    public syn T = D.T (sys) (get the right schema)
    portal dbase : public db link to data database connecting as P
    public syn T = T@dblink (sys) (over the link)
    P is a schema created in both databases.
    Test is: P in portal dbase can "select * from T" and gets the right data.
    I never, ever refer to a schema when defining a form. ie. never P.T or D.T or whatever. I always refer simply to a synonym. For the above my form would be defined simply on the table T.
    Hope this helps
    Greg

  • Error while creating the DWH tables using DAC

    Hi,
    I am getting error while creating the DWH tables using DAC. I have created a ODBC DSN using merant driver with DAC repository DB credentials and the test connection is successful. And while creating the tables i gave the olap dw credentials and the DSN name which i created earlier. But it throws the error as below:
    Please find the below mentioned error message
    =====================================
    STD OUTPUT
    =====================================
    CREATING SIEBEL DATABASE OBJECTS
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ******* /c DB_DAC /G "SSE_ROLE" /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b "" /K "" /X "" /W N
    Error while importing Siebel database schema.
    =====================================
    ERROR OUTPUT
    =====================================
    Siebel Enterprise Applications ODBC DDL Import Utility, Version 7.7 [18030] ENU
    Copyright (c) 2001 Siebel Systems, Inc. All rights reserved.
    This software is the property of Siebel Systems, Inc., 2207 Bridgepointe Parkway,
    San Mateo, CA 94404.
    User agrees that any use of this software is governed by: (1) the applicable
    user limitations and other terms and conditions of the license agreement which
    has been entered into with Siebel Systems or its authorized distributors; and
    (2) the proprietary and restricted rights notices included in this software.
    WARNING: THIS COMPUTER PROGRAM IS PROTECTED BY U.S. AND INTERNATIONAL LAW.
    UNAUTHORIZED REPRODUCTION, DISTRIBUTION OR USE OF THIS PROGRAM, OR ANY PORTION
    OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL BE
    PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER THE LAW.
    If you have received this software in error, please notify Siebel Systems
    immediately at (650) 295-5000.
    F:\DAC\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u infdomain /p ***** /c DB_DAC /G SSE_ROLE /f F:\DAC\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b /K /X /W N
    Connecting to the database...
    28000: [DataDirect][ODBC Oracle driver][Oracle]ORA-01017: invalid username/password; logon denied
    Unable to connect to the database...
    any help is appreciated.
    Thanks,
    RM

    The fact that you are getting an "ORA-01017: invalid username/password; logon denied" message indicates that you are at least talking to the database.
    The log shows that username "infdomain" is being used. Can you double check the username and password you have in DAC in a SQL*Plus/SQL Developer session?
    Please mark if useful/helpful,
    Andy.

  • Error while creating new projects using api

    Hello,
    I am having error while creating projects using standard api, PA_PROJECT_PUB.CREATE_PROJECTS. The error I am having is as follow.
    Source template ID is invalid.
    ===
    My code is as follow:
    SET SERVEROUTPUT ON SIZE 1000000
    SET VERIFY OFF
    define no=&amg_number
    DECLARE
    -- Variables used to initialize the session
    l_user_id NUMBER;
    l_responsibility_id NUMBER;
    cursor get_key_members is
    select person_id, project_role_type, rownum
    from pa_project_players
    where project_id = 1;
    -- Counter variables
    a NUMBER := 0;
    m NUMBER := 0;
    -- Variables needed for API standard parameters
    l_commit VARCHAR2(1) := 'F';
    l_init_msg_list VARCHAR2(1) := 'T';
    l_api_version_number NUMBER :=1.0;
    l_return_status VARCHAR2(1);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(2000);
    -- Variables used specifically in error message retrieval
    l_encoded VARCHAR2(1) := 'F';
    l_data VARCHAR2(2000);
    l_msg_index NUMBER;
    l_msg_index_out NUMBER;
    -- Variables needed for Oracle Project specific parameters
    -- Input variables
    l_pm_product_code VARCHAR2(30);
    l_project_in pa_project_pub.project_in_rec_type;
    l_key_members pa_project_pub.project_role_tbl_type;
    l_class_categories pa_project_pub.class_category_tbl_type;
    l_tasks_in pa_project_pub.task_in_tbl_type;
    -- Record variables for loading table variables above
    l_key_member_rec pa_project_pub.project_role_rec_type;
    l_class_category_rec pa_project_pub.class_category_rec_type;
    l_task_rec pa_project_pub.task_in_rec_type;
    -- Output variables
    l_workflow_started VARCHAR2(100);
    l_project_out pa_project_pub.project_out_rec_type;
    l_tasks_out pa_project_pub.task_out_tbl_type;
    -- Exception to call messag handlers if API returns an error.
    API_ERROR EXCEPTION;
    BEGIN
    -- Initialize the session with my user id and Projects, Vision Serves (USA0
    -- responsibility:
    select user_id into l_user_id
    from fnd_user
    where user_name = 'SSHAH';
    select responsibility_id into l_responsibility_id
    from fnd_responsibility_tl
    where responsibility_name = 'Projects Implementation Superuser';
    pa_interface_utils_pub.set_global_info(
    p_api_version_number => l_api_version_number,
    p_responsibility_id => l_responsibility_id,
    p_user_id => l_user_id,
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_return_status => l_return_status);
    if l_return_status != 'S' then
    raise API_ERROR;
    end if;
    -- Provide values for input variables
    -- L_PM_PRODUCT_CODE: These are stored in pa_lookups and can be defined
    -- by the user. In this case we select a pre-defined one.
    select lookup_code into l_pm_product_code
    from pa_lookups
    where lookup_type = 'PM_PRODUCT_CODE'
    and meaning = 'Conversion';
    -- L_PROJECT_IN: We have to provide values for all required elements
    -- of this record (see p 5-13, 5-14 for the definition of the record).
    -- Customers will normally select this information from some external
    -- source
    l_project_in.pm_project_reference := 'AGL-AMG Project &no';
    l_project_in.project_name := 'AGL-AMG Project &no';
    l_project_in.created_from_project_id := 1;
    l_project_in.carrying_out_organization_id := 2864; /*Cons. West*/
    l_project_in.project_status_code := 'UNAPPROVED';
    l_project_in.start_date := '01-JAN-11';
    l_project_in.completion_date := '31-DEC-11';
    l_project_in.description := 'Trying Hard';
    l_project_in.project_relationship_code := 'Primary';
    -- L_KEY_MEMBERS: To load the key member table we load individual
    -- key member records and assign them to the key member table. In
    -- the example below I am selecting all of the key member setup
    -- from an existing project with 4 key members ('EE-Proj-01'):
    for km in get_key_members loop
    -- Get the next record and load into key members record:
    l_key_member_rec.person_id := km.person_id;
    l_key_member_rec.project_role_type := km.project_role_type;
    -- Assign this record to the table (array)
    l_key_members(km.rownum) := l_key_member_rec;
    end loop;
    -- L_CLASS_CATEGORIES: commented out below should fix the error we get
    -- because the template does not have an assigment for the mandatory class
    -- 'BAS Test'
    l_class_category_rec.class_category := 'Product';
    l_class_category_rec.class_code := 'Non-classified';
    -- Assign the record to the table (array)
    l_class_categories(1) := l_class_category_rec;
    -- L_TASKS_IN: We will load in a single task and a subtask providing only
    -- the basic fields (see pp. 5-16,5-17,5-18 for the definition of
    -- the task record)
    l_task_rec.pm_task_reference := '1';
    l_task_rec.pa_task_number := '1';
    l_task_rec.task_name := 'Construction';
    l_task_rec.pm_parent_task_reference := '' ;
    l_task_rec.task_description := 'Plant function';
    -- Assign the top task to the table.
    l_taskS_in(1) := l_task_rec;
    -- Assign values for the sub task
    l_task_rec.pm_task_reference := '1.1';
    l_task_rec.pa_task_number := '1.1';
    l_task_rec.task_name := 'Brick laying';
    l_task_rec.pm_parent_task_reference := '1' ;
    l_task_rec.task_description := 'Plant building';
    -- Assign the subtask to the task table.
    l_tasks_in(2) := l_task_rec;
    -- All inputs are assigned, so call the API:
    pa_project_pub.create_project
    (p_api_version_number => l_api_version_number,
    p_commit => l_commit,
    p_init_msg_list => l_init_msg_list,
    p_msg_count => l_msg_count,
    p_msg_data => l_msg_data,
    p_return_status => l_return_status,
    p_workflow_started => l_workflow_started,
    p_pm_product_code => l_pm_product_code,
    p_project_in => l_project_in,
    p_project_out => l_project_out,
    p_key_members => l_key_members,
    p_class_categories => l_class_categories,
    p_tasks_in => l_tasks_in,
    p_tasks_out => l_tasks_out);
    -- Check the return status, if it is not success, then raise message handling
    -- exception.
    IF l_return_status != 'S' THEN
    dbms_output.put_line('Msg_count: '||to_char(l_msg_count));
    dbms_output.put_line('Error: ret status: '||l_return_status);
    RAISE API_ERROR;
    END IF;
    -- perform manual commit since p_commit was set to False.
    COMMIT;
    --HANDLE EXCEPTIONS
    EXCEPTION
    WHEN API_ERROR THEN
    FOR i IN 1..l_msg_count LOOP
    pa_interface_utils_pub.get_messages(
    p_msg_count => l_msg_count,
    p_encoded => l_encoded,
    p_msg_index => i,
    p_msg_data => l_msg_data,
    p_data => l_data,
    p_msg_index_out => l_msg_index_out);
    dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
    END LOOP;
    rollback;
    WHEN OTHERS THEN
    dbms_output.put_line('Error: '||sqlerrm);
    FOR i IN 1..l_msg_count LOOP
    pa_interface_utils_pub.get_messages(
    p_msg_count => l_msg_count,
    p_encoded => l_encoded,
    p_msg_index => i,
    p_msg_data => l_msg_data,
    p_data => l_data,
    p_msg_index_out => l_msg_index_out);
    dbms_output.put_line('ERROR: '||to_char(l_msg_index_out)||': '||l_data);
    END LOOP;
    rollback;
    END;
    ===
    Msg_count: 1
    Error: ret status: E
    ERROR: 1: Project: 'AGL-AMG Project 1123'
    Source template ID is invalid.
    PL/SQL procedure successfully completed.

    I was using a custom Application, which had a id other then 275 (which belongs to Oracle projects)

  • Error while creating MV replication group object

    Hi,
    I am getting error while creating replication group object. I tried to create using OEM and SQLPlus
    OEM error
    This error while creating M.V. rep. group object
    There is a table or view named SCOTT.EMP.
    It must be dropped before a materialized view can be created.
    In SQLPLUS
    SQL> CONNECT MVIEWADMIN/MVIEWADMIN@SWEET
    Connected.
    SQL>
    SQL> BEGIN
    2 DBMS_REPCAT.CREATE_MVIEW_REPOBJECT (
    3 gname => 'SCOTT',
    4 sname => 'KARTHIK',
    5 oname => 'emp_mv',
    6 type => 'SNAPSHOT',
    7 min_communication => TRUE);
    8 END;
    9 /
    BEGIN
    ERROR at line 1:
    ORA-23306: schema KARTHIK does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 2840
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 773
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 5570
    ORA-06512: at "SYS.DBMS_REPCAT_SNA", line 82
    ORA-06512: at "SYS.DBMS_REPCAT", line 1332
    ORA-06512: at line 2
    Please not already I have created KARTHIK schema.

    Arthik,
    I think I know what may have happened.
    As I can see you are trying to create support for an updateable materialized view.
    You have to make sure the name of the schema that owns the materialized view is the same as the schema owner of the master table (at master site).
    From the code you have shown, I bet the owner of table EMP is SCOTT.
    From the other hand, you want to create materialized view EMP_MV under schema KARTHIK that refers to table SCOTT.EMP at master site.
    According to the documentation, the schema name used in DBMS_REPCAT.CREATE_MVIEW_REPOBJECT must be same as the schema that owns the master table.
    Please check the documentation at the link below
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rarrcatpac.htm#i109228
    I tried to reproduce your example in my environment, and I got exactly the same error which actually confirms my assumption that the reason for the error is the fact that you tried to create the materialized view in a schema with different name than the one where master table exists.
    I'll skip some of the steps that I used to create the replication environment.
    I have two databases, DB1.world and DB2.world
    On DB2.world I will generate replication support for table EMP which belongs to user SCOTT
    SQL> conn scott/*****@DB2.world
    Connected.
    SQL>create materialized view log on EMP with primary key;
    Materialized view log created.
    SQL>
    SQL>conn repadmin/*****@DB2.world
    Connected.
    SQL>BEGIN
      2       DBMS_REPCAT.CREATE_MASTER_REPGROUP(
      3         gname => 'GROUPA',
      4         qualifier => '',
      5         group_comment => '');
      6*   END;
    PL/SQL procedure successfully completed.
    SQL>BEGIN
      2       DBMS_REPCAT.CREATE_MASTER_REPOBJECT(
      3         gname => 'GROUPA',
      4         type => 'TABLE',
      5         oname => 'EMP',
      6         sname => 'SCOTT',
      7         copy_rows => TRUE,
      8         use_existing_object => TRUE);
      9*   END;
    10  /
    PL/SQL procedure successfully completed.
    SQL> BEGIN
      2       DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT(
      3         sname => 'SCOTT',
      4         oname => 'EMP',
      5         type => 'TABLE',
      6         min_communication => TRUE);
      7    END;
      8  /
    PL/SQL procedure successfully completed.
    SQL>execute DBMS_REPCAT.RESUME_MASTER_ACTIVITY(gname => 'GROUPA');
    PL/SQL procedure successfully completed.
    SQL> select status from dba_repgroup;
    STATUS                                                                         
    NORMAL                                                                          Now let's create updateable materialized view at DB1. Before that I want to let you know that I created one sample in DB1 user named MYUSER. MVIEWADMIN is Materialized View administrator.
    SQL>conn mviewadmin/****@DB1.world
    Connected.
    SQL>   BEGIN
      2       DBMS_REFRESH.MAKE(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => '',
      5         next_date => SYSDATE,
      6         interval => '/*1:Hr*/ sysdate + 1/24',
      7         push_deferred_rpc => TRUE,
      8         refresh_after_errors => TRUE,
      9         parallelism => 1);
    10    END;
    11  /
    PL/SQL procedure successfully completed.
    SQL>   BEGIN
      3       DBMS_REPCAT.CREATE_SNAPSHOT_REPGROUP(
      5         gname => 'GROUPA',
      7         master => 'DB2.wolrd',
      9         propagation_mode => 'ASYNCHRONOUS');
    11    END;
    12  /
    PL/SQL procedure successfully completed.
    SQL>conn myuser/*****@DB1.world
    Connected.
    SQL>CREATE MATERIALIZED VIEW MYUSER.EMP_MV
      2    REFRESH FAST
      3    FOR UPDATE
      4    AS SELECT EMPNO, ENAME, JOB, MGR, SAL, COMM, DEPTNO, HIREDATE
      5*      FROM   [email protected];
    Materialized view created.
    SQL>conn mviewadmin/******@DB1.world
    Connected.
    SQL> BEGIN
      2       DBMS_REFRESH.ADD(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => 'MYUSER.EMP_MV',
      5         lax => TRUE);
      6    END;
      7  /
    PL/SQL procedure successfully completed.And now lets run CREATE_MVIEW_REPOBJECT.
    SQL>   BEGIN
      2       DBMS_REPCAT.CREATE_MVIEW_REPOBJECT(
      3         gname => 'GROUPA',
      4         sname => 'MYUSER',
      5         oname => 'EMP_MV',
      6         type => 'SNAPSHOT',
      7         min_communication => TRUE);
      8    END;
      9  /
      BEGIN
    ERROR at line 1:
    ORA-23306: schema MYUSER does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 2840
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 773
    ORA-06512: at "SYS.DBMS_REPCAT_SNA_UTL", line 5570
    ORA-06512: at "SYS.DBMS_REPCAT_SNA", line 82
    ORA-06512: at "SYS.DBMS_REPCAT", line 1332
    ORA-06512: at line 3 I reproduced exactly the same error message.
    So the problem is clearly in the schema name that owns the materialized view.
    Now lets see if what would happen if I create the MV under schema SCOTT which has the same name as the schema on DB2.world where the master table exists.
    SQL>conn scott/****@DB1.world
    Connected.
    SQL>CREATE MATERIALIZED VIEW SCOTT.EMP_MV
      2    REFRESH FAST
      3    FOR UPDATE
      4    AS SELECT EMPNO, ENAME, JOB, MGR, SAL, COMM, DEPTNO, HIREDATE
      5*      FROM   [email protected];
    Materialized view created.
    SQL>conn mviewadmin/******@DB1.world
    Connected.
    SQL> BEGIN
      2       DBMS_REFRESH.ADD(
      3         name => 'MVIEWADMIN.MV_REFRESH_GROUPA',
      4         list => 'SCOTT.EMP_MV',
      5         lax => TRUE);
      6    END;
      7  /
    PL/SQL procedure successfully completed.And now lets run CREATE_MVIEW_REPOBJECT.
    SQL>   BEGIN
      2       DBMS_REPCAT.CREATE_MVIEW_REPOBJECT(
      3         gname => 'GROUPA',
      4         sname => 'SCOTT',
      5         oname => 'EMP_MV',
      6         type => 'SNAPSHOT',
      7         min_communication => TRUE);
      8    END;
    PL/SQL procedure successfully completed.As you can see everything works fine when the name of the schema owner of the MV at DB1.world is the same as the schema owner of the master table at DB2.world .
    -- Mihajlo
    Message was edited by:
    tekicora

Maybe you are looking for