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

Similar Messages

  • How to run the SQL Script in SQL Prompt?

    Hi ExpertGroup,
    I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
    Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
    Let me know, How to Run in SQl Prompt.
    Thanks & Regards,
    Senthil K Kumar.

    This is my SQL Script....
    SET COLSEP '|'
    SET LINESIZE 32767
    SET PAGESIZE 50000
    /* SET LINESIZE 3000
    SET PAGESIZE 50000
    SET DEFINE OFF */
    SET ECHO OFF
    SET FEEDBACK OFF
    --SET HEADING OFF
    SET TRIMSPOOL ON
    SET NEWPAGE NONE
    SET UNDERLINE OFF
    SPOOL &&EnterPath;
    SELECT * FROM &&TableName;
    SPOOL OFF
    SET FEEDBACK ON
    --SET DEFINE ON
    PROMPT Done.
    I am able to run this script in SQL Prompt....
    Its executing fine...
    But, If I am executing again it maynot asking for new set of data....
    alternativily its taking old values only.....
    how can i exeute with new set of data in the sql prompt.....

  • How to run the batch files

    Hi Experts,
    I am trying to implement automatic cache purging every day at specified time and i created txt file with SApurge All cache() and created bat file with nqcmd -q Analyticsweb -u username -p password -s (txt file location).
    Now i want to run this bat file daily at specified time with out executing manually may i know how to run the batch file at specified time .
    Thanks,

    There is task type as command in workflow manager if you want you can go for that during the load
    nqcmd -d "AnalyticsWeb" -u Administrator -p Administrator -s "D:\PowerCenter8.1.1\server\infa_shared\SrcFiles\1_BIPurgeCache.txt"
    Check these urls
    http://docs.oracle.com/cd/E12103_01/books/AnySched/AnySched_Scripts3.html
    http://deliverbi.blogspot.com/2011/12/purge-all-cache-from-dashboard.html

  • How to run the .jpx file?

    I have made the project using jbuilder in .jpx. how to run my project without jbuilder?

    I tried to running the demo file from JBuilder.
    I have followed the steps, but still error.
    I did the steps bellow:
    cd {my project\classes}
    C:\Program Files\JBuilder6\sampless\IPWorks\telnet\classes>C:\java\bin\java -cp . UnnamedPackage.dep2.TelnetDemo
    the error was:
    Exception in thread "main" java.lang.NoClassDefFoundError:UnnamedPackage\dep2\TelnetDemo
    and then I set CLASSPATH=C:\Program Files\JBuilder\sampless\IPWorks\telnet\classes
    the error is the same.
    when the command was C:\Program Files\JBuilder6\sampless\IPWorks\telnet\classes>C:\java\bin\java TelnetDemo
    the error was:
    Exception in thread "main" java.lang.NoClassDefFoundError: ipworks/IPWorksException
    in the classes dir, there is package cache dir and the inside of this dir there is a file UnnamedPackage.dep2
    So whats wrong with my command?

  • How to run the jsp file

    i am writing a simple jsp file
    i dont know how to run in the tomcat server
    for servlets first i created the dot class files by using the command prompt and then in the tomcat server we go the webapps folder and i copy the class files and due to xml file i run the program
    I have added the jsp-api.jar and el-api.jar files in the environment variables so what i do to run the jsp
    can anyone can tell me how to do that
    here is the program
    <%@page contentType="text/html" import="java.util.*" %>
    <!--
    Date.jsp
    -->
    <html>
    <body>
    <p> </p>
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing
    ="0" width="460" bgcolor="#EEFFCA">
    <tr>
    <td width="100%"><font size="6" color
    ="#008000"> Date Example</font></td>
    </tr>
    <tr>
    <td width="100%"><b> Current Date
    and time is: <font color="#FF0000">
    <%= new java.util.Date() %>
    </font></b></td>
    </tr>
    </table>
    </center>
    </div>
    </body>
    </html>

    i am getting an http 500 error for running the jsp file
    here is the code
    <%@ page import="java.util.Date" %>
    <% Date now = new Date(); %>
    <html>
    <body>
    <p>Hello, world! It is now <%= now.toString() %>.</p>
    </body>
    </html>

  • How to run the wav file

    Hi
    im using netbeans
    i write the following code to play wav file
    try {
                    Player p = null;
                    try {
                        p = Manager.createPlayer("myfile.wav");
                    } catch (MediaException ex) {
                        ex.printStackTrace();
                    } catch (IOException ex) {
                        ex.printStackTrace();
                    p.start();
                } catch (MediaException ex) {
                    ex.printStackTrace();
                }i try to put in the directory of the project nothing !! or src directory !!!
    now where to put that wav file to run it on the emulator?
    and what if i want to my program plays any wav file in the phone i mean apply my program to any wav file when i click on it?
    thanks in advance.

    also i try this code
    InputStream is = getClass().getResourceAsStream("/myfile.wav");
                Player player = null;
                try {
                    player = Manager.createPlayer(is, "audio/x-wav");
                } catch (MediaException ex) {
                    ex.printStackTrace();
                } catch (IOException ex) {
                    ex.printStackTrace();
                try {               
                    player.start();
                } catch (MediaException ex) {
                    ex.printStackTrace();
                }

  • How to run the java file from notepate or jedit

    i hope u will solve my probs

    JEdit has a JCompiler plugin to allow compilation and a Console plugin to allow execution.

  • How to run the JNLP from Command Line

    Hi All,
    how to run the JNLP file from the remote machine from our command line. I have requirement to run this JNLP file in java 1.4.2 version. Can any one tell me the procedure or the steps that are needed to run this file at command prompt.
    Regards,
    Prasanna.
    Edited by: VPrasanna on May 19, 2008 4:43 AM

    >
    I am getting "**java.security.AccessControlException: access denied (java.net.SocketPermission wwwgate0.mot.com:1080 connect,resolve)**" when I start the Web Start Client. >This seems like a largely separate problem to running the JNLP from the command line. It might have been better to end this thread (assign the dukes) and start a new one.
    >
    ..Can you help me in resolving this issue. >However, I suspect I can guess the problem.
    If this app. is normally hosted on wwwgate0.mot.com then it can 'phone home' to the server without further permission, but if you are running it from the command line, that might not be the codebase anymore.
    If you wish to do 'local testing' of such an app., I would recommend setting up a server like Tomcat on the local machine, and serving the test app. directly off that.
    >
    ..Its urgent...>Sun offers a number of options for urgent matters, such as support tickets. Perhaps you should look into one of those.

  • How to get the SQL Signon that Agent Jobs "Run As" or "Executed as User"

    How to get the SQL Signon that Agent Jobs "Run As" or "Executed as User"?
    I have an install SQL scripts that creates a Linked Server. I want to put some security on the Linked Server and only grant the Agent Job Signon (the "Run As" or "Executed as User") access to the linked server. I need to retrieve the
    Agent Job Signon (something like "NT SERVICE\SQLAgent$FIDEV360BI02").
    I could query certain jobs and SUBSTRING the Message column - using some form of the query below, which would return "Executed as user: NT SERVICE\SQLAgent$SSDEVBI02. The step succeeded." But that is pretty imprecise.
    use msdb
    SELECT [JobName] = JOB.name,
    [Step] = HIST.step_id,
    [StepName] = HIST.step_name,
    [Message] = HIST.message,
    [Status] = CASE WHEN HIST.run_status = 0 THEN 'Failed'
    WHEN HIST.run_status = 1 THEN 'Succeeded'
    WHEN HIST.run_status = 2 THEN 'Retry'
    WHEN HIST.run_status = 3 THEN 'Canceled'
    END,
    [RunDate] = HIST.run_date,
    [RunTime] = HIST.run_time,
    [Duration] = HIST.run_duration,
    [Retries] = HIST.retries_attempted
    FROM sysjobs JOB
    INNER JOIN sysjobhistory HIST ON HIST.job_id = JOB.job_id
    -- CHANGE THIS
    -- WHERE JOB.name like '%GroupMaster%' or Job.name like '%etlv%'
    ORDER BY HIST.run_date, HIST.run_time

    by default all sql jobs are executed as sql server agent account, unless otherwise a proxy is setup.
    you can get the proxy information as Olaf mentioned, if the proxy_id is null for the step, it implies that the job step was executed as sql server service account and in such case it will be null
    so, if it is null, it ran as sql server agent account.
    so, one work around is get the sql server agent service account and if the proxy is null, that means it ran as sql server agent account, so, use isnull function. the disadvantage would be if the sql server agent account was switched, you might not get the
    accurate information as the new account will show up though the job really ran as old account, to get this information, you need to  get this from the logmessage column as you mentioned above.
     try this code...
    /*from sql 2008r2 sp1, you get the service accounts using tsql,otherwise you have to query the registry keys*/
    declare @sqlserveragentaccount varchar(2000)
    select @sqlserveragentaccount= service_account
    from sys.dm_server_services
    where servicename like '%sql%server%agent%'
    select message,isnull(name,@sqlserveragentaccount) as AccountName
    from sysjobhistory a inner join sysjobsteps b
    on a.step_id=b.step_id and a.job_id=b.job_id
    left outer join sysproxies c on c.proxy_id=b.proxy_id
    Hope it Helps!!

  • How to run a SQL manually with the same SQL_ID

    I want to know how to run a SQL which comes from application side manually so that same SQL_ID is generated. I am aware that even if there is a small change in the sql(even a space) the sql_id gets changed. CURSOR_SHARING_PARAMETER is similar in my DB.
    Thanks
    Rudresh

    I think you really want is the execution plan (plan_hash_value), what about outlines ?
    HTH
    Antonio NAVARRO

  • How to find the SQL Server Instances running across the given activer directory domain?

    How to find the SQL Server Instances running across the given activer directory domain?
    I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.
    I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.
    Sivaprasad S
    http://sivasql.blogspot.com
    Please click the Mark as Answer button if a post solves your problem!

    Dear ,
    Very simple u find all instances through the customized sp which is get all details about inventory. Like i put the sp bellow. This is without any tool. 
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[DBStatus]    Script Date: 08-01-2015 19:46:11 By Damodar Patle Sr. DBA Mumbai India ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[DBStatus] 
    AS
    SELECT 
    SERVERPROPERTY('servername') AS ServerName,
    ConnectionProperty('local_net_address') AS 'local_net_address',
    ConnectionProperty('local_tcp_port') AS 'local_tcp_port',
    CONVERT(VARCHAR(25), @@VERSION) as  VERSIONSQL,
    SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFilePath,
    database_id,
    CONVERT(VARCHAR(25), DB.name) AS DBName,
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'Recovery')) AS [Recovery_Model],
    create_date as DBCreate_Date, --physical_device_name,
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS DataFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS [Data MB],
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS LogFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS [Log MB],
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS MDF_File_Location,
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS  LDF_File_Location,
       user_access_desc
       FROM sys.databases DB
       ORDER BY dbName, [Log MB] DESC, NAME

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

  • How to invoke the sql lodaer?

    hi,
    i have installed oracle 10g and the loader should have been installed by default as i have been told. Can you tell me how to invoke the loader?. I tried sqlldr in the sql> prompt but receive a "command not known" error.
    thx

    Hi,
    If you set ORACLE_HOME enviroment variables, then just typing command sqlldr should work.
    http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#BABDGCHH
    Br, Jari

  • How to view the sql query?

    hi,
      how to view the sql query formed from the xml structure in the receiver jdbc?

    You can view SAP Note at
    http://service.sap.com/notes
    But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
    Reason and Prerequisites
    You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
    Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
    Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
    When you want to use a parameter documented here, please be aware to which category it belongs!
    Solution
    The following list shows all available parameters of category 1 or 2. Please note:
    Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
    Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
    The default value of a parameter is always chosen that it does not change the standard functionality
    JDBC Receiver Adapter Parameters
    1. Parameter name: "logSQLStatement"
                  Parameter type: boolean
                  Parameter value: true for any string value, false only for empty string
                  Parameter value default: false (empty String)
                  Available with: SP9
                  Category: 2
                  Description:
                  When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
                  This should be used only during the test phase and not in productive scenarios.
    Regards,
    Prateek

  • How to run the report and show the output in excel file

    salam
    how to run the report and show the output in excel file,
    how to run the report and print the o/p via printer
    how to run the report and send the o/p via mail
    thank u all

    Hi,
    There are Parameters DESTTYPE, DESFORMAT and DESNAME. You can set these parameters to get as you want.
    1) Output in Excel File
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
         ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'DELIMITED');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<file_name>.XLS');2) output to printer
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<printer_name>');3) Email - Have to configure SMTP and all. ( i didn't checked it)
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'MAIL');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<email_id>');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

Maybe you are looking for

  • HT4539 how can i add a new device in iTunes in iCloud- Manage devices??

    Hi! I have an iphone 5 with the software iOS 6.0.2 nd a Mac with the software OS X 10.8.2. The option of automatic downloads is enabled on both my devices but when i view my apple account it shows that my iphone hasnt been added to the list of device

  • Calendar keeps updating/syncing for hours

    Sometimes when I wake up my Mac in the morning, my Calendar App starts to update/sync with iCloud (looking for changes myde on my other devices or new invitations) – and then remains in that mode for hours. I can´t get it to really sync and show new

  • Hi - I am new here: I need help and advice on the White Macbook - thanks.

    Hi all, I'm a new member to this forum + I am soon to be a new user of the Macbook. I have ordered my new White 2.16 Macbook with an upgraded 2GB RAM & an upgraded 16GB HDD. I have some questions which I would like answered please: 1) How likely is i

  • Red Giant Denoiser II not working with certain clips

    HI all, I have a 25 minute wedding video that I have been unsuccessfully trying to export and sign off on nfor the last week and the problem seems to lie with Denoiser II.  There were some clips that were corrupted by me using Denoiser on them so I h

  • Slow Display due to LCD?

    Hi fellow Developers out there... I have just written a VERY simple game, that displays a ball running over a background. The code was inspired by several other postings that I read. It all works fine (so it is displayed and the ball is moving) but i