How can I run a SQL script file...

How can I run a SQL script file from a location on my computer without providing the whole path?
Is there some way I can set a "Working folder" in SQL Plus??
Thanks!
Tom

You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
scripts.
I would like to use another directory than the oracle/bin...
How can I do this ??
Hello,
U can do this by this way:
Save odm_script.sql file to the default Oracle
directory i.e. Oracle-Home/bin and Run following command
through SQL Plus.
SQL>@Script_Name
I hope this will resolve ur problem.
Regards,
Omer Saeed Khan.

Similar Messages

  • How Can I Run a SQL Loader Job from Schedular

    How Can I Run a SQL Loader Job from Schedular , So that It Runs every Day.

    Depends on a couple of factors.
    If you are on a UNIX platform, you can create a shell script and schedule it with cron.
    If you are on a Windows platform, you can create a batch file and schedule it with the Windows scheduler.
    Or, if you are on Oracle 9i or 10g, you could use the external table feature instead of SQL*Loader. Then you could write a stored procedure to process the external table and schedule it using the Oracle scheduler (DBMS_JOB). This would probably be my preference.

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    Please advise...
    VJ

    cross posted
    http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • How can I run a labview executable file inside a VI

    How can i add and run a labview executable file inside the vi and grab the output of the executable file to be used in the vi?
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    Hi cmdrb,
    to run an executable you use SystemExec function.
    To get the output of your (LabVIEW-made) executable you need to program some data transfer means: you may use network functions or file functions. In both cases your "LabVIEW executable" needs to provide that options…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can you detect (from a script file) that javac found problems?

    The subject line says it all, but the background is:
    I have a script file (.bat, since am stuck on windoze for the moment) which is doing some compilation using javac.
    I would like to skip all subsequent activities in the script file after the call to javac if any file failed to compile.
    So, what can I use as a signal from javac that it found a problem?
    I initially tried detecting an exit code from javac that was non zero, but javac does not seem to emit such an exit coe when it objects to a file (it still returns with 0 as an exit code).
    The only remaining strategy that I can think of is to pipe javac's output to a file, and if there is any content in it then assume that it indicates an error and use that as a signal.
    This is suboptimal because it will give false signals for mere warnings, so if anyone has a better suggestion, please post

    You are right: it appears that javac does exit with an exit code of 1 if an error is detected in one of the files being compiled, at least on the windows jdk.
    To prove this, create an arbitrary java source file called HelloWorld.java, and create a msdos .bat file in the same directory that looks like
    @echo on
    javac  -Xlint:deprecation  HelloWorld.java
    :handleError
    @if not errorlevel 1 goto finalActions
    @echo ERROR DETECTED: compile.bat will TERMINATE PREMATURELY
    :finalActions
    @echo compile.bat now terminatedBy playing around with what you put in the source file (totally clean code, stuff that should compile but issue a warning, and garbage that should not compile) as well as with the exit code value detected by the .bat file, for instance trying
    @if not errorlevel 2 goto finalActions(see http://www.robvanderwoude.com/errorlevel.html if you need some documentation on error codes in dos bat files), I have determined the following as javac's behavior on windows:
    If code is pristine, exit code = 0.
    If code causes javac to emit a warning but is compilable, exit code = 0.
    If code cannot be compiled, exit code = 1.

  • How can I see the current script file name in Vision Builder

    I would like to not have to remember which script file I have open. Is that displayed somewhere?

    Brian,
    I have been looking over Vision Builder 6.1, and from what I can tell, the name of the file that you are working on is not displayed on the screen, and there does not appear to be a way to get it to display there.
    This seems like a very worthwhile feature to add, and I definitely agree that it would be useful. You may want to consider filing a Product Suggestion by using the Product Suggestion Center (PSC) that is linked below:
    Product Suggestion Center
    The PSC links directly into our R&D group's suggestion database, and any suggestions entered would be reviewed by the R&D team.
    Regards,
    Jed R.
    Applications Engineer
    National Instruments

  • How can I get my Post Script files to print from a designated side?

    We're printing Cards through a PS combatible printer.
    The Vertical Cards are flat fed through the printer and the image is printing.
    However, I cannot consistently get the image to print out from the same side.
    Using Illustrator CS2, CS3 and CS4, we were able to get good results only using CS3.
    Since most of us are using CS4, we'll need to make this work, rather than toggling
    between versions.
    There must be some parameters that we are missing.
    Suggestions?
    How can we get the images to print consistently from the same side?

    Sounds more like an issue with the various combinations of AI and the PostScript printer drivers producing different PS being sent to the printer and naturally the printer producing a result based on the interpretation, which is perfectly correct. Short of printing it as bitmap data I don't see an easy way to fix this. this clearly requires som computer person to check it hands on and install the correct drivers and define the correct default settings...
    Mylenium

  • How can i run Following SQL Server Script in to Oracle 10g

    I m new in Oracle...
    Create Procedure Insert_profilebasicdetail
    @isubprofileid as int,
    @Copyisubprofileid as int,
    @itranno as int,
    As
    Begin
    Declare @IncKeyId as int
    Declare @tempkeyId as int
    set @IncKeyId=(select isNull(Max(ikeyId),0)as MaxKeyId from profilebasicdetail)
    Declare TempInsert cursor for select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
    from profilebasicdetail where isubprofileid=@Copyisubprofileid and itranno=@itranno
    open TempInsert
    fetch from TempInsert into @tempkeyId
    while @@fetch_Status=0
    Begin
    set @IncKeyId = @IncKeyId + 1
    Insert into profilebasicdetail
    (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
    values(select @IncKeyId,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,'1',
    iyear,@isubprofileid from profilebasicdetail where ikeyId=@tempkeyId)
    fetch next from TempInsert into @tempkeyId
    End
    End
    Regards,
    Ajay

    YOu want to migrate your MS sql server procedure to Oracle procedure
    Before running procedure please set the values of tempkeyId_v variable
    Try this
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh
    Create or replace Procedure Insert_profilebasicdetail( isubprofileid_v  number, Copyisubprofileid_v number, itranno_v number )
    As
         IncKeyId_v  profilebasicdetail.ikeyid%type;
         tempkeyId_v profilebasicdetail.ikeyid%type;
    begin
          select nvl((select Max(ikeyId) as MaxKeyId from profilebasicdetail),0) into IncKeyId_v
          from dual ;
         for i in (select ikeyId--,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear
                from profilebasicdetail
                where isubprofileid=Copyisubprofileid_v and itranno=itranno_v)
         loop
              IncKeyId_v = IncKeyId_v + 1;
              Insert into profilebasicdetail
                   (ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
                   values(select IncKeyId_v,i.iprofileid,i.iquestionid,i.vquestionans,i.cstatusindi,i.dmodifyon,i.imodifyby,'1',
                        i.iyear,isubprofileid_v from profilebasicdetail where ikeyId=tempkeyId_v);
         end loop
    End;
    / Regards
    Singh

  • How can i run an excel(PC) file with macros on numbers

    I am new to mac OS. I am trying to run an excel file that was created for windows and has macros on either numbers or or ms excel for MAC and it does not work. Help?

    You cannot.  You shold purchase MSExcel for Mac (after you confirm that is also runs macros, there was a period of time where it didn't so I am not sure).
    Numbers will not run macros and it the wrong tool for your case.  It is possible to create similar behavior if you are willing to port the Excel macros to Applescript.

  • How can I run a Unix script from a desktop icon?

    I have a Unix script I've created in vi and would like to run it by double clicking on an icon on my desktop. I would like to do this without the additional application layer of Applescript, Automator or Terminal. Is this possible?
    Thanks in advance.
    Howard

    Sounds like a job for platypus.

  • Using an SQL Script file to create database in Java? (monkeyDB.sql)

    Hello!
    I am a writing an SQL Script so that I can re-create my database on another server (im using my laptop to test it on first though).
    I'm connecting to mySQL server using JDBC which works fine, but I was wondering
    how can I run an entire script file, say myScript.sql from within a Java class??
    (an SQL Script is simply a file containing the regular SQL commands and expressions that you might enter at an sql command line prompt)
    example of an SQL Scritp: monkeyDB.sql>>
    //#create new db
    CREATE DATABASE sample_db;
    //#set active db
    USE sample_db;
    //#set table paramaters
    CREATE TABLE monkeys
    (name CHAR(20),
      age INT UNSIGNED,
      sex ENUM('M','F')
    //#create standard monkeys
    INSERT INTO monkeys(name,age,sex) VALUES("Sammy",10,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Muncht",12,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Jill",8,"F");
    //#get recordset
    SELECT * FROM monkeys WHERE age < 50;Thanks for your help!

    thanks. :-)
    I thought about that too but I didnt want to hard wire it into the code.
    I guess it isnt possible to output the script file using some command from the sql library..?

  • How can i run .app executable  file

    Hi,
    While i was searching for my topic on google code, i found one project and i download that.
    But its "MyProject.app" with yellow cplored xcode sumbol and i can not run this file.
    Does any one know that how can i run this type of file. i want to run this project.
    And another question. I want to create executable file from my project like exe on windows. Is there any way to create this type of file????
    Thanks.

    vavdiyaharesh wrote:
    Hey,
    When i double click on .app file it quit and show me message like "The application project140 quit unexpectedly"........."
    So is there any problem in .app file?
    On your machine sure sounds like it.
    How can i create exe file and how can i pass -0 to compiler ..iu don;t see any option in xcode for that.....
    giove me solution...
    I think you'd be better off taking some training, or at least working through some of Apple's tutorials.
    http://developer.apple.com/documentation/developertools/conceptual/XcodeQuickTou r/qtintro/chapter_1_section1.html
    Thanks.
    You're welcome.

  • How can i run this query in BI Answers

    Hi,
    pls tell me how can i run this sql statement in BI Answers....???
    select abc_date,abc_asset_desc,sum(nvl(abc_market_val_lcy,0)+nvl(abc_accr_lcy,0)) "total balance" from abc
    group by abc_date,abc_asset_desc;any help would be appriciated.... :-)
    Regards

    Strange question this one.
    normally with Answers you pick the columns you want to report on and the BI server will construct the SQL for you.
    In this example you would need a star with the abc dimension logical table and a logical fact for abc (these can be in the same table), which has a calculated field for 'Total Balance'.
    You then pick the columns you require and Answer and the BI will automatically add the group by.
    Adrian
    Majendi

Maybe you are looking for