How to execute PL/SQL from DOS PROMPT?

Hello:
I've seen that executing an SQl script via DOS prompt involves @script name, however all this seems to do is open the line editor. A GET command displays my script and sets the cursor on the next available line with the last line of the script with an asterics beside it. as does using the @scriptname command. I cannot do any commands like SAVE, RUN, etc.
Any help is appreciated.

Do you have a final / in your script to execute it (which is presumably an anon pl/sql block).

Similar Messages

  • How to execute PL/SQL from Java?

    I want to execute (compile) a PL/SQL file to a database and I don't know how it can be done with Java.
    Please note that I am NOT trying to call a stored procedure. I know that can be done with CallableStatement.
    Background:
    My actual requirement is to execute PL/SQL files with error notifications. I tried Ant SQL task; but it fails to give compilation error information. I also tried another open source task called Incanto - that also not that helpful as if I execute in bulk, very hard to figureout which one throws error. Hence I decided to write my own Ant task.

    Hi,
    do u want to execute PL/SQL files? or just you want to execute the block of code?
    in the case of PL/SQL file:
    you need to read total file as StringBuffer/String and then execute.
    Block of code:
    you can directly pass the code to the java file as input and then execute.
    Ex:
                   StringBuffer queryString = new StringBuffer();
                    queryString = queryString.append("BEGIN execute immediate ' ");
              queryString = queryString.append(query);
              //queryString = queryString.append("BEGIN dbms_job.run(142);END;");
              queryString = queryString.append(" '; END; ");
              final_Query = queryString.toString();
              try {
                   System.out.println("final :   "+final_Query);
                   cstmt = con.prepareCall(final_Query);
                   System.out.println("Job is Running...");
                   new ThreadCountdownExtThread().start();
                   System.out.println("bfore execute()...............");
                   cstmt.execute();Note: if you are running pl/sql file read file and save it in a Stirng , and then do the same as above stated

  • Execute PL/SQL from BC4J

    Hi All,
    Can anyone point me to documentation that tells how to execute PL/SQL from BC4J.
    Thanks a lot
    Srinivas Bhat

    Try something like this:
        try
          final ApplicationModule am = panelBinding.getApplicationModule();
          final CallableStatement stmt =  ((DBTransaction) am.getTransaction()).
              createCallableStatement ("{? = call yourpackage.yourfunction(?)}", 10);
          stmt.registerOutputParamter(1, oracle.jdbc.driver.OracleTypes.INTEGER);
          if (id == null)
            stmt.setNull (2, oracle.jdbc.driver.OracleTypes.NUMBER);
          else
            stmt.setInt (2, id.intValue());
          stmt.execute();
          stmt.close();
          return stmt.getInt(1);

  • How to execute a  .sql file from a batch file

    Hi all
    I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
    now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
    i created a batch file prod.bak with the following lines
    @echo off
    set oracle_sid=testdb
    set oracle_home=d:\oracle\ora92
    sqlplus /nolog
    connect sys as sysdba/oracletest@testdb
    this batch file when eexecuted connects me to sql prompt.
    Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
    (i tried with these lines in the above batch file...
    call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
    start bkp.sql---same as call
    connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
    At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
    Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
    I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
    Thanks
    Tripti

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • How to execute a Scenario from Windows CMD prompt

    Please can you let me know how to execute the Scenario from a Windows CMD prompt? I am not sure if it is any different from "ODIStartScen" command that ODI uses to execute the scenario.
    Appreciate your help.
    Regards
    B

    Hi SH,
    I tried running the scenario from the command line, but the process was not completed and it came back with the below message
    Session : 131774001 finished with return code : 7000
    Do I need to set up any environmental variables or any other setups before I can run the scenario from the command line?
    Appreciate your help.
    Regards
    B

  • How to execute an SQL query present in a string inside an ABAP program?

    hello,
    How to execute an SQL query present in a string inside an ABAP program

    Raut,
    You can execute Native SQl statements.
    Ex: To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
    EXEC SQL [PERFORMING <form>].
      <Native SQL statement>
    ENDEXEC.
    There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You need to know whether table and field names are case-sensitive in your chosen database.
    In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). You can use elementary structures as host variables. Exceptionally, structures in an INTO clause are treated as though all of their fields were listed individually.
    If the selection in a Native SQL SELECT statement is a table, you can pass it to ABAP line by line using the PERFORMING addition. The program calls a subroutine <form> for each line read. You can process the data further within the subroutine.
    As in Open SQL, after the ENDEXEC statement, SY-DBCNT contains the number of lines processed. In nearly all cases, SY-SUBRC contains the value 0 after the ENDEXEC statement. Cursor operations form an exception: After FETCH, SY-SUBRC is 4 if no more records could be read. This also applies when you read a result set using EXEC SQL PERFORMING.
    EXEC SQL PERFORMING loop_output.
      SELECT connid, cityfrom, cityto
      INTO   :wa
      FROM   spfli
      WHERE  carrid = :c1
    ENDEXEC.
    Pls. Mark If useful

  • How to execute this SQL Query in ABAP Program.

    Hi,
    I have a string which is the SQL Query.
    How to execute this sql Query (SQL_STR) in ABAP Program.
    Code:-
    DATA: SQL_STR type string.
    SQL_STR = 'select * from spfli.'.
    Thanks in Advance,
    Vinay

    Hi Vinay
    Here is a sample to dynamically generate a subroutine-pool having your SQL and calling it.
    REPORT dynamic_sql_example .
    DATA: BEGIN OF gt_itab OCCURS 1 ,
    line(80) TYPE c ,
    END OF gt_itab .
    DATA gt_restab TYPE .... .
    DATA gv_name(30) TYPE c .
    DATA gv_err(120) TYPE c .
    START-OF-SELECTION .
    gt_itab-line = 'REPORT generated_sql .' .
    APPEND gt_itab .
    gt_itab-line = 'FORM exec_sql CHANGING et_table . ' .
    APPEND gt_itab .
    gt_itab-line = SQL_STR .
    APPEND gt_itab .
    gt_itab-line = 'ENDFORM.' .
    APPEND gt_itab .
    GENERATE SUBROUTINE POOL gt_itab NAME gv_name MESSAGE gv_err .
    PERFORM exec_sql IN PROGRAM (gv_name) CHANGING gt_restab
    IF FOUND .
    WRITE:/ gv_err .
    LOOP AT gt_result .
    WRITE:/ .... .
    ENDLOOP .
    *--Serdar

  • How to execute ODI scenario from a web application

    Hi
    I need to execute ODI scenario from ApEx form.
    how to execute ODI scenario from application. Using 10.1.3.5.5
    -app

    In the SQL property of the TQuery object, enter the call as an anonymous block:
    begin
      pkg_name.procedure_name(true);
    end;

  • How to execute a SQL procedure in UNIX

    How to execute a SQL procedure in UNIX

    Check this out..
    -Sri
    << a.sql >>
    create or replace procedure junk(nout out varchar2) is
            x varchar2(20);
    begin
            select 'Sam' into x
            from dual;
            nout := x;
    end;
    << Shell script >>
    sqlplus -s / << DOC
    scott/tiger
    variable x varchar2(20);
    set autoprint on
    @a.sql
    begin
    junk(:x);
    end;
    exit
    DOC
    << Execution of Shell SCript >>
    # sh b.sh
    Procedure created.
    PL/SQL procedure successfully completed.
    X
    Sam

  • How to execute a sql file inside a plsql file?

    It's easy to exec a plsql inside a sql. Simply
    start my_proc.plsql
    exec my_proc;
    But how to execute a sql file inside a plsql file?
    declare ...
    begin
    start my_sql.sql?
    end;
    Thanks.
    - Zac

    Doesn't work. Even though @ is different from start in this case but it just doesn't like the way sql and plsql are mixed. For example:
    DECLARE n NUMBER := 0;
    BEGIN
    select COUNT(*) INTO n from user_tab_partitions;
    DBMS_OUTPUT.put_line('Number of partitioned tables = ' || to_char(n));
    if n = 0 then
    DBMS_OUTPUT.put_line('createViewsProcs.sql');
    @createViewsProcs.sql
    else
    DBMS_OUTPUT.put_line('createPartitionViewsProcs.sql');
    @createPartitionViewsProcs.sql
    end of;
    END;
    SQL> @postimp.sql
    SQL> DECLARE n NUMBER := 0;
    2 BEGIN
    3 select COUNT(*) INTO n from user_tab_partitions;
    4
    5 DBMS_OUTPUT.put_line('Number of partitioned tables = ' || to_char(n));
    6
    7 if n = 0 then
    8 DBMS_OUTPUT.put_line('createViewsProcs.sql');
    9 @createViewsProcs.sql
    9 SET SERVEROUTPUT ON SIZE UNLIMITED;
    10 SET TERM ON;
    11 SET ECHO ON;
    12 EXEC DBMS_OUTPUT.put_line('STARTING VIEWS, PROCS, ETC, THIS MAY TAKE A FEW MINUTES');
    13 EXEC DBMS_OUTPUT.put_line(SYSTIMESTAMP());
    14
    15
    16 CREATE OR REPLACE PACKAGE db_convert AS
    17 FUNCTION ......
    32 END;
    33 /
    SET SERVEROUTPUT ON SIZE UNLIMITED;
    ERROR at line 9:
    ORA-06550: line 9, column 5:
    PL/SQL: ORA-00922: missing or invalid option
    ...

  • 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

  • Converting multiple bmp files to PDF using acrobat 7.0 from DOS prompt

    Hi,
    I have a requirement to convert multiple BMP files in a folder to one PDF.
    I can use multiple file conversion option in acrobat to combine and convert them to one PDF .. but I have 2000 such folder to conver to PDF.
    PDF should be name after the folder name.
    Is there a to automate this in acrobat.. or can we run this conversion from DOS prompt using commands.. so that I can create a bat file and have them converted. Pls let me know.
    Thanks
    Pugazh

    I have not tried BMP files, but do JPeg, GIF, TIFF, and PNG files regularly. I simply open Acrobat, then select the graphics files in explorer and drag & drop to Acrobat. I then organize the graphics if needed (using the pages tab) and save to a PDF.

  • How to Compile this prog. i DOS prompt.

    Hey Friends,
    I don't know how to compile this prog. on DOS prompt, kindly tell.
    // My Java Prog.
    package package1;
    import java.awt.Graphics;
    import java.lang.Number;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.awt.Color;
    import java.awt.event.*;
    import java.applet.Applet;
    import java.io.*;
    import java.util.*;
    import java.Applet.*;
    /* <applet code="abc" width=600 height=1000 > </applet> */
    public class abc extends Applet implements Runnable {
    Hashtable dataFile = new Hashtable();
    StringBuffer sb;
    String Date,Time,Freq;
    double KarDmd,KarDwl,KarShr,KarGen;
    boolean flag = true ;
    Thread myThread = null;
    * init
    public void init(){
    setBackground(Color.gray);
    * start
    public void start() {
    System.out.println("Start called"+this.getDocumentBase());
    System.out.println("Start called"+this.getCodeBase());
    myThread = new Thread(this );
    myThread.start();
    }//close thread
    public void run(){
    while (flag){
    try {
    URL url = new URL(this.getCodeBase(),"servlet/FileReadingServlet");
    HttpMessage message = new HttpMessage(url);
    InputStream in = message.sendGetMesage(null);
    ObjectInputStream ois = new ObjectInputStream(in);
    //String readStream = (String)ois.readObject();
    dataFile = (Hashtable)ois.readObject();
    //sb = new StringBuffer(readStream);
    System.out.println("Applet Read :"+dataFile);
    this.repaint();
    try {
    Thread.sleep(10000);
    }catch (InterruptedException io){}
    }catch (Exception e){
    e.printStackTrace();
    flag = false;
    }//while
    }//close run
    public void paint (Graphics g){
    g.clearRect(0,0,700,450);
    g.drawString("Date :", 500,16);
    g.drawString((String)dataFile.get("DATE"), 550,16);
    g.drawString("TIME:",500,32);
    g.drawString((String)dataFile.get("TIME"), 550,32);
    g.drawString("FREQ :",500,48);
    g.drawString((String)dataFile.get("FREQ"), 550,48);
    // "KARNATAKA"
    g.setColor(Color.cyan);
    g.drawRect(10,50,150,100);
    g.fillRect(10,50,150,100);
    g.setColor(Color.black);
    g.drawString("KARNATAKA",25,65);
    g.drawLine(160,100,250,100);
    g.drawString("GENERATION ",12,87);
    String KAR_GEN = this.getGeneration((String)dataFile.get("KAR_DMD"),
    (String)dataFile.get("KAR_DRL"));
    g.drawString(KAR_GEN ,120,87);
    g.drawString("SCHEDULE",12,107);
    g.drawString((String)dataFile.get("KAR_SHD"),120,107);
    g.drawString("DRAWL ",12,127);
    g.drawString((String)dataFile.get("KAR_DRL"),120,127);
    g.drawString("DEMAND ",12,147);
    g.drawString((String)dataFile.get("KAR_DMD"),120,147);
    g.drawLine(92,70,92,150);
    //"KAPS"
    g.setColor(Color.green);
    g.drawRect(12,5,85,30);
    g.fillRect(12,5,85,30);
    g.setColor(Color.black);
    g.drawString("KAPS",14,20);
    g.drawString("DEMAND:",14,35);
    g.drawString((String)dataFile.get("KAPS_DMD"),70,35);
    //"GOA"
    g.setColor(Color.magenta);
    g.drawRect(100,5,85,30);
    g.fillRect(100,5,85,30);
    g.setColor(Color.black);
    g.drawString("GOA",104,20);
    g.drawString("DEMAND:", 104,35);
    g.drawString((String)dataFile.get("GOA_DMD"),160,35);
    // "ANDHRA PRADESH"
    g.setColor(Color.orange);
    g.drawRect(250,50,150,100);
    g.fillRect(250,50,150,100);
    g.setColor(Color.black);
    g.drawLine(32,37,32,50);
    g.drawLine(110,35,110,50);
    g.drawString("ANDHRA PRADESH",268,65);
    g.drawString("GENERATION ",252,87);
    String AP_GEN = this.getGeneration((String)dataFile.get("AP_DMD"),
    (String)dataFile.get("AP_DRL"));
    g.drawString(AP_GEN,350,87);
    g.drawString("SCHEDULE",252,107);
    g.drawString((String)dataFile.get("AP_SHD"),350,107);
    g.drawString("DRAWL",252,127);
    g.drawString((String)dataFile.get("AP_DRL"),350,127);
    g.drawString("DEMAND",252,147);
    g.drawString((String)dataFile.get("AP_DMD"),350,147);
    g.drawLine(332,70,332,150);
    // "NTPC"
    g.setColor(Color.pink);
    g.drawRect(250,3,85,30);
    g.fillRect(250,3,85,30);
    g.setColor(Color.black);
    g.drawString("NTPC",252,14);
    g.drawString("DEMAND:",252,30);
    g.drawString((String)dataFile.get("NTPC_DMD"),305,30);
    //"HVDC"
    g.setColor(Color.green);
    g.drawRect(350,3,85,30);
    g.fillRect(350,3,85,30);
    g.setColor(Color.black);
    g.drawString("HVDC",352,14);
    g.drawString("DEMAND:",352,30);
    g.drawString((String)dataFile.get("HVDC_DMD"),405,30);
    //"GAUZACK"
    g.setColor(Color.magenta);
    g.drawRect(450,80,90,30);
    g.fillRect(450,80,90,30);
    g.setColor(Color.black);
    g.drawString("GAZ",452,90);
    g.drawString("DEMAND:",452,105);
    g.drawString((String)dataFile.get("GAZ_DMD"),510,105);
    g.drawLine(160,250,250,250);
    g.drawLine(85,150,85,200);
    g.drawLine(160,125,250,225);
    g.drawLine(270,300,270,330);
    g.drawLine(370,300,370,330);
    g.drawLine(400,230,450,230);
    g.drawLine(400,100,450,100);
    g.drawLine(270,33,270,50);
    g.drawLine(370,33,370,50);
    //"KERALA"
    g.setColor(Color.green);
    g.drawRect(10,200,150,100);
    g.fillRect(10,200,150,100);
    g.setColor(Color.black);
    g.drawString("KERALA",62,215);
    g.drawString("GENERATION ",12,237);
    String KER_GEN = this.getGeneration((String)dataFile.get("KER_DMD"),
    (String)dataFile.get("KER_DRL"));
    g.drawString((String)dataFile.get("KER_GEN"),120,237);
    g.drawString("SCHEDULE ",12,257);
    g.drawString((String)dataFile.get("KER_SHD"),120,257);
    g.drawString("DRAWL",12,277);
    g.drawString((String)dataFile.get("KER_DRL"),120,277);
    g.drawString("DEMAND",12,297);
    g.drawString((String)dataFile.get("KER_DMD"),120,297);
    //"TAMIL NADU"
    g.drawLine(92,220,92,300);
    g.drawLine(325,150,325,200);
    g.setColor(Color.yellow);
    g.drawRect(250,200,150,100);
    g.fillRect(250,200,150,100);
    g.setColor(Color.black);
    g.drawString("TAMIL NADU",272,215);
    g.drawString("GENERATION ",252,237);
    String TN_GEN = this.getGeneration((String)dataFile.get("TN_DMD"),
    (String)dataFile.get("TN_DRL"));
    g.drawString((String)dataFile.get("TN_GEN"),350,237);
    g.drawString("SCHEDULE ",252,257);
    g.drawString((String)dataFile.get("TN_SHD"),350,257);
    g.drawString("DRAWL ",252,277);
    g.drawString((String)dataFile.get("TN_DRL"),350,277);
    g.drawString("DEMAND:",252,297);
    g.drawString((String)dataFile.get("TN_DMD"),350,297);
    g.drawLine(332,220,332,300);
    // "PONDYCHERRY"
    g.setColor(Color.magenta);
    g.drawRect(450,220,90,30);
    g.fillRect(450,220,90,30);
    g.setColor(Color.black);
    g.drawString("PDY",452,230);
    g.drawString("DEMAND:",452,245);
    g.drawString((String)dataFile.get("PDY_DMD"),510,245);
    //"NLY"
    g.setColor(Color.green);
    g.drawRect(250,330,90,30);
    g.fillRect(250,330,90,30);
    g.setColor(Color.black);
    g.drawString("NLY",252,340);
    g.drawString("DEMAND:",252,355);
    g.drawString((String)dataFile.get("NLY_DMD"),310,355);
    //"MAPS"
    g.setColor(Color.pink);
    g.drawRect(350,330,90,30);
    g.fillRect(350,330,90,30);
    g.setColor(Color.black);
    g.drawString("MAPS",352,340);
    g.drawString("DEMAND:",352,355);
    g.drawString((String)dataFile.get("MAPS_DMD"),410,355);
    g.setColor(Color.black);
    //g.drawLine(440,306,620,306);
    //g.drawLine(440,332,620,332);
    //g.drawLine(440,358,620,358);
    //g.drawLine(530,280,530,388);
    for(int i=70;i<150;i=i+20) g.drawLine(10,i,160,i);
    for(int i=70;i<150;i=i+20) g.drawLine(250,i,400,i);
    for(int i=220;i<300;i=i+20) g.drawLine(10,i,160,i);
    for(int i=220;i<300;i=i+20) g.drawLine(250,i,400,i); }//close paint
    * stop
    public void stop() {
    myThread.destroy();
    * destroy
    public void destroy() {
    * getAppletInfo
    * @return java.lang.String
    public String getAppletInfo() {
    return "Applet Information";
    private String getGeneration(String DMD,String DRL){
    double _gen = 0;
    if ( ( DMD != null) && ( DRL != null)){
    Double DMDOB = new Double(DMD);
    Double DRLOB = new Double(DRL);
    gen = DMDOB.doubleValue() - _DRLOB.doubleValue();
    return new Double (_gen).toString();
    } //close class

    Change your directory to the directory above package1.
    Assuming that you've got d:/projects/src/package1/abc.java you'd want to be in d:/projects/src.
    Run javac referencing the abc class relatively:
    d:\projects\src> javac package1/abc.javaThis should get you abc.class in the package1 directory.
    Hope this helps.

  • How to execute a workflow from a webdynpro application???

    hi friends....
    How to execute a workflow from a webdynpro application???
    we are using ep6, ecc5????

    If you want to start a workflow in the backend, you need to call a RFC that starts it.

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • In Object Properties dialog box, modify "tab path"...

    For FrameMaker versions up to and including 8 (and I suspect 9). Select a graphic, then click in sequence ESC g o to open the Object Properties dialog box. By default the dialog box opens with the insertion point in the Width text entry area. Now pre

  • Problem with HP C4380 wireless printer and MacBook

    Hi - Bought a MacBook (first Mac in many, many years) and then a C4380 so I could have wireless printing. Geek Squad installed printer but it never worked wireless again after they left. Had them back, switched it to static IP, now they are gone and

  • Error on the RDBMS BEA EIS adapter in WLI 8.1

    Hi, I'm using the RDBMS WebLogic adapter for RDBMS EIS and I can create 'application views' which perform correct operations on the EIS such as "create new entry" in the database, "delete entries" (using SELECT and DELETE sql commands ) but I permane

  • Why is iTunes not telling us why GoodWife last episode is not avail. in Canada store?

    ITunes should at least inform why it cannot provide the episodes instead of making us guess. Especially for those of us who bought the season pass.

  • SQL query for updating values in same cell of a table

    Hi All, I'm stuck with a problem and it stands as follows: Table name: Track Part1  Part2  Part3 NULL   NULL   NULL I've a table called Track, which has three columns named Part1, Part2 and Part3. I want all values of Part1 to be separated by a comma