Execute create trigger script in a procedure

Is it possible to create a trigger with pl/sql?
I have made a procedure thats makes the create or replace trigger statement.
(when i copy and past the statement the trigger is created succesvol)
How can i execute the create trigger statement on the end of the procedure?
Thanks.

Well, then proceed with dynamic SQL.
Or, in my opinion much better: produce a SQL script with variables for table name and trigger name.
Then run this script with the appropriate values every time you have created a table.
Cheers,
Guido
Edited by: Guido on Oct 22, 2008 10:30 AM

Similar Messages

  • Privilege error while running Create Table Script inside Stored Procedure.

    Hello All,
    I have Oracle 10G server and SQL Developer Client,
    I have One User with Appropriate Rights, Login with that user from SQL Developer(client),
    Within my Procedure, Dynamic SQL script is like If I pass in a TABLE NAME as parameter, It Creates that table, but now problem is It throws an error for Privilege.
    Where as if I Execute Create table script outside the procedure(as Normal SQL), it executes Ok, but why it throws Privilege error within procedure ?
    Whether any extra Rights needed for this user to execute such Create Table Dynamic SQL?
    Please Help.
    Thanks,
    j@y

    Elic
    Thanks a lot dude...
    It works now,
    regards,
    j@y

  • How to execute a sql script in dbms_job?

    how to execute a sql script in dbms_job?

    See my response to Re: how to execute a sql script file in procedure or trigger.
    Cheers, APC

  • Executing create or replace procedure statement from plsql script

    Hi ,
    I want to execute create or replace procedure from pl/sql block without using execute immediate or dbms_sql, please let me know if feasible.
    Eg:
    declare
    begin
    create or replace procedure .....
    if v_temp = 4 then
    end if;
    end;
    Thanks for help.
    Regards,
    RK

    user588487 wrote:
    Actual requirement is I have .sql file which has Create procedure command in it
    and i have to conditionally execute the above .sql file so going for a pl/sql block.
    Eg:
    begin
    if variable1 <> variable2 then
    @xyz.sql -- contains create or replace procedure statement
    insert into tablexyz.....
    end if;
    end;
    Won't work. The PL/SQL code block (also called an anonymous block) is shipped from the client (e.g. SQL*Plus) to the database server. There it is parsed and executed.
    It cannot execute SQL*Plus code.
    There are 2 basic approaches to address this requirement.
    Method 1. Use PL/SQL and SQL to perform the conditional logic checks that SQL*Plus cannot. Use bind variables to "copy" the results between SQL*Plus and PL/SQL, use substitution variables to execute the conditional branch (as a script) in SQL*Plus.
    Basic example:
    SQL> --// bind variable for passing data to PL/SQL code and
    SQL> --// to receive data from PL/SQL code
    SQL> var status varchar2(100)
    SQL>
    SQL> declare
      2          function ExistsTable( tableName varchar2 ) return boolean is
      3                  i       integer;
      4          begin
      5                  select 1 into i
      6                  from    user_objects
      7                  where   object_type = 'TABLE'
      8                  and     object_name = tableName;
      9                  return( true );
    10          exception when NO_DATA_FOUND then
    11                  return( false );
    12          end;
    13  begin
    14          --// determine if table exists
    15          if not ExistsTable( 'FOOTAB' ) then
    16                  --// table does not exists and SQL*Plus client
    17                  --// needs to run the footab client script
    18                  :status := 'footab.sql';
    19          else
    20                  :status := 'do-nothing.sql';
    21          end if;
    22  end;
    23  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> --// use a substitution variable to determine what to do
    SQL> set define on
    SQL> col STATUS new_value SCRIPT
    SQL> select :status as STATUS from dual;
    STATUS
    footab.sql
    SQL>
    SQL> --// execute the relevant script (i.e. execute the conditional
    SQL> --// branch of the PL/SQL IF condition
    SQL> @ &SCRIPT
    SQL> --// file: footab.sql
    SQL>
    SQL> create table footab(
      2          id      number primary key,
      3          col1    number,
      4          col2    date
      5  ) organization index
      6  /
    Table created.
    SQL>
    SQL> --//eof
    // running the same steps when the table does exist
    SQL> --// bind variable for passing data to PL/SQL code and
    SQL> --// to receive data from PL/SQL code
    SQL> var status varchar2(100)
    SQL>
    SQL> declare
      2          function ExistsTable( tableName varchar2 ) return boolean is
      3                  i       integer;
      4          begin
      5                  select 1 into i
      6                  from    user_objects
      7                  where   object_type = 'TABLE'
      8                  and     object_name = tableName;
      9                  return( true );
    10          exception when NO_DATA_FOUND then
    11                  return( false );
    12          end;
    13  begin
    14          --// determine if table exists
    15          if not ExistsTable( 'FOOTAB' ) then
    16                  --// table does not exists and SQL*Plus client
    17                  --// needs to run the footab client script
    18                  :status := 'footab.sql';
    19          else
    20                  :status := 'do-nothing.sql';
    21          end if;
    22  end;
    23  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> --// use a substitution variable to determine what to do
    SQL> set define on
    SQL> col STATUS new_value SCRIPT
    SQL> select :status as STATUS from dual;
    STATUS
    do-nothing.sql
    SQL>
    SQL> --// execute the relevant script (i.e. execute the conditional
    SQL> --// branch of the PL/SQL IF condition
    SQL> @ &SCRIPT
    SQL> prompt Nothing to do...
    Nothing to do...
    SQL> Method 2. Move all "client scripting" to the server. You can still use .sql files. These need to contain valid DDL that can be parsed and executed. On the server, the .sql files are loaded into a table.
    This can be a physical load (e.g. using <i>DBMS_LOB.LoadFromFile()</i>). Or you can keep the .sql files on the server and use BFILE pointers instead to the files.
    You can now use execute immediate to execute the contents of a .sql file as a CLOB that was read from the table containing the .sql scripts.
    To be honest - I have used both methods extensively in the past and no longer bother using either. Table exists when running the table create script? So what. If the table should not exist, use server exceptions in SQL*Plus to cease processing and exit. If it does not matter whether the table exists or not, why be concern with running the script to create the table if the table already exists?

  • File Ownership while executing sql script from stored procedure

    We have a test_command.sql script which is spooling the result into a file. From database we have one Store Procedure(run_sql) which is
    calling and executing the .sql script.
    When we are calling the sql script directly from the database, i e SQL > @/dccops/test_command.sql it is creating the
    file under the Ownership of OS user which is connected to the system.
    The problem we are facing is when we are executing the stored procedure i e exec run_sql(), the file is creating under
    Oracle User.
    Could u please suggest me a solution inorder to create the output file under the user who is logged to the OS.

    First of all, your usage of IM speak is NOT appreciated. Please do not address anyone as if they were a 12-year old.
    'Our Applcation is in C. So we have to call the procedure to run the sql script.'
    This is just utter nonsense!
    Oracle has Pro*C which allows Embedded SQL in C. There is also OCI (Oracle Call Interface) to call Oracle directly in C, and there is OCCI, to do the same in C++.
    Apart from that, Oracle has Ole DB for Windows platforms, to allow for a .NET compatible interface to Oracle.
    There is NO NEED AT ALL to call PL/SQL to run a SQL script.
    Sybrand Bakker
    Senior Oracle DBA

  • Please trace what is wrong in TRIGGER script , doesnt create trigger.

    Hi Oracle Gurus,
    Please help me, in finding what is wrong in trigger statement. It doesn not create trigger, instead it displays line numbers..like 1 2 3 4 ....after pressing the enter key,
    I am attaching the full script, where it alters table, then creates new table, the creates sequence..lastly it fails in creating the trigger.
    ==================================================================================
    SQL> ALTER TABLE MOBILE.MOBILE_USER ADD (LAST_LOGIN TIMESTAMP);
    Table altered.
    SQL> CREATE TABLE "MOBILE"."AUDIT_LOG"
    2 3 "AUDIT_LOG_ID" NUMBER(16,0) NOT NULL ENABLE,
    4 "DATE_CREATED" TIMESTAMP (6) NOT NULL ENABLE,
    5 "AUDIT_TYPE" VARCHAR2(20 BYTE) NOT NULL ENABLE,
    6 "AUDIT_DATA" CLOB,
    7 CONSTRAINT "AUDIT_LOG_PK" PRIMARY KEY ("AUDIT_LOG_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SERVICES_DATA" ENABLE
    8 )
    9 PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    10 11 12 )
    TABLESPACE "SERVICES_DATA" LOB
    13 14 (
    15 "AUDIT_DATA"
    16 )
    17 STORE AS
    18 (
    19 TABLESPACE "SERVICES_DATA" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    20 ) ;
    Table created.
    SQL> CREATE SEQUENCE "MOBILE"."AUDIT_LOG_SEQ" INCREMENT BY 1 START WITH 1000 CACHE 20 NOCYCLE ;
    Sequence created.
    SQL> create or replace
    TRIGGER "MOBILE"."AUDIT_LOG_TRGR" before
    INSERT ON "AUDIT_LOG" FOR EACH row BEGIN IF inserting THEN IF :NEW."AUDIT_LOG_ID" IS NULL THEN
    SELECT AUDIT_LOG_SEQ.nextval
    INTO :NEW."AUDIT_LOG_ID"
    FROM dual;
    END IF;
    END IF;
    END;

    Ok great..but it gives the same error, we have already checked that AUDIT_LOG does exist.
    Is it checking something else..or it shoud be INSERT INTO instead of INSERT ON.
    Please help.
    create or replace
    TRIGGER "MOBILE"."AUDIT_LOG_TRGR" before
    INSERT ON "AUDIT_LOG" FOR EACH row BEGIN IF inserting THEN IF :NEW."AUDIT_LOG_ID" IS NULL THEN
    SELECT AUDIT_LOG_SEQ.nextval
    INTO :NEW."AUDIT_LOG_ID"
    FROM dual;
    END IF;
    END IF;
    END; /
    INSERT ON "AUDIT_LOG" FOR EACH row BEGIN IF inserting THEN IF :NEW."AUDIT_LOG_ID" IS NULL THEN
    ERROR at line 3:
    ORA-00942: table or view does not exist

  • Executing a powershell script for checking duplicate users while creating a AD user throug ADUC console.

    Hi,
    I have a text file in which some SamAccountNames are present.I need to check the file while creating a new users through ADUC console.If a username that is going to create through ADUC console is present in the file, then it should prompt a message
    that the user is already present in the text file.
    Is there any possibility of contacting the powershell script from the ADUC console.If so, then while creating a new user through ADUC console, what is the proceedure for executing that powershell script.
    please provide me the approriate solutions.
    Thanks
    Prasanthi k

    Run the below Powershell Script for users are exist or not in AD. Later you can create the users.
    #Find Users exist in AD or Not?
    #Biswajit Biswas
    $users = get-content c:\users.txt
    foreach ($user in $users) {
    $User = Get-ADUser -Filter {(samaccountname -eq $user)}
    If ($user -eq $Null) {"User does not exist in AD ($user)" }
    Else {"User found in AD ($user)"}
    Active Directory Users attributes-Powershell
    http://gallery.technet.microsoft.com/scriptcenter/Getting-Users-ALL-7417b71d
    Regards~Biswajit
    Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights.
    MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, MCTS, Enterprise Admin
    MY BLOG
    Domain Controllers inventory-Quest Powershell
    Generate Report for Bulk Servers-LastBootUpTime,SerialNumber,InstallDate
    Generate a Report for installed Hotfix for Bulk Servers

  • How do I create a trigger script for BOT on Xcode 5 CI?

    When creating a bot for xcode 5 CI, I am offered to use custom script to trigger on every commit. how do I create this script?
    xcode help page: https://help.apple.com/xcode/mac/1.0/#apdE6540C63-ADB5-4B07-89B7-6223EC40B59C
    Click Schedule, then change the settings as desired.
    Example values are shown with each setting.
    Schedule:
    Choose to run manually, periodically, on new commits, or on trigger scripts.

    Did you ever figure this out?
    Been searching the web endlessly without any results.

  • Script to create trigger

    I want to create a trigger on all dba_tables.
    I want to do a select in a trigger but i don't know how to do.
    Here are my trigger and my select
    CREATE OR REPLACE TRIGGER SIGTASAD.TRG_dba_tables_BEF_INSUPD
    BEFORE INSERT OR UPDATE
    ON dba_tables
    FOR EACH ROW
    DECLARE
    v_ird_employee_no IRD_EMPLOYEE.ird_employee_no%TYPE;
    BEGIN
    v_ird_employee_no := PCK_UTIL.get_ird_employee_no( USER );
    IF INSERTING THEN
    :NEW.enter_user := v_ird_employee_no;
    :NEW.enter_date := SYSDATE;
    ELSIF UPDATING THEN
    :NEW.update_user := v_ird_employee_no;
    :NEW.update_date := SYSDATE;
    END IF;
    END;
    Select *
    from dba_tables
    where owner = 'SIGTASAD'
    order by table_name;
    Thanks

    Ok
    Before I was a system administartor, but our dba was off, and now i assume this function before.
    So
    we have a new data base
    and i created a script to add column in dba_tables.
    And here is this script:
    select 'ALTER TABLE ',substr(table_name,1,40),' add(enter_user number(6)
    ,update_user number(6)
    ,enter_date date
    ,update_date date); '
    from dba_tables
    where owner = 'SIGTASAD'
    order by table_name;
    And i use a script (give me by some one) to create a trigger in main table but one by one; and here is this script:
    CREATE OR REPLACE TRIGGER SIGTASAD.TRG_payment_loc_BEF_INSUPD BEFORE INSERT OR UPDATE
    ON payment_loc
    FOR EACH ROW
    DECLARE
    v_ird_employee_no IRD_EMPLOYEE.ird_employee_no%TYPE;
    BEGIN
    v_ird_employee_no := PCK_UTIL.get_ird_employee_no( USER );
    IF INSERTING THEN
    :NEW.enter_user := v_ird_employee_no;
    :NEW.enter_date := SYSDATE;
    ELSIF UPDATING THEN
    :NEW.update_user := v_ird_employee_no;
    :NEW.update_date := SYSDATE;
    END IF;
    END;
    Now after column in all tables of dba_tables, i want to create trigger in all tables of dba_tables.
    But i don't how tio do it, i think i explained more now.
    thanks

  • Execute a shell script from inside PL procedure

    Oracle 9205 on Red Hat Enterprise Linux 3.
    Is there any way to execute an O.S. shell script from inside a PL/SQL procedure?
    This is, that PL_SQL procedure evaluate a situation and if the condition is true, it calls and execute an O.S. shell script.

    PL/SQL procedures do not support any native calls to the OS; however, you can code calls to external procedures or JAVA procedures to perform tasks on the OS.
    Prior to these two methods any of the following packages dbms_alert, dbms_pipe, or utl_file could be combined with a daemon type program to issue OS commands, run shell scripts, etc....
    There is a writeup on metalink with examples.
    HTH -- Mark D Powell --

  • How to create an executable File (Linux-Script) in Java

    Hello,
    I'm creating a script file in my Java Application.
    This script should be executed by hand on my linux system. Therefor the execute flag must be set. But how can I set this flag without executing the "chmod"-command?
    Is there any possiblility to do this?
    Thanks,
    Armin

    I don't think there is. But you can use Runtime.exec() to execute a chmod command.

  • Problems with executing shell script within oracle procedure

    I have procedure that's owned by Semantic user. This procedure calls job scheduler (owned by USER1) which in turn executes a shell script load_semantic.sh (owned by USER1).
    Now, there is a shell script(checkCount.sh)inside of this one (owned by this USER1) that has following contents:
    checkCount.sh
    #!/bin/bash
    MODEL=$1
    sqlplus -S user/pass << EOF
    whenever sqlerror exit 1;
    set echo on
    set verify off
    MERGE INTO SEMANTIC.COUNT_STATISTICS s
    USING (SELECT '$MODEL' AS MODEL, 0 AS NEW_COUNT, SYSDATE AS NEW_DATE, 0 AS OLD_COUNT, SYSDATE AS OLD_DATE FROM dual) t
    on (s.MODEL = t.MODEL)
    when not matched then
    INSERT (s.MODEL, s.NEW_COUNT, s.NEW_DATE, s.OLD_COUNT, s.OLD_DATE)
    VALUES (t.MODEL, t.NEW_COUNT, t.NEW_DATE, t.OLD_COUNT, t.OLD_DATE);
    COMMIT;
    UPDATE SEMANTIC.COUNT_STATISTICS SET  MODEL = '$MODEL', NEW_COUNT = (SELECT COUNT(*) FROM TABLE(SEM_MATCH('{?s ?p ?o}',SEM_Models('$MODEL'),NULL,SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC#')),NULL)) ),NEW_DATE  = SYSDATE,
    OLD_COUNT = NEW_COUNT, OLD_DATE  = NEW_DATE WHERE MODEL = '$MODEL' AND NEW_DATE = (select max(NEW_DATE) from SEMANTIC.COUNT_STATISTICS where MODEL = '$MODEL');
    COMMIT;
    exit;
    EOF
    So when I execute SEMANTIC.PROCEDURE:
    SEMANTIC.PROCEDURE => USER1.JOBSCHEDULER =>USER1.load_semantic.sh =>USER1.checkCount.sh
    It never populates the table SEMANTIC.COUNT_STATISTICS.
    I tried giving all of the permissions but I am probably missing something...
    Maybe fresh eyes can see something that I can't.

    I can't believe I am going to say this but the reason it was not working was because I removed oracle environment path from my script by mistake.
    . /etc/profile.d/oracle.sh
    Ugh...
    Now it is working perfectly.
    Btw, sqlplus does know about shell environment variables.
    THANK YOU GUYS!!! YOU ARE THE BEST!!!!!!!!!!!!!!!!!!
    I ONLY HAVE YOU TO TALK TO WHEN I AM STUCK ON A PROBLEM.

  • Want to create unix shell script for  Clone procedure in 11i and r12

    Want to create unix shell script for Clone procedure in 11i and r12 .Can anyone help me on this as I m new to oracle apps and scripting.
    Thanks in advance .

    user11958935 wrote:
    Thanks but I want it for application cloning ie adcfgclone and autoconfig etc .Please see old threads for similar topic/discussion.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+Rapid+AND+Clone&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+AutoConfig&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '&lt;&lt;ALL FILES&gt;&gt;', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • Calling sql script in plsql procedure

    Hello,
    I have a sql script named mytest.sql and i want to execute this from a stored procedure.
    following is the contents of this script
    spool d:\mytestsql.txt
    select * from tab;
    spool off
    Actually i want my sql script to run daily to export some tables data.
    I can execute this script from a sql prompt but i want to run it from enterprise manager.
    I am using oracle 10gR2 on windows2000 system.
    Any idea about scheduling the sql script to run automatically??
    How to execute this sql script from a plsql procedure??
    Thanks

    Hi all,
    Thanks for all the replies. I have found the solution with external procedures.
    Following is the complete step by step guide.
    1. Create the OSCommand Java Class using the following statement:
    connect as any user:
    create or replace and compile java source named oscommand as
    import java.io.*;
    public class OSCommand{
    public static String Run(String Command){
    try{
    Runtime.getRuntime().exec(Command);
    return("0");
    catch (Exception e){
    System.out.println("Error running command: " + Command +
    "\n" + e.getMessage());
    return(e.getMessage());
    2. Create the following Wrapper Function using the following statement:
    CREATE or REPLACE FUNCTION OSCommand_Run(Command IN STRING)
    RETURN VARCHAR2 IS
    LANGUAGE JAVA
    NAME 'OSCommand.Run(java.lang.String) return int';
    3. connect as sys
    Execute dbms_java.grant_permission( 'FKHALID','SYS:java.io.FilePermission', '<<ALL FILES>>','execute');
    execute dbms_java.grant_permission( 'FKHALID','SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '*' );
    execute dbms_java.grant_permission( 'FKHALID','SYS:java.lang.RuntimePermission', 'readFileDescriptor', '*' );
    commit;
    note: here fkhalid is the oracle user.
    connect as fkhalid user:
    Declare
    expdp_cmd Varchar2(2000);
    Begin
    expdp_cmd := OSCommand_Run('cmd /c sqlplus fkhalid@mtcedwt/pwd @d:\ORA_DUMPS\mydbexp.sql');
    DBMS_OUTPUT.Put_Line(expdp_cmd);
    End;
    In Unix
    Set Serverout On
    Declare
    x Varchar2(2000);
    Begin
    x := OSCommand_Run('/home/test/myoscommand.sh')
    DBMS_OUTPUT.Put_Line(x);
    End;
    I will check the dbms_scheduler also and will let you know the results.
    Thanks

Maybe you are looking for

  • Can't figure out how to increase tempo curve for a track/region

    What I'm trying to accomplish: Using the heartbeat.aif (Audio) that comes with Logic Pro, I'd like to have the affect of increasing the speed of the heartbeat over a defined period of time. I've tried the "time machine" to change the BPM but it opera

  • Can we copy the already created Configuration Item in ATO Model

    Hi all, We have the requirement for copy the Existing configurator ATO items into new model. i.e. Customer will congifured the model in istore process flow to create a sale order. After that for second sales order customer don't want to make same con

  • Round up a figure like 26.54

    Can any one tell Function module to round up a figure.

  • Proxy error 401 HTTP_RESP_STATUS_CODE_NOT_OK

    Hey, PI gurus, We used ABAP proxy to send xml messages from our ECC server to our PI server. After our PI server was upgraded to PI 7.11 from XI 3.0, I got an error "401 Unauthorized: HTTP_RESP_STATUS_CODE_NOT_OK" in the ECC SXMB_MONI when I tried to

  • Web site providers that work w/ iWeb

    Hey, does anybody know what are some good domain providers that work with iWeb, and are somewhat good with them? I don't want to use a .mac right now, and i'm looking into web hosting companies, and im not familiar w/ html. Thats why i want to use iW