Execute sql file from forms

Hello, how is it possible to execute a sql file from forms without using sqlplus, because we have only the forms runtime on our pc.
We can't use forms_ddl because we have a very big sql script for creating a package.
Please help,
GJ

Strange, whenever I have installed forms I got sqlplus too without asking for it. If it is not installed, wouldn't your best bet be to install it ?

Similar Messages

  • How to execute sql file from servlet

    Hi,
    I am using JSP, Servlets and Oracle 8i in my application. I want to execute .sql file from java code. Is it possible to do that,
    as we execute .sql file from sql plus prompt.
    Suppose I have abc.sql file and I want to execute it from java code.
    If any body have the solution then pl. reply with sample code.
    Thanks,
    Rajesh

    If any body have the solution then pl. reply with
    sample code.No, no, dec - s/he doesn't want the actual solution, but the full code!
    /k1

  • Need help, executing a SQL file from Forms

    Hi everyone,
    I don't know if this can be done. I want to execute a SQL file from a When-Button-Pressed trigger. I checked a couple of place but havent found anything yet on how to do this. If someone know of a way, please help.
    Thanks
    Eric

    procedure p_call_sqlplus is
       l_filename varchar2 (1000) := 'C:\abc\def\test.sql'  ;
    begin
       host ('sqlplus /NOLOG @' ||  l_filename ) ;
    end ;
    rem ======== test.sql ========
    connect scott/tiger
    spool 'C:\abc\def\test'
    select * from emp ;
    spool off
    exit
    rem ======================working on the machine where forms is running

  • Executing *.sql files from jdbc

    Hi, does anyone know how can I execute an sql file using jdbc?
    Please make me know, tnx.
    Regards

    Check this out.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:14961192831279021580::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241,

  • How to execute Pro*C file from form

    Hi All !
    I have one pro*c file(.pc & .exe) . How I can execute this file from form.
    Regards,
    Neeraj

    I think you could use Ora_Ffi package too. Make sure that you use correct version of Pro/C.
    I think you should use Pro/C version 8.0.x with Forms 6.0. I don't use Forms 6i, but I think it is the same for it too.

  • How to execute a script(.sql) file from a PL\SQL procedure

    I would like to know how to execute a .sql file from a stored procedure and the result of it should update a table. My .sql file contains select statements.

    Hi!
    just go through the following piece of code -
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    str varchar2(200);
      3  begin
      4    str := '@C:\RND\Oracle\Misc\b.sql';
      5    execute immediate(str);
      6* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 5ORA-00900: invalid SQL statement
    Cause: The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and a SQL statement is issued that requires this option (for example, a CREATE PROCEDURE statement). You can determine if the Procedural Option is installed by starting SQL*Plus. If the PL/SQL banner is not displayed, then the option is not installed.
    Action: Correct the syntax or install the Procedural Option.
    Regards.
    Satyaki De.

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

  • Executing sql script from file, with multiple queries

    Hello,
    I am trying to load an SQL script from a file, parse the script into separate SQL statements, and execute each of them. The final statement will always be a query, and thus will return a result.
    Three problems arise:
    1. I don't know what TYPE of statement each one is (i.e. whether it is an UPDATE or a QUERY), which seems to be required in order to execute it in java (via executeQuery and executeUpdate).
    2. I am not sure of the best way to execute a series of statements (the Statement object has some "batch" functionality, but I'm not sure if there is a better way, or even of the proper way to use this).
    3. I need to be able to make sure the final statement is a QUERY, and thus will return a ResultSet. Otherwise I need to be able to throw an exception.
    This has been causing me a lot of trouble. Any help would be much appreciated.
    Thanks,
    Kevin

    Hi Kevin,
    Have you got any solution for your mentioned problem????
    I am facing almost the same kind of problem like I have some sql files containg simple sql statements as well as code for writting Procs , triggeres, index...functions..and so on. I need to execute this XYZ.sql file from Java side.
    Can you guide me about my problem?????
    Thanks in advance.............
    Mak

  • Executing *.bat file from PL/SQL

    Is there anyway for Executing *.bat file from PL/SQL ?
    Thanks

    Try here:
    asktom.oracle.com/pls/ask/f?p=4950:8:15427268967155079552::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241

  • How to execute .sql file in Stored Procedure?

    Hi,
    I have an urgent requirement, where i have to execute .sql file form Stored Procedure.
    This .sql file will have set of update statement. I need to pass value to this update statement.
    Kindly please help me.
    Regards,
    Irfan

    This is required as part of Data Migration where  i have to do 100 of table's update. Each time update table will defer, so its better to have in separate script file (.sql). Can u paste some sample/syntax to exceute .sql file from stored procedure. I am new to this PL/SQL.
    How have you determined that it's "better" to have seperate scripts?  I assume you mean the table name will "differ" (and not "defer" - I assume that's just because English isn't your first language? no problem - I think I understand what you're asking).
    So what I think you're asking is that you have dynamic table names but each table needs to be updated in the same way?
    Question: Why do you have tables with different names that all need the same process doing to them?
    Assuming it's a valid requirement (and 99% of the time doing dynamic coding implies it's not).... you could use dynamic code, rather than 'scripts'...
    e.g.
    create procedure update_table(tbl_name varchar2) is
    begin
      execute immediate 'update '||tbl_name||' set lastupdate = null';
    end;
    As you haven't bothered to provide a database version, any example code/data or explanation of what you're actually doing, you're not going to get any detailed answer.  Please do take the time to read the FAQ and post appropriate details so people can help you.

  • Calling SQL*Loader from Forms

    Hi,
    I was wondering if anyone has called SQL*Loader from Forms?
    What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
    Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
    Any ideas or guidance will be much appreciated.
    Thanks,
    Scott.

    Scott,
    In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
    What you have to do is :
    1. Bult up the string exacltly in the fashion which you will run in o/s
    2. Call the HOST Built-in and pass in the string
    Here's a example :
    Declare
    lOsCmd Varchar2(1000) := Null;
    Begin
    lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
    || ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
    || ' bad = c:\temp\abc.log';
    Host (lOsCmd, No_Screen);
    End;
    -- Shailender Mehta --

  • Execute sql files

    Hi,
    I'm trying to execute sql files located in
    unix environment using sqlplus from forms 6i
    in windows Me environment. I give the full
    directory like @/usr/users/oracle/toto.sql.
    But an error occures telling me that file
    cannot found (error SP2 0310).
    I hpe deeply that you can help me, please.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by dany:
    Hi,
    I'm trying to execute sql files located in
    unix environment using sqlplus from forms 6i
    in windows Me environment. I give the full
    directory like @/usr/users/oracle/toto.sql.
    But an error occures telling me that file
    cannot found (error SP2 0310).
    I hpe deeply that you can help me, please.<HR></BLOCKQUOTE>
    Be carreful of upper/lower-case. Unix is case sensitive !! Maybe @/usr/users/oracle/toto.SQL or @/usr/users/oracle/Toto.Sql or ...

  • Getting windows error during running the sql scripts from form 6i

    I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on form’s screen after pressing the form’s button but I am getting windows error during running the sql scripts from form 6i.
    I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
    This application runs fine with 8i.
    Please inform me where the problem is and how to overcome it.
    Zafri.

    I am using Text_IO in my form's when button press trigger , inorder to create the
    text file, then in the same when button press triger
    I am calling RMAN via host command in order to run the script which was created by text_IO.
    Below you find some of the code. I will appreciate if you solve the problem.
    when button press trigger:
    Declare
    in_file3 Text_IO.File_Type;
    linebuf3 VARCHAR2(1800);
    output11 varchar2(1000);
    BEGIN
         output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
    Host(output11,no_screen);
    :sql.execution_plan:= 'Working........................';
    synchronize;
    in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
    Text_IO.Put_Line(in_file3, linebuf3);
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop  varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.FCLOSE(in_file3)
              Declare
    un VARCHAR2(80);
    pw VARCHAR2(80);
    cn VARCHAR2(80);
    output VARCHAR2(1000);
    output2 VARCHAR2(1000);
    dummy varchar2(40);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    BEGIN
         Get_Connect_Info(un,pw,cn);
         /* for Plan_table Begg. Second INNER BLOCK */
         declare
              dummy2 varchar2(40);
         begin
         select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
         if dummy2 = 'PLAN_TABLE' then
         output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
    Host(output2,no_screen);
         end if;
         exception
         when no_data_found     then
    output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
    Host(output2,no_screen);
         end; --

  • Is there any way to call a sql file from a pl/sql block

    Hi,
    I want to call a sql file from a pl/sql block.
    the pl/sql block has an exception handler. The pl/sql block will execute the sql file and in case it throws error then the exception handler will take care of it.
    The sql file will be a master file and it will itself call other sql files.
    is it possible to call any sql file from pl/sql block ?

    When you say "sql file", what precisely do you mean? Do you have a file that has just SQL statements? Or do you have SQL*Plus scripts?
    Where are the files stored? Are they on your client machine? Or the database server?"which in turn calls other sql files" seems to imply that the answer to the first question is that you have SQL*Plus scripts. If you have SQL*Plus scripts, you need SQL*Plus to execute them. PL/SQL is running in the Oracle database, SQL*Plus is a client application. It is not practical to have PL/SQL call SQL*Plus. Since you've already ruled out the best of the bad options, it appears that the answer is no, you can't have your PL/SQL run these files.
    As Alex points out, that's probably a good thing. It sounds like your application has been designed incorrectly. If you need PL/SQL, you should be creating stored procedures and functions and calling those from PL/SQL. Having PL/SQL depend on code in flat files outside the database is not a good idea.
    Justin

  • Execute  *.sql file ????

    Hello every body.
    I need to execute a *.sql file from my VB 6.0 application.
    I connect to oracle by ODBC ....
    connBD.Open "PROVIDER=MSDASQL;dsn=PRUEBA;uid=" & Prueba.User.Text & ";pwd=" & Prueba.Password.Text & ";database=" & Prueba.connBD.Text & ";"
    Ok... no problem
    But,,, How can I do for execute my "cTable.sql" file???
    I try with ... connBD.Execute "@cTable.sql" , but no
    I try with ... connBD.Execute "START cTable.sql", but no..
    Some body can Help Me???
    Thank You very much
    Glenn

    SQL*Plus is generally the preferred tool to execute a .sql file-- that's what it is designed for. Assuming that your users all install SQL*Plus, you could call out to the command line and invoke that app with the .sql file, then parse the output.
    The other option would be to read in the .sql file in your application, parse it, and send the individual PL/SQL blocks to the database.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for