Error creating job into trigger using DBMS_SCHEDULER.

Hi,
I am trying to create job using dbms_scheduler package. I have one trigger on insert event on one table. I am creating job using following syntax.
CREATE OR REPLACE TRIGGER TRG_BI_JOB_CONFIG BEFORE INSERT ON JOB_CONFIG FOR EACH ROW
DECLARE
BEGIN
     DBMS_SCHEDULER.Create_Job(job_name => 'my_job1'
                         ,job_type => 'PLSQL_BLOCK'
                         ,job_action => 'delete_temp'
                         ,start_date => TO_DATE('15-JUL-2003 1:00:00 AM', 'dd-mon-yyyy hh:mi:ss PM')
                              ,repeat_interval => 'FREQ=DAILY'
                         ,enabled => TRUE
                         ,comments => 'DELETE FOR job schedule.');
EXCEPTION
WHEN OTHERS THEN RAISE;
END;
but I am getting following error while inserting into JOB_CONFIG table.
ORA-04092: cannot in a trigger
ORA-06512: at "PRAKASH1.TRG_BI_JOB_CONFIG", line 41
ORA-04088: error during execution of trigger
same above statement If I am running from sqlplus then It is creating job without error. If I am creating job using DBMS_JOB into trigger then It is also working fine but this package is depricated from oracle10g so I cannt use it any more.
My Oracle version is 'Oracle DATABASE 10g RELEASE 10.2.0.1.0 - Production'.
can anyone help me in this context.

I have a few comments on this thread as an Oracle dbms_scheduler developer.
- Oracle takes backward compatibility very seriously. Although dbms_job is deprecated, the interface will continue to work indefinitely. The deprecation of dbms_job is so that customers will be encouraged to take advantage of the more powerful dbms_scheduler. It is extremely unlikely that entire blocks of functionality will ever be removed. There is currently no plan to remove dbms_job functionality (and even if there were, doing so would be strenuously opposed by many users).
- lots of internal Oracle database components are standardizing on using dbms_scheduler (resource manager, materialized views, auto sql tuning etc). This is good evidence that it will continue to be the recommended scheduling method for the foreseeable future - not even the concept of a replacement exists. It is also under active development.
- The reason for the automatic commit is that a dbms_scheduler job is a full database object like a stored procedure or a table. So a call to dbms_scheduler.create_job is like executing a DDL which takes effect immediately. A dbms_job job is mostly just a row in a table so a call to dbms_job.submit behaves like regular DML. There are many advantages to a job being a full database object but DDL behaviour is an unfortunate requirement of this.
Hope this clears a few things up, reply with any questions.
-Ravi

Similar Messages

  • Error creating job in oracle

    I'm having a problem creating a job in oracle . I want at the end of each day to put some values from table1 in table2, empty table1, and then delete and re-create some sequences..because I have auto-increment id and each day I want to sequence to start from 0 again. So long story short I tried creating this job using toad for oracle.
    if I just put the first 2 tasks(put data from table1 in table 2, then delete) in the job it works like a charm. if I also add the drop sequence, create sequence I get an error saying
    Encountered the symbol "DROP" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    so this is what I want the job to do:
    insert into A(a,b,c) select a2,b2,c2 from B;
    delete from A;(so far it would work)
    drop sequence ida_seq;
    create sequence ida_seq
    start with 1
    increment by 1
    nomaxvalue;
    drop sequence idb_seq;
    create sequence idb_seq
    start with 1
    increment by 1
    nomaxvalue;
    so anybody can give me a clue on why I get the error? maybe if someone can give me a link on how to do oracle jobs..cause if I google "oracle+job" I get only jobs(for work) in oracle...but I don't get stuff related to syntax and how to create jobs in oracle. 10x in advance

    If this is a PL/SQL question, then PL/SQL has no 'DROP' or 'CREATE' keywords and you would need to use dynamic SQL with EXECUTE IMMEDIATE.
    btw there are various techniques around for resetting a sequence to start again at 1 using ALTER SEQUENCE, rather than dropping and recreating it.

  • Error While loading into BW using infoPackage

    Hi All,
    While following directions posted at the following wiki page https://wiki.sdn.sap.com/wiki/display/BOBJ/ConfiguretheLoadJobinBW%28DS+3.2%29,
    we get an error while loading data into BW using infoPackage via Data services 3.2
    In SAP BI side Error says :"Error while executing the following command:  -sJO return code:220"
    On DS side for the RFC server log we get the error" Error while executing the following command -sJOB_SQL_TO_DBI -Ubbu -P;(encrypted password) -A (encryted information) -VMODE=F"
    Issue is still open with support as we still cannot excute the job from infopackage. it is succesfully executed from designer, admin console, batch file.
    Any insights/help would be appreciated.
    Thanks.
    Edited by: rana_accn on Jan 26, 2010 6:48 PM

    Sure I will.
    One thing we have noticed is that in the server_eventlog parameter for the  log line "Starting job with command line parameters are different"
    When job is executed from DS side parameters -Ct -Cm -Ca -Cj -Cp -S -N -Q -U -P -G -r -T -Locale are used
    When job is executed from BW side parameters -Ct -Cm -Ca -Cj -Cp -s -N -Q are used
    Also when the job is executed from BW,  log files start getting created but then trace and error file show an error that cannot open database - and that points to DSCentral repository.This repository is not even mapped to the job server and the job has been exported from the correct repository as command line execution of the job works perfectly fine.
    Thnx
    Just an update we were not able to figure out why this happened in the existing environment. One reason given was that somehow the commands which were being executed from BW side were getting corrupted. We had to build a new environment and this is no longer an issue in the new environment, as now all jobs can be executed from BW. Only difference between the 2 environments was we are now on 12.2.1.3 while earlier we were on 12.2.0.0.
    Edited by: rana_accn on Mar 23, 2010 10:21 PM
    Edited by: rana_accn on Apr 29, 2010 9:46 PM

  • "unknown error" creating a Messages account using AIM

    I had a perfectly good AIM account and password yet whenever I tried creating an account in Messages using AOL type account, I got the error "An unknown error has occurred". It also happened when I tried to add the AIM account in SystemPreferences->Internet Accounts.
    SOLUTION: In my case the email address for the AIM account was a yahoo.com email address.  The same email address was used for the Yahoo Internet Account in system preferences. Creating another AIM account using a gmail.com address solved the problem. YMMV

    Hi,
    If it is an AIM Name or a email used at/registered with AIM then it pays to check here https://settings.aim.com/ to see if the account has been suspended.
    9:33 pm      Sunday; July 20, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Error creating groups in SCSM using PowerShell

    Hello Everyone,
    I am trying to create a bunch of groups and queues within SCSM to seperate work items and CIs from different customers. For example, I have started off by entering the console and creating a group called "Company 1" in my groups (found in Library).
    "Company 1" group defines dynamic members of this group by specifying the following query: The "Active Directory" class, if the Users Company field contains value "Company 1" then add to the group.
    I also need to create a Queue containing all work items for "Company 1".
    I can generate a list of all the company's to enter in a csv, and know enough powershell to import it and read the file line by line
    However, I am having trouble creating the objects. My method was:
    #Get the name of the class I want to create an object of and store it in a variable
    $groupClass = Get-SCSMClass -Name "Microsoft.SystemCenter.ConfigItemGroup$"
    #Return the variable stored to ensure this part is working (Debug purposes)
    $groupClass
    #Get the active status of an object and store it in a variable
    $objStatus = Get-SCSMEnumeration -Name System.ConfigItem.ObjectStatusEnum.Active
    #Return the variable stored to ensure this part is working (Debug purposes)
    $objStatus
    #Create the object stored in my class variable and modify the DisplayName and ObjectStatus properties.
    New-SCSMObject -Class $groupClass -PropertyHashtable (@{DisplayName = "Test"; ObjectStatus = $objStatus;}) -Debug -Verbose
    Once I got this code working my idea was to read from csv and loop the creation process. However, I keep getting the error: "Cannot create objects of an abstract class"
    Am I using the incorrect class to create a group? If so, what is the correct class to select? Is there a more efficient method to do this? Any ideas at all please share, thank you in advance :)

    @Aaron
    Sorry for the late response, I went on vacation and just returned. So basically, I ended up making all these groups manually since I could not find a way to automate the discovery rule creation through script.
    I am now trying to create queues for each of these clients, one queue for each type of work item. I'm working with a client list of around 100, so that means creating almost 300 queues. This would be crazy to do manually - So I began working on a script
    to do this.
    This is what I have come up with:
    # Script Written by SirLearnAlot
    # January 2015
    # Revision 2
    # Get required queues categories (classes)
    $incident = Get-SCSMClass -Name "System.WorkItem.Incident$"
    $RMA = Get-SCSMClass -Name "COMPANY.RMA.Class$"
    $MACD = Get-SCSMClass -Name "System.WorkItem.ServiceRequest$"
    # ManagementPack to store queues in (MP Must be created through PS or else will throw error)
    $MP = Get-SCManagementPack -Name "COMPANY.Queues"
    # Import list of customers (names for the queues)
    $content = Get-Content 'C:\Users\portalservice\Desktop\list.txt'
    foreach ($customer in $content){
    New-SCQueue -Verbose -Name "Incident - $customer" -class $incident -ManagementPack $MP -Filter "Customer_List -eq '$customer'";
    New-SCQueue -Verbose -Name "RMA - $customer" -class $RMA -ManagementPack $MP -Filter "Customer_List -eq '$customer'";
    New-SCQueue -Verbose -Name "MACD - $customer" -class $MACD -ManagementPack $MP -Filter "Customer -eq '$customer'"}
    However I kept running into errors.
    I realized I needed to point the Customer_List found in the incident class to the other two classes, so I had to re-author them to add the customer field and point towards the incident MP to retrieve the enum. I did this successfully with Service Requests,
    but am having trouble applying the same concept to my "RMA" class.
    I have tested the code with both Incidents and Service Requests now and can successfully create the queues correctly, but need to fix my RMA class to complete the task.
    I now cannot seal my MP because I keep running into errors (I am sure I made a typo somewhere or am missing some line or something)
    Any help would be appreciated I am getting extremely frustrated!

  • Error while insert into database using DB adpater for Field BLOB

    Hello All
    I am trying to tranfer data from Database A to Database B using Oracle DB adapter.
    Table of databse A contains field BLOB, which cotains the resume /doc file.After transformation in Database B format ,while invoking the DB adapter to insert, I am getting follwing error
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>null</code>
    </part><part name="summary"><summary>file:/u01/bpelvinc/product/10.1.3.1/OracleAS_1/bpel/domains/viapps/tmp/.bpel_ERecuit_Application_New_1.0_d1c2b2149a9e0c7c745279667ad1fc84.tmp/DB_APPL_111.wsdl [ DB_APPL_111_ptt::insert(RtmApplicantCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
    ; nested exception is:
         ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    insert failed. Descriptor name: [DBAPPL111.RtmApplicant]. [Caused by: Error in encoded stream, got 2]
    Caused by Exception [TOPLINK-3001] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)): oracle.toplink.exceptions.ConversionException
    Exception Description: The object [xs:base64Binary 43524541544520544193B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
    Internal Exception: java.io.IOException: Error in encoded stream, got 2.
    </summary>
    </part><part name="detail"><detail>
    Exception Description: The object [xs:base64Binary 4352E616D65293B0D0A], of class [class java.lang.String], could not be converted to [class java.sql.Timestamp].
    Internal Exception: java.io.IOException: Error in encoded stream, got 2</detail>
    </part></bindingFault>
    Please let me know ,what are the possibilities.
    Thanks
    Satendra

    Hi...
    well... My flow goes like Pl/SQl ---> BPEL,
    Now PL/SQL code reads data from the Database A and Send it to BPEL which inserts into the Database B.
    with respest to above design, I found the problem in pl/sql block.
    Actually I am sending a BLOB field in the soap message. but some how pl/sql now ablt tot handle that or sending some wrong data.
    my question is how to send a blob filed data to bpel using pl/sql block. this the reasion I am getting above error.
    Thanks

  • Error creating materialized view log using DBlink

    Hi guys,
    I have 2 databases in diferent machines . (machine A and B)
    Machine A is my production database and I have a database link in machine B accessing Machine A
    CREATE MATERIALIZED VIEW vm_test
    BUILD IMMEDIATE
    REFRESH FAST ON commit as
    select * from test@A
    -- no problem in this first operation the materialized view was created sucessfully
    Now I need to create the LOG
    SQL> CREATE MATERIALIZED VIEW LOG ON test
    2 PCTFREE 5
    3 TABLESPACE prodemge_2006
    4 STORAGE (INITIAL 10K NEXT 10K);
    CREATE MATERIALIZED VIEW LOG ON test
    ERROR at line 1:
    ORA-02050: transaction 5.21.8771 rolled back, some remote DBs may be in-doubt
    ORA-02068: following severe error from A
    ORA-03113: end-of-file on communication channel
    What could be causing this error ?
    Thank you,
    Felipe

    ORA-02050 transaction string rolled back, some remote DBs may be in-doubt
    Cause: Network or remote failure during a two-phase commit.
    Action: Notify operations; remote databases will automatically re-sync when the failure is repaired.
    ORA-02068 following severe error from stringstring
    Cause: A severe error (disconnect, fatal Oracle error) was received from the indicated database link. See following error text.
    Action: Contact the remote system administrator.
    M.S.Taj

  • SQLLDR Using DBMS_SCHEDULER

    hi dear
    i am using sqlldr from sql with dbms_scheduler.create_job but facing some problem elow is the code
    this is the schedule for my job
    BEGIN
    DBMS_SCHEDULER.CREATE_SCHEDULE (
    schedule_name => 'INSERT_SCHD'
    ,start_date => sysdate
    ,end_date => null
         ,repeat_interval => 'FREQ=MINUTELY; INTERVAL=10'
         ,comments => 'Check for Insert Minutly schedule'
    END;
    below is the job
    BEGIN
    DBMS_SCHEDULER.Create_Job(job_name => 'Host',
                   schedule_name => 'INSERT_SCHD',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
                   HOST (SQLLDR CRUDEOIL/CRUDEOIL10G@KHIDEV CONTROL=c:\junaid\jobs\loads.ctl log=c:\load.log);
                   end;',
    enabled => true);
    END;
    when i run this job
    exec dbms_scheduler.run_job('host');
    i am facing this error can some one help me out please
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [17090], [], [], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 1
    or any other way to load data from csv file into table using dbms_scheduler please tell me the code thanks
    Junaid

    I have also tried with the following script , did changes as per ur suggestion. Still unable to run through scheduled job. Script is running successfully from command prompt of both "root" and "oracle" user. I have set highest Permissions of 777. Getting Error ORA -27369: job of type EXECUTABLE failed with exit code: No such file or directory
    #! /bin/sh
    export ORACLE_SID=orcl
    export PATH=$PATH:$HOME/bin
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin
    export ORACLE=oracle
    if [ $USER = "root" ]; then
    su - "$ORACLE"<<EOO
    export ORACLE_SID=orcl
    export PATH=$PATH:$HOME/bin
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$PATH:$ORACLE_HOME/bin
    cd /u01/app/oracle/product/11.2.0/db_1/bin/
    sqlldr \'sys/sys as sysdba\' control=/u01/app/customer.ctl log=/u01/app/customer.log
    EOO
    else
    sqlldr \'sys/sys as sysdba\' control=/u01/app/customer.ctl log=/u01/app/customer.log
    fi

  • I'm trying to create a Windows partition using Boot Camp. An error comes up telling me that I need to reformat my current partition(s) into one single partition. However, it's already formatted in the correct format, and is already a single partition.

    As made clear in the title:
    I'm trying to create a Windows partition using Boot Camp. An error comes up telling me that I need to reformat my current partition(s) into one single partition. However, it's already formatted in the correct format, and is already a single partition.
    My computer recently had a kernel panic, which apparently the corruption was in the system and needed to be erased and re-installed. I have a complete back-up using an external hard drive, and I am definitely not willing to do another one of those to reformat a partition that is already singular. I restarted the computer after ejecting my back-up, and after turning off time machine (thinking that boot camp was recognizing it as a secondary partition), however the error still occurs.
    Is there any way to get around this?

    diskutil list:
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *750.2 GB   disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            749.3 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                            Windows7               *2.9 GB     disk1
    diskutil cs list:
    No CoreStorage logical volume groups found
    mount:
    /dev/disk0s2 on / (hfs, local, journaled)
    devfs on /dev (devfs, local, nobrowse)
    map -hosts on /net (autofs, nosuid, automounted, nobrowse)
    map auto_home on /home (autofs, automounted, nobrowse)
    /dev/disk1 on /Volumes/Windows7 (udf, local, nodev, nosuid, read-only, noowners)
    From my very basic knowledge - it still looks as if there is only one partition (not including the windows 7 CD necessary to install the windows partition).

  • Errors using dbms_scheduler instead of dbms_job

    Hello,
    I'm looking for some help using the dbms_scheduler in Oracle 10g. Up until recently, we have been happily submitting jobs in Oracle using the dbms_job.submit() command without problems. Due to this now becoming deprecated in release 10g and beyond we are looking to make use of the new dbms_scheduler.create_job() functionality. However, when trying to convert from dbms_job to dbms_scheduler, I keep getting errors when trying to run the stored procedure. I'm sure I must be missing something obvious but I just cannot put my finger on it at present.
    The set up using dbms_job is as follows:
    We have a procedure (called PRODCEURE_A) that is called directly from our code and included in the procedure is a call to dbms_job that submit a job to run PROCEDURE_C which in turn calls a PROCEDURE_B. For example PRODCEURE_A is created as follows:
    create or replace procedure PRODCEURE_A AS
    jobnum number;
    row_count number;
    current_value_date DATE;
    snapshot_id Number;
    BEGIN
    row_count :=0;
         BEGIN
              /* Fetch current value date and snapshot number */
              SELECT COL_A, (COL_A- COL_B)
              INTO current_value_date, snapshot_id
              FROM TABLE_A
              WHERE COL_C= 0;
              /* delete records from TABLE_A table that are older than 40 days */
              DELETE TABLE_A WHERE COL_A < current_value_date - 40;
              /* ensure that are no records in TABLE_A for the current settlement date */
              select count(*) into row_count
              from TABLE_A
              where COL_A = current_value_date;
              /* Insert all the Date snapshot jobs into TABLE_Awith initial status as NS */
              if row_count < 1 then
              Begin
                   insert into TABLE_A values (1, 'PROCEDURE_B', current_value_date, NULL, NULL, 'NS', NULL);
                   /* Submit the oracle job spst_execute_date_snapshot to run asynchronously */
                   dbms_job.submit(jobnum, 'PROCEDURE_C ('||''''||current_value_date||''''||', ' || snapshot_id || ');');
              End;
              END IF;
         END;
    END;
    This works without problems. A job is created and PROCEDURE_C is duly executed. I attempt to change dbms_job to dbms_scheduler as below:
    create or replace procedure PRODCEURE_A AS
    jobnum number;
    row_count number;
    current_value_date DATE;
    snapshot_id Number;
    BEGIN
    row_count :=0;
         BEGIN
              /* Fetch current value date and snapshot number */
              SELECT COL_A, (COL_A- COL_B)
              INTO current_value_date, snapshot_id
              FROM TABLE_A
              WHERE COL_C= 0;
              /* delete records from TABLE_A table that are older than 40 days */
              DELETE TABLE_A WHERE COL_A < current_value_date - 40;
              /* ensure that are no records in TABLE_A for the current settlement date */
              select count(*) into row_count
              from TABLE_A
              where COL_A = current_value_date;
              /* Insert all the Date snapshot jobs into TABLE_A with initial status as NS */
              if row_count < 1 then
              Begin
                   insert into TABLE_A values (1, 'PRODCEURE_B', current_value_date, NULL, NULL, 'NS', NULL);
                   /* Submit the oracle job spst_execute_date_snapshot to run asynchronously */
              dbms_scheduler.create_job(
    job_name => '"JOB_NAME"',
    job_type => 'STORED_PROCEDURE',
    job_action => 'PRODCEURE_C('||''''||current_value_date||''''||', ' || snapshot_id || ');',
    enabled => TRUE);
              End;
              END IF;
         END;
    END;
    However, when trying the above I get the following error:
    ORA-27452: PROCEDURE_C('22-JUL-09', 2494); is an invalid name for a database object
    When I attempt to change job_type from 'STORED_PROCEDURE' to PLSQL_BLOCK as follows:
    create or replace procedure PRODCEURE_A AS
    jobnum number;
    row_count number;
    current_value_date DATE;
    snapshot_id Number;
    BEGIN
    row_count :=0;
         BEGIN
              /* Fetch current value date and snapshot number */
              SELECT COL_A, (COL_A- COL_B)
              INTO current_value_date, snapshot_id
              FROM TABLE_A
              WHERE COL_C= 0;
              /* delete records from TABLE_A table that are older than 40 days */
              DELETE TABLE_A WHERE COL_A < current_value_date - 40;
              /* ensure that are no records in TABLE_A for the current settlement date */
              select count(*) into row_count
              from TABLE_A
              where COL_A = current_value_date;
              /* Insert all the Date snapshot jobs into TABLE_A with initial status as NS */
              if row_count < 1 then
              Begin
                   insert into TABLE_A values (1, 'PRODCEURE_B', current_value_date, NULL, NULL, 'NS', NULL);
                   /* Submit the oracle job spst_execute_date_snapshot to run asynchronously */
              dbms_scheduler.create_job(
    job_name => '"JOB_NAME"',
    job_type => PLSQL_BLOCK',
    job_action => 'BEGIN PRODCEURE_C('||''''||current_value_date||''''||', ' || snapshot_id || '); END;',
    enabled => TRUE);
              End;
              END IF;
         END;
    END;
    This gives the following error:
    ORA-02089: COMMIT is not allowed in a subordinate session
    I'm stumped by both of these errors. Firstly, why should I get an error reported that the PROCEDURE_C is an invalid name? It lives in the user's schema that is running PROCEDURE_A (and so submitting the scheduled job?)
    Secondly, why the COMMIT error when running as a PLSQL_BLOCK? I can't see any commit is used within the procedure itself.
    Any help would be welcomed. If more info required, please let me know.
    Thank you.

    One question.
    Are you aware that DBMS_SCHEDULER will do a commit for you?
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:25405608521707
    umm, dbms_job does not commit.
    A job when run will have it's transaction ended. That is expoected, normal, correct.
    But when you CALL dbms_job - to submit a job - dbms_job.submit DOES NOT COMMIT.
    So, no, dbms_job does not commit.
    So that would break your existing transaction (if you replaced dbms_job with dbms_scheduler). If you're ok with that then your issue is still pertinent, if not, then it's obviated by you not being able to use dbms_scheduler :D)

  • Unable to register XSD into Oracle using trigger / procedure

    Hi,
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production.
    I have a table which stores XSD and i need to register this XSD. I am able to register the XSD if dbms_schema is executed from PLSQL anonymous block. But if i mention the same code in trigger / procedure is not working . Getting the error as insufficient privileges.
    Table, trigger and procedure are in same schema. This schema has all the privs required for XSD registration globally.
    create table t_vkk ( n number, xsd xmltype)
    alter table t_vkk add active varchar2(1)
    create sequence seq_vkk start with 1 increment by 1
    CREATE OR REPLACE TRIGGER TRG_t_vkk_xsd
    AFTER INSERT OR UPDATE
    ON t_vkk
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    BEGIN
    IF INSERTING AND :new.active = 'Y'
    THEN
    prc_reg_xsd(:new.n, :new.xsd);
    END IF;
    -- Applied when updating rows in the table
    IF UPDATING
    THEN
    IF :new.active = 'Y' -- XSD re-registration since template id is still active
    THEN
    prc_reg_xsd(:old.n, :old.xsd);
    ELSIF :new.active = 'N' -- XSD de-registration
    THEN
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => :old.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    END IF;
    END IF;
    END TRG_t_vkk_xsd;
    This fails -
    insert into t_vkk
    values (0,XMLTYPE(
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
    <xsd:element name="books" type="bks:BooksForm"/>
    <xsd:complexType name="BooksForm">
    <xsd:sequence>
    <xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookForm">
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="pub_date" type="xsd:date"/>
    <xsd:element name="review" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>'
    ), 'Y')
    This works :
    After inserting the record into t_vkk (Trigger is disabled)
    declare
    begin
    for x in (select * from t_vkk)
    loop
    dbms_output.put_line (x.xsd.getstringval());
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => x.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => x.n
    , schemadoc => x.xsd
    , local => false);
    end loop;
    end;
    This Fails:
    create or replace procedure prc_reg_xsd
    as
    begin
    for x IN (select * from t_vkk)
    loop
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => x.n
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    NULL; -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => x.n
    , schemadoc => x.xsd
    , local => false);
    end loop;
    end;
    BEGIN
    prc_reg_xsd;
    END;
    -Vinod K

    Thanks everyone. I got the solution from one of my colleague. I can invoke dbms_xmlschema.registerschema through my standalone procedure by using current_user authid.
    create or replace procedure prc_reg_xsd
    (in_id IN NUMBER
    , in_xsd IN XMLTYPE)
    authid current_user
    as
    begin
    dbms_output.put_line (' startd');
    BEGIN
    dbms_xmlschema.deleteschema (
    schemaurl => in_id
    , delete_option => dbms_xmlschema.delete_cascade_force
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line (' Failed'); -- This XSD was not registered
    END;
    dbms_xmlschema.registerschema (schemaurl => in_id
    , schemadoc => in_xsd
    , local => false);
    dbms_output.put_line (' done');
    end;
    DECLARE
    x number:=9;
    t xmltype := XMLTYPE(
    '<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:books" xmlns:bks="urn:books">
    <xsd:element name="books" type="bks:BooksForm"/>
    <xsd:complexType name="BooksForm">
    <xsd:sequence>
    <xsd:element name="book" type="bks:BookForm" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookForm">
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float"/>
    <xsd:element name="pub_date" type="xsd:date"/>
    <xsd:element name="review" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>');
    BEGIN
    prc_reg_xsd(x,t);
    END;
    This worked for me. The procedure is in the same schema which has XDBADMIN role. So i am able to register the XSD.
    Vinod

  • PLS-00428 Error when creating a new trigger

    Hi,
    I'm encountering the PLS-00428 error when I run the script below.
    CREATE OR REPLACE TRIGGER TIBCOUSER.po_response_trigger
    BEFORE INSERT ON po_response FOR EACH ROW
    BEGIN
    IF:NEW.ariba_processsequence is null then
    SELECT pttransid AS pttransid, 'Product Test Pass 1' AS pttransname, aribaorderid AS aribaorderid, '0' AS errorcode, '' AS MESSAGE, SYSDATE AS ariba_insertdate
    FROM po_request
    WHERE adb_l_delivery_status = 'N';
    UPDATE po_request
    SET adb_l_delivery_status = 'C'
    WHERE adb_l_delivery_status = 'N';
    END IF;
    END;
    Can someone point out what is missing or what is wrong with the script? Any help would be much appreciated.
    Regards,
    Jigger

    Hi Jigger,
    I was able to create the trigger using the script below.That's nice, you got the trigger created. Below is your trigger, I have added some comments.
    create or replace trigger tibcouser.po_response_trigger
       before insert or update
       on po_response
       for each row
    declare
      -- 1. These variables should really be anchored to po_response
      -- 2. They should be named differently than columns in po_response
      -- 3. It seems that you don't need them (See 7.)
       pttransid               integer := null;
       pttransname             varchar2(255) := null;
       aribaorderid            varchar2(255) := null;
       errorcode               integer := null;
       message                 varchar2(255) := null;
       ariba_insertdate        date := null;
       adb_l_delivery_status   char(1) := null;
    begin
      -- 4. This is never true, since adb_l_delivery_status is null, here
          -- So, I guess your trigger never does anything, so in a sense it works
       if (adb_l_delivery_status = 'N')
       then
        -- 5. This select  will raise too_many_rows, when there is more than one record in po_response.
        -- 6. It seems you will have a problem with mutating table
        -- 7. The select doesn't do anything, you never use any of the values selected
        -- 8. The select is confusing, since variables are named equally to columns
        -- 9. You select constants, why not just assign them right away
        select pttransid
                ,pttransname
                ,aribaorderid
                ,'0'
                ,sysdate
            into pttransid
                ,pttransname
                ,aribaorderid
                ,errorcode
                ,message
                ,ariba_insertdate
            from po_response;
          -- 10. This update will update ALL records in po_request, probably not what you want.
          update po_request
             set adb_l_delivery_status = 'C';
       end if;
    -- 11. Good practise dictates end po_response_trigger;
    end;
    /In general, when you think your post has been answered, then kindly mark it as such.
    Regards
    Peter

  • Error in Job created to convert assest content to MP4 format in Windows Azure Media Service

    Hi,
    I am have created application which create media service channel and use Wirecast for live streaming on the channel. once event is completed video should be available for downloading.
    I have created job to convert asset content to MP4 format, job is created but with error:
    AssetFile's name doesn't match the blob file name, the AssetFile's name is not well formed or the blob file is not present in the Asset's container.
    Below is the code for job creation:
     var outputAsset = _context.Assets.Where(p => p.Name == "Demo18032015_DefaultProgram").FirstOrDefault();
                IAsset encodedAsset =
                    EncodeToAdaptiveBitrateMP4s(outputAsset, AssetCreationOptions.None);
    static public IAsset EncodeToAdaptiveBitrateMP4s(IAsset asset, AssetCreationOptions options)
                // Prepare a job with a single task to transcode the specified asset
                // into a multi-bitrate asset.
                IJob job = _context.Jobs.CreateWithSingleTask(
                    MediaProcessorNames.AzureMediaEncoder,
                    MediaEncoderTaskPresetStrings.H264AdaptiveBitrateMP4Set720pForiOSCellularOnly,
                    asset,
                    "fdemo18032015defaultprogram",
                    options);
                Console.WriteLine("Submitting transcoding job...");
                // Submit the job and wait until it is completed.
                job.Submit();
                job = job.StartExecutionProgressTask(
                    j =>
                        Console.WriteLine("Job state: {0}", j.State);
                        Console.WriteLine("Job progress: {0:0.##}%", j.GetOverallProgress());
                    CancellationToken.None).Result;
                Console.WriteLine("Transcoding job finished.");
                IAsset outputAsset = job.OutputMediaAssets[0];
                return outputAsset;
     Here I am first searching asset in content where video is stored and then creating job.
    I am using windowsazure.mediaservices version="3.1.0.1" and windowsazure.mediaservices.extensions version="2.0.0.3" dll.
    Please help me with the issue.

    The error is as expected - the on-demand encoders in our service (Azure Media Encoder, etc.) do not yet support handling of input Assets that are archives from a live stream.
    However, we are close to shipping an update to our service that will provide such support. Please watch out for our blog posts in http://azure.microsoft.com/blog/topics/media-services/

  • 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.

  • Job Scheduling in Solution Manager - Error creating Periodic Job

    Hi all,
    I am in the process of testing the Job Scheduling functionality using the Solution Manager.  I have setup the criteria manager, ec. in the satellite system, and done the config in Solman as well. 
    I am able to successfully setup up a 'on-time' job.
    it's only when I try to setup a periodic job, I end up getting following error
    Any thoughts?  Is there any piece of config that's missing?  All the SICF services needed for this functionality are running fine.
    Thanks for the help.
    500 Internal Server Error
    Error when processing your request
    What has happened?
    The URL https://fsspsm.target.com:/sap/bc/webdynpro/sap/wd_ags_ejr_job_req_gaf_app was not called due to an error.
    Note
    The following error text was processed in the system PSM : Message was not created
    The error occurred on the application server fsspsmap01_PSM_00 and in the work process 1 .
    The termination type was: ERROR_MESSAGE_STATE
    The ABAP call stack was:
    Function: BAPI_NOTIFICATION_CREATE of program SAPLDSWP_NOTIF
    Method: MSG_SUBMIT of program CL_DSMOP_BSP_NOTI_MODEL=======CP
    Method: SUBMIT_REQ_CRM_DATA of program CL_AGS_EJR_JOB_REQUEST_FACTORYCP
    Method: SUBMIT of program CL_AGS_EJR_JOB_REQUEST_FACTORYCP
    Method: PROCESS_SCENARIO_PERIODIC of program CL_AGS_EJR_JSM_PROC_STANDARD==CP
    Method: PROCESS_JOB_SCENARIO of program CL_AGS_EJR_JSM_PROC_STANDARD==CP
    Method: IF_AGS_EJR_JSM_PROC_FPM_CTRL~AFTER_PROCESS_EVENT of program CL_AGS_EJR_JSM_PROC_STANDARD==CP
    Method: AFTER_PROCESS_EVENT of program /1BCWDY/K54G9RCMK7J4Z427H49S==CP
    Method: IWCI_IF_FPM_APP_CONTROLLER~AFTER_PROCESS_EVENT of program /1BCWDY/K54G9RCMK7J4Z427H49S==CP
    Method: CALL_UIBB_PROCESS_EVENT of program CL_FPM========================CP

    Hello,
    This is the basic Job Scheduling functionality and not the Redwood Job scheduling, correct?
    Have you performed the IMG Activiteis in SPRO?
    See the following Help link:
    http://help.sap.com/saphelp_sm70ehp1_sp23/helpdata/en/c5/7edcbd58ce4e29bc1baf1c4761d71f/frameset.htm
    Change a job
    You can change the scheduling of a job as long as it has not been completed. Proceed as follows:
    Make changes.
    Note
    When you change a periodic job, the system searches for the changeable successor and only changes this successor.
    If there is more than one changeable job with the same name, the system does not change any of these jobs.
    End of the note.
    Save your entries.
    To release the job in the target system, select Release.
    You go to the transaction SM37 in the target system.
    You just may want to ensure HTTP Services have been enabled. I realize you said the services workin SICF, but this needs to be verified as 500 Internal Server Error most often means the HTTP services are not activated.
    Regards,
    Paul

Maybe you are looking for