Running non .sql files

I am wanting to use Developer to edit and compile pl/sql packages, procedures, function etc. This is simple if the file ends in ".sql". Unfortunately the project I am working on has file extensions like ".pks",".fnc"....
Is there any way to modify the tool through preferences to allow me to right click or run the files into a database using the menu?

In JDeveloper 10.1.2 go to tools->preferences->file types
select the SQLNode and add whatever extensions you want to use.

Similar Messages

  • Oracle 9i export error after running catexp.sql file

    After running catexp.sql file in oracle 9i 9.2.0.7.0 as system user,it gives the following error while logging
    ORA-04020: deadlock detected while trying to lock object SYS.DBMS_STANDARD
    please help me..............

    "catexp.sql" is to be run by SYS AS SYSDBA.
    You'd have to cleanup any extra objects that you created in the SYSTEM account.
    Why did you think that you needed to run "catexp.sql" ? Are you exporting using 9i exp against a 10g database or against a 9i database ?

  • Running all *.sql files in one go

    Hi All,
    Can anyone help me in running all *.sql files in specific folder in one go??

    Go to Form Edit mode, enter the Fields list, press Ctrl+A, then Delete.

  • How to run the .sql file in sql prompt?

    i want to run the .sql file in sql prompt

    Hi,
    You can navigate to the directory where the .sql files is stored and launch the SQL Prompt.
    After you login, you can run your script like this :
    SQL>@my_script.sql;
    Regards,
    Sandeep

  • Java API for running entire ".sql" files on a remote DB ( mySQL or Oracle)?

    Hi,
    Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?
    It's enough if the API works with MySQL and/or Oracle.
    Just to demonstrate what i'm looking for:
    Suppose you've created sql file "c:/test.sql" with several script lines:
    -- test.sql:
    insert into TABLE1 values(3,3);
    insert into TABLE1 values(5,5);
    create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific
    Then the java API should look something like:
    // Dummy java code:
    String driver="com.mysql.jdbc.Driver";
    String url= "jdbc:mysql://localhost:3306/myDb";
    SomeAPI.executeScriptFile( "c:/test.sql", driver, url);
    Thanks.

    No such a API, but it's easy to parse all sqls in a file, then run those command:
    For instance:
    import java.sql.*;
    import java.util.Properties;
    /* A demo show how to load some sql statements. */
    public class testSQL {
    private final static Object[] getSQLStatements(java.util.Vector v) {
    Object[] statements = new Object[v.size()];
    Object temp;
    for (int i = 0; i < v.size(); i++) {
    temp = v.elementAt(i);
    if (temp instanceof java.util.Vector)
    statements[i] = getSQLStatements( (java.util.Vector) temp);
    else
    statements[i] = temp;
    return statements;
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    case '!': //Use it to get a large number of simple update statements
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    String part1 = temp.substring(1);
    String part2 = br.readLine();
    for (int i = -2890; i < 1388; i += 39)
    batchs.addElement(part1 + i + part2);
    for (int i = 1890; i < 2388; i += 53) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 4320; i > 4268; i--) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 9389; i > 7388; i -= 83)
    batchs.addElement(part1 + i + part2);
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    public static void main(String argv[]) {
    try {
    String url;
    Object[] statements;
    switch (argv.length) {
    case 0: //Use it for the simplest test
    case 1:
    url = "jdbc:dbf:/.";
    if (argv.length == 0) {
    statements = new String[1];
    statements[0] = "select * from test";
    else
    statements = argv;
    break;
    case 2:
    url = argv[0];
    statements = getSQLStatements(argv[1]);
    break;
    default:
    throw new Exception(
    "Syntax Error: java testSQL url sqlfile");
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    //Please see Connecting to the Database section of Chapter 2. Installation in Development Document
    Properties properties = new Properties();
    Connection con = DriverManager.getConnection(url, properties);
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    //Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    // stmt.setMaxRows(0);
    stmt.setFetchSize(10);
    final boolean serializeFlag = false;//A test switch to serialize/deserialize the resultSet
    ResultSet rs;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    if (serializeFlag) {
    // serialize the resultSet
    try {
    java.io.FileOutputStream fileOutputStream = new
    java.io.FileOutputStream("testrs.tmp");
    java.io.ObjectOutputStream
    objectOutputStream = new java.io.
    ObjectOutputStream(fileOutputStream);
    objectOutputStream.writeObject(rs);
    objectOutputStream.flush();
    objectOutputStream.close();
    fileOutputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    // deserialize the resultSet
    try {
    java.io.FileInputStream fileInputStream = new
    java.io.FileInputStream("testrs.tmp");
    java.io.ObjectInputStream objectInputStream = new
    java.io.ObjectInputStream(
    fileInputStream);
    rs = (ResultSet) objectInputStream.
    readObject();
    objectInputStream.close();
    fileInputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    // System.out.println(resultSetMetaData.getColumnName(j));
    /* System.out.println(resultSetMetaData.getColumnType(j));
    System.out.println(resultSetMetaData.getColumnDisplaySize(j));
    System.out.println(resultSetMetaData.getPrecision(j));
    System.out.println(resultSetMetaData.getScale(j));
    System.out.println(resultSetMetaData.
    getColumnLabel(j)
    + " " +
    resultSetMetaData.getColumnTypeName(j));
    Object colval;
    rs.beforeFirst();
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the resultSet release its open tables at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();
    stmt.close();
    con.close();
    catch (SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" + sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • Do we need run catbundle.sql file for new databases.

    dear all,
    i have doubt over execution of catbundle.sql or not?
    scenario:
    i have insatlled 10gr2 on rhel5 and applied patchset 4 (10.2.0.5) and applied Oracle® Database Patch 10248542 - 10.2.0.5.2 Patch Set Update
    after this i have create fresh database.
    now,
    in Oracle® Database Patch 10248542 - 10.2.0.5.2 Patch Set Update document it has specified in belwo section
    3.4 Post Installation Instructions for Databases Created or Upgraded after Installation of PSU 10.2.0.5.2 in the Oracle Home
    These instructions are for a database that is created or upgraded after the installation of PSU 10.2.0.5.2.
    You must execute the steps in Section 3.3.2, "Loading Modified SQL Files into the Database" for any new database only if it was created by any of the following methods:
    Using DBCA (Database Configuration Assistant) to select a sample database (General, Data Warehouse, Transaction Processing)
    Using a script that was created by DBCA that creates a database from a sample database
    Cloning a database that was created by either of the two preceding methods, and if the steps in Section 3.3.2, "Loading Modified SQL Files into the Database" were not executed after PSU 10.2.0.5.2 was applied
    Upgraded databases do not require any post-installation steps.
    so do we need to run catbundle here or not.
    since i have created fresh database after applying 10.2.0.5 PSU2 why does it required.
    opatch output:
    [oracle@RG615 ~]$ opatch lsinventory
    Invoking OPatch 10.2.0.5.1
    Oracle Interim Patch Installer version 10.2.0.5.1
    Copyright (c) 2010, Oracle Corporation. All rights reserved.
    Oracle Home : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1
    Central Inventory : /prd/crm/swbcrmdb/usr/oracle/oraInventory
    from : /etc/oraInst.loc
    OPatch version : 10.2.0.5.1
    OUI version : 10.2.0.5.0
    OUI location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/oui
    Log file location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-05-03_11-41-34AM.log
    Patch history file: /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
    Lsinventory Output file location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-05-03_11-41-34AM.txt
    Installed Top-level Products (2):
    Oracle Database 10g 10.2.0.1.0
    Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0
    There are 2 products installed in this Oracle Home.
    Interim patches (1) :
    Patch 10248542 : applied on Tue May 03 07:32:29 BST 2011
    Unique Patch ID: 13292123
    Created on 25 Dec 2010, 23:11:24 hrs PST8PDT
    Bugs fixed:
    6402302, 9713537, 8350262, 9949948, 8394351, 10327179, 8546356, 9711859
    9714832, 9952230, 10248542, 8544696, 9963497, 9772888, 8664189, 10249537
    7519406, 9952270, 8277300, 9726739
    OPatch succeeded.

    Pl post the output of view DBA_REGISTRY_HISTORY - see MOS Doc 605795.1 (Introduction To Oracle Database catbundle.sql)
    Was the database created using DBCA or manually using scripts ?
    Srini

  • Run a sql file from java

    I have a SQL file named myfile.sql which contains something as follows:-Declare
    Begin
    insert into alphaweb values (1);
    end;
    .What I am looking for is a way to execute this through a java code. e.g. something like reading the String from the the file and executing it.
    public static boolean executeScript(File script, Connection conn) {
              boolean success = true;
              success = script.exists();
              if (success) {
                   System.out.println("ES::READING SCRIPT:" + script.getAbsolutePath());
                   StringBuffer buffer = null;
                   try {
                        buffer = readFileAsString("myfile.sql");
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   }//new StringBuffer();
                   //success = readScript(script, buffer);
                   if (null!=buffer) {
                        try {
                             String creationScript = buffer.toString();
                             Statement st = conn.createStatement();
                             int start = 0;
                             int end = 0;
                             while (end != -1 && start < creationScript.length()) {
                                  end = creationScript.lastIndexOf ('/');
                                  if (end != -1) {
                                       System.out.println(creationScript.substring(start, end));
                                       st.executeUpdate(creationScript.substring(start, end));
                                       start = end + 2; // 2 is the length of "GO"
                             st.close();
                        } catch (Exception e) {
                             success = false;
                             System.out.println(e);
              } else {
                   System.out.println("ES::SCRIPT FILE DOES NOT EXISTS");
                   success = false;
              return success;
         }But it is failing any ideas if it is possible and what am I doing wrong?

    I believe the sample that you provided only has a single statement in it.
    Do the files only contain one block like that?
    If yes then you should be able to process them as a single statement. Just drop the terminator at the end (maybe wrap it in another block statement...)
    If not then your solutions are.
    1. Parse the file yourself.
    2. Use the oracle command line tool and feed it to that.

  • Sqlplus script to run all *.sql files returned by snv diff --summarize

    Hi,
    Is there a way to write a sqlplus script which will ask for a directory (or input from an svn diff --summarize) as in input param , then loop recursively through all files returned and run them from within as: @filename.sql ?
    Getting it to work with svn diff would be the icing on the cake.
    Thanks,
    JGP

    Or maybe like this:
    REM Script name: deploy_all.cmd
    REM Parameter 1: Schema name
    @echo off
    set schema=%1
    echo -- Scripts to execute:
    echo set define ~
    echo def target_schema_name=~1
    echo alter session set current_schema=~~target_schema_name;
    for /F "tokens=1* " %%g in ('svn diff -r 14830:head --summarize') do (
      for /F "tokens=1* delims=. " %%k in ("%%h") do (if [%%l] equ [sql] echo @%%k.%%l)
    ) >deploy_all.sql
    type deploy_all.sql
    sqlplus usrid/pw @deploy_all.sql %schema%PS: Even to execute everything from SQLPLUS, you still would need to create a temporary file with the list of commands.
    Something like this:
    alter session set current_schema=&&target_schema_name;
    host "Windoze script w/command to create list of files to execute"
    @created_sql_file.sql

  • Error when running a  .sql file

    hello all.
    i keep getting an error when i try to install sample schemes for APEX on XE.
    I was wondering if any could help
    thank you:)
    ================
    ================
    SQL> @oehr_sample_objects_installer.sql
    APPLICATION 543 - OEHR Sample Objects
    Set Credentials...
    Check Compatibility...
    API Last Extended:20090112
    Your Current Version:20090112
    This import is compatible with version: 20060224
    COMPATIBLE (You should be able to run this import without issues.)
    Set Application ID...
    begin
    ERROR at line 1:
    ORA-02291: integrity constraint (APEX_030200.WWV_FLOWS_FK) violated - parent
    key not found
    ORA-06512: at "APEX_030200.WWV_FLOW_API", line 555
    ORA-06512: at line 3
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Produ
    ction
    C:\TEMP\apex>

    i went to that link and tried to insert MOS Doc 949429.1
    as a support identifier and it does not recognize it.
    i tried just 949429.1 and 949429 and still success.
    what is the right code for this support identifier?
    thank you :)

  • Running sqlScript *.sql file through JDBC

    java.lang.AbstractMethodError: weblogic/jdbcbase/mssqlserver4/TdsStatement.addBatch
    help me,
    please
    cheers
    and thanks,
    krishna

    java.lang.AbstractMethodError: weblogic/jdbcbase/mssqlserver4/TdsStatement.addBatch
    help me,
    please
    cheers
    and thanks,
    krishna

  • Running SQL files in PL/SQL Cartdrige - OAS407

    Hai!
    I am unable to run the SQL file via a PL/SQL cartridge(without
    creating the Stored procedure). I am able to run the SQL file
    which is given in the sample&demos through the 'admin' listener
    (port 8889). When i doing it through some other listener i am
    getting error saying that URL not found.
    I think I have configured the virtual path correctly for my
    application and Cartridge.
    Is there any thing else I am missing?
    Thank you
    Phanesh
    null

    I am working on this too. I am sure that the problem is the
    procedures for the HTM are not install correctly. I read one
    part of the documentation, it said that you have to log in as
    SYS and grant some procedure to USER, but I forgot. If you
    found it, PLEASE let me know. Thanks.
    Phanesh (guest) wrote:
    : Hai!
    : I am unable to run the SQL file via a PL/SQL cartridge(without
    : creating the Stored procedure). I am able to run the SQL file
    : which is given in the sample&demos through the 'admin' listener
    : (port 8889). When i doing it through some other listener i am
    : getting error saying that URL not found.
    : I think I have configured the virtual path correctly for my
    : application and Cartridge.
    : Is there any thing else I am missing?
    : Thank you
    : Phanesh
    null

  • Is it possible to run .sql files in oracle

    Hi
    I have a .sql file which contains the scripts of the tables .Is it possible for me to run the .sql file in oracle or will i have to run the scripts of each tables separately becoz there is about 240 table scripts in that single .sql file. In mysql by giving " \.filename.sql " the whole scripts in the .sql file will get executed .Is there any thing like this in oracle9i.Also i want to know how to make a dump file in oracle and to run that?
    Thanking you in advance

    Hi
    I did the way u said the whole script file is running but the execution of the script is not happening. The below is a part of script but the table creation is not happening at the end of each table script
    5946 drop table lms_class_permission;
    5947 CREATE TABLE lms_class_permission (
    5948 pk_permission_id NUMBER(11) NOT NULL ,
    5949 fk_class_Id NUMBER(11) default NULL,
    5950 fkSysGroupId NUMBER(11) default NULL,
    5951 perm NUMBER(11) default '0',
    5952 CONSTRAINT pk_permission_id_lms_class PRIMARY KEY (pk_permission_id),
    5953 CONSTRAINT uk_lms_class_permission UNIQUE (fk_class_Id,fkSysGroupId),
    5954 CONSTRAINT fk_lms_Class_Permission_1 FOREIGN KEY (fk_class_Id) REFERENCES lms_class (pk_class
    5955 CONSTRAINT fk_lms_Class_Permission_2 FOREIGN KEY (fkSysGroupId) REFERENCES t_system_groups (g
    5956 );
    5957 create index fk_class_Id_lms_class_perm on lms_class_permission (fk_class_Id);
    5958 create index fkSysGroupId on lms_class_permission (fkSysGroupId);
    5959 CREATE SEQUENCE lms_class_permission_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 2147483647 NO
    5960 CREATE OR REPLACE TRIGGER TR_lms_class_permission_BI
    5961 BEFORE INSERT
    5962 ON lms_class_permission
    5963 REFERENCING NEW AS NEW OLD AS OLD
    5964 FOR EACH ROW
    5965 BEGIN
    5966 SELECT lms_class_permission_SEQ.NEXTVAL INTO :NEW.pk_permission_id FROM dual;
    5967 END ;
    5968 drop table lms_contact_us ;
    5969 CREATE TABLE lms_contact_us (
    5970 pkautoid NUMBER(10) not null ,
    5971 user_name VARCHAR2(255) default '0',
    5972 email VARCHAR2(255) default '0',
    5973 subject VARCHAR2(1000),
    5974 message VARCHAR2(1000),
    5975 loginId VARCHAR2(255) default NULL,
    5976 status NUMBER(11) default NULL,
    5977 classId NUMBER(11) default NULL,
    5978 CONSTRAINT pkautoid_lms_contact_us PRIMARY KEY (pkautoid)
    5979 );
    5980 CREATE SEQUENCE lms_contact_us_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 2147483647 NOCYCLE NO
    5981 CREATE OR REPLACE TRIGGER TR_lms_contact_us_BI
    5982 BEFORE INSERT
    5983 ON lms_contact_us
    5984 REFERENCING NEW AS NEW OLD AS OLD
    5985 FOR EACH ROW
    5986 BEGIN
    5987 SELECT lms_contact_us_SEQ.NEXTVAL INTO :NEW.pkautoid FROM dual;
    5988 END ;
    5989 drop table borland_feedback ;
    5990 CREATE TABLE borland_feedback (
    5991 pkautoid NUMBER(10) not null ,
    5992 FeedTitle VARCHAR2(1000),
    5993 FeedBody VARCHAR2(1000),
    5994 EnteredBy NUMBER(11) default '0',
    5995 FeedStatus NUMBER(11) default '0',
    5996 FeedEnteredDate TIMESTAMP,
    5997 CONSTRAINT pkautoid_borland_feedback PRIMARY KEY (pkautoid)
    5998 );
    5999 CREATE SEQUENCE borland_feedback_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 2147483647 NOCYCLE
    6000 CREATE OR REPLACE TRIGGER TR_borland_feedback_BI
    6001 BEFORE INSERT
    6002 ON borland_feedback
    6003 REFERENCING NEW AS NEW OLD AS OLD
    6004 FOR EACH ROW
    6005 BEGIN
    6006 SELECT borland_feedback_SEQ.NEXTVAL INTO :NEW.pkautoid FROM dual;
    6007 END ;
    Thanking you advance
    dinny

  • Running sql commands from a .sql file

    Hello , I have this problem. How do i execute sql commands found in a .sql file with jdbc. My RDBMS is mysql.

    You will have to open and parse the .sql file, connect to the database, and execute the statements. You can't simply tell JDBC to run your .sql file.
    Depending on the complexity of your .sql file this is easy or hard. If its a bunch of e.g. updates or deletes or something you may be able to get away with running it as a block. In Oracle for example, you can put "begin" and "end;" around a bunch of statements and run it all together. In that case your program would open the SQL file, read the text, put it inside a "begin" and "end;", and run it as a single SQL statement.
    If its a bunch of statements that must be run independently then you'll have to programatically split them up to run one at a time. If its a select and you want to e.g. print results to the screen, well, then it gets tougher...
    - Jemiah

  • How to run a sql script in oracle forms

    Hi,
    For me there is an sql script. I need to run that sql script in forms.
    Actually we will run that sql file in pl/sql developer by giving @and the file name.
    But how to run that file in forms.
    Can any one help on these.Which book I have to look.
    Thanks

    Actually there is a script files which will drop all the indexes and tables.
    DROP querry will be there for each index and each table.
    So I run the script all the indexes and all the tables will be deleted. So using forms I have to run that script.
    Thanks

Maybe you are looking for