Run SQL through batch file, with parameters

Hi all

I run SQL through Batch files before, but I am a little confused with the execution of the sql with parameters. For example, if I have a named sql file:
insert.sql

Insert into TableA
 select * from TableB
 where service_dt >= '&&x_start_dt' and service_dt <= '&&x_end_dt';
I can run this problem normally, but including the substitution variables, as in the batch (.bat) file called Execute_insert.cmd is a bit annoying... I played a little with it and cannot operate.

Any help would be appreciated.

Thank you
Ed

Change your insert.sql to something more like:

Insert into TableA
 select * from TableB
 where service_dt >= TO_DATE('&1', 'format mask') and
       service_dt <= TO_DATE('&2', 'format mask');

Then, would you call it:

sqlplus user/password @insert.sql 01-oct-2012 31-oct-2012

John

Tags: Database

Similar Questions

  • Calling batch file. SQL file with parameters

    Hi all:

    I may / may not have correct code, because I can't find a Google result for answering the question and cannot test this solution until it goes live, so I want to make sure I have it correct.

    I have a batch (file1.bat) file that implements some variables. Inside this file, I call a .sql like this procedure:
    sqlplus username/password@environment @c:\sql\export.sql cID %%d sID % % exportFilename %

    How do I use these settings within the export.sql so they are passed to the oracle procedure?

    I am currently using the following code:
    BEGIN
    sinterface. Export (1, 2 & 3);
    EXCEPTION
    WHILE OTHERS
    THEN NULL;
    END;

    This code will work? I know that if I call another code file1.bat .bat file, I can get the settings such as:
    SET of cID = %1
    SET sID = %2
    SET exportFileName = %3

    OR

    SET CompID = compID %
    SET SiteID = siteID %
    SET exportFileName = % exportFilename %

    But I have no idea if / how this translates an oracle .sql file to call a stored procedure. I got a result of Google to show using the & 1 & 2 & 3 to set the parameters of this batch file, but as I can't test it, I have no idea if it would work.

    Anyone would be able to confirm the correct method?

    Thank you
    Andy

    Andy,
    Welcome to the Oracle Forums. Please take a few minutes to review the following:


    This forum is for general issues Oracle Forms. Please post your question in the forum SQL and PL/SQL . If you have a general question of forms, by all means, ask it here! ;-)

    That said, you asked...

    How do I use these settings within the export.sql so they are passed to the oracle procedure?

    I am currently using the following code:

    BEGIN
    sinterface.export(&1, &2, &3);
    EXCEPTION
    WHEN OTHERS
    THEN NULL;
    END;
    

    Since you simply call a Script SQL of your batch file file is not really necessary to use an anonymous block to call your stored procedure. In addition, as you use the OTHER generic exception - you never know if there was a mistake. Really, you shouldn't use SO that OTHERS value NULL. This isn't a very good programming practice. As for your variables, I would recommend that you set the substitution variables in your script and set your settings to access these variables. For example:

    DEFINE c_id = &1 (CHAR)
    DEFINE s_id = &2 (CHAR)
    DEFINE f_name = &3 (CHAR)
    
    Execute sinterface.export(c_id, s_id, f_name);
    

    I would not include an exception handler at this level that any exception must propagate to the calling program.

    Craig...

  • How to call sql loader control file with in the pl/sql procedure

    Hi friends,

    I am doing a project in relation to the transfer data using queues. In the queue, I'll get a data delimited by tabs in the form of CLOB variable/message. I don't want to keep this dat in the oracle table.
    During the updating of the data in the table.

    1. don't want to write data to a file. (You want to access directly after the specific queue).

    2. as the data is in the form of delimited by tabs, I want to use sql loader concept.

    How can I call the ctrl charger sql file with in my pl/sql procedure. When I searched, most forums recommending the external procedure or a Java program.

    Please guide me on this issue. My preferrence is pl sql, but don't know the external procedure. If no other way, I'll try Java.

    I'm using oracle 9.2.0.8.0.

    Thanks in advance,
    Vimal...

    Or SQL * Loader, or external tables are designed to read data from a CLOB stored in the database. They both work on files stored on the file system. If you don't want the data to be written to a file, you have to roll your own parsing code. It is certainly possible. But it will be much less effective than SQL * Loader or external tables. And it is likely to lead to a little more code.

    The simplest possible thing that might work would be to use something like Tom Kyte string tokenization package to read a line in the CLOB, divide the component parts and save the different chips in a significant collection (i.e. an object type or a record type that matches the table definition). Of course, you need manage things like the conversion of strings to numbers or dates, rejecting the lines, writing to log files, etc.

    Justin

  • display accessor query runs for a long time with parameters null - JDEV 11.1.2.3

    I use Jdev 11.1.2.3.


    I have inputVO with the query as

    Select "store", as a double.

    The VO store attribute, I have inputlistofvalues that comes from storesLOVVO, which the query is like

    Select store_name, store_id from all_stores.

    Now I drag store to inputVO on the page of the user interface as inputListofValue. The user selects the value and runs the page and everything goes as you wish and in no time at all.

    Now the user manually removes the selected value from the store of the user interface and clicks a button to deal with something. But instead of calling the method that is present on the actionlistener for this method, the query of storesLOVVO runs on the server (I can see in the newspapers) for a very long time with store_name as null as a condition.

    If I run this query in SQL developer, it gives results in 0.02 sec, even with store_name as null clause added.

    Why jdev performs this LOV VO when there is no parameters?

    And if she runs the VO, why are so slow... its almost take 2 minutes and then the rest of the processing occurs.

    Yet,.

    Take a look at this to see if it helps: Andrejus Baranovskis Blog: anti-patterns ADF: dangerous tutorials - a real experience in the ADF

  • File through batch file transfer - Dates of the files

    Folder on the server a dated 12/10/2012

    Using Robocopy in batch command move the file to the server B

    Server B shows create release date 02/01/1980 and then later corrects up to 10/12/80

    Hello

    The question you posted would be better suited to the TechNet community. Please visit the link below to find a community that will provide the support you want.
    http://social.technet.Microsoft.com/forums/en/category/WindowsServer

    Hope this information is useful.

  • Batch files are running very slow

    Original title: batch files do not work!
    Recently, whenever I try to run a .bat (batch file) it will slow down my computer until she reached the point where I can ONLY move the cursor. If I'm lucky I can sometimes get it to open but it doesn't do anything and once again I have to force reboot to get my computer to respond. If I open CMD directly and type in that what it is supposed to do manually will work. I need to be able to run batch files for some programs I run. I can not even "start iexplore.exe" as a batchfile to run. If anyone can help that would be greatly appreciated. Now I need to run batch files on my old laptop that can barely run and they take FOREVER. Thanks for the help!

    Hello

    The issue you reported is Batch files and will be well suited in the TechNet community. Click on the link below.

    http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/threads

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Should I have the administrator account to run the batch file?

    When I log in as administrator, I run after the file of commands without any problem, but

    When I login as a user, I can't run after the batch file, the changeover of the authority.

    I would like to know if I need to log in as an administrator to run this batch file or not,

    Can I use different accounts group? and always perform this task.

    Does anyone have any suggestions?
    Thanks in advance for your suggestions :>

    off @echo
    echo copy C: d:

    RoboCopy C:\ /MIR R:1 /W:1 D:\
    ECHO done

    Hello
     
    To respond to your request, you must enter the administrator password to access this command file.
    Instructions for Windows 7
    In order to run as administrator, create a shortcut to the batch file.
    1. right click on the batch file, then click on copy
    2. navigate to the location where you the shortcut
    3. right click on the background of the directory
    4. select Paste shortcut
     
    Then, you can set the shortcut to run as Administrator:
    1. right click on the shortcut
    2. Select Properties
    3. in the shortcut tab, click Advanced
    4. check the box "Run as Administrator"
    5. click on OK, OK
    Now when you double-click the shortcut it will ask for confirmation UAC and then run as an administrator (which as I said above is different than running under an account in the administrator group)
     
    I hope this helps.

  • How to use batch files to deliver the payload of the ODC to AAU?

    Hi all.
    We are trying to do along this week and, so far, we could not understand how to use the batch files containing the option on the ODC and validate the output files to the University Complutense of MADRID.
    So, these are our specifications:

    VM 1
    ODC - 10 gR 3
    OS - Windows XP 32-bit SP3
    DB - Oracle DB 11.2

    VM 2
    No ODC
    UCM 11.1.1.6
    OS - Enterprise Linux Enterprise Linux Server version 5.5 (Carthage)

    We have opened a ticket with the Oracle Support for how we should do it. The number is 3-6108348211 SR.
    Let me try to explain what we want to do:
    1. we have a batch file with all the metadata for many files of UCM
    2. we want to use this ODC file, so the application converts the images and they are committed to the Complutense University of MADRID
    3. we should see all these files and their metadata, thumbnails and content associated with the Complutense University of MADRID
    4. it is an example of batch file we want to send to ODC:

    --------------------------------------------------
    LocalData @Properties
    IdcService = CHECKIN_UNIVERSAL
    dRevLabel = 1
    primaryFile=/tra/Relatorio_UHPF-03-04-2008-M-RL-EA.pdf
    dDocName = TRA_33
    dDocTitle=UHPF-03-04-2008-M-RL-EA
    dSecurityGroup = MAM_TRA
    dDocType = Document
    dDocAuthor = luis .neotropical
    dInDate = 14/05/08
    xC_CLASSIFICACAO = EA - Educação Ambiental
    xC_DATA = 01/04/08
    xC_DATAVALIDADE = 30/04/08
    xC_LOCALIZACAOFISICA = N/A
    xC_USUARIO_DEP = LUIS FERNANDO DA CAMARA
    xC_TIPO = RL - Relatório
    xC_USINA = UHPF - MACHINING HIDRELETRICA PASSO FUNDO
    xC_FICHA = MAM - environmental reports
    xC_IDDOCMAN = TRADocID = 157
    xC_IDANEXODOCMAN = TRAFileID = 33
    xC_DESTINOINICIAL = Tractebel
    xC_ORIGEM = Neotropical
    xC_FORMATODOCUMENTO = digital
    xC_GENERODOCUMENTO =
    xC_DOCPRINCIPAL = Sim
    @end
    < < NEM > >
    -----------------------------------------------------

    5 so, when we use this command on the ODC file, the file (or image) is converted, all metadata attached and then sent to the Complutense University of MADRID.

    But we do not know how to make the link between the ODC and UCM. The Oracle Support says that it is necessary to make some adjustments. In the books I couldn't find info on how to do, just generic information or the use of the ODC.
    Is there a way (without personalization) to do? Can someone give us a step by step guide?

    Thanks for any help and advice.

    Fernando

    It doesn't really have much point which is good to UCM to ODC, given that the ODC is really an indexing tool to get content in Complutense University of MADRID and capture. Once the content is in the Complutense University of MADRID, it should be at its final location.

    Batch files are the property of the University Complutense of MADRID and have no meaning to the ODC. Import of the ODC server has the ability to read the meta in a list, which is similar, but not a
    "Batch UCM file.

    You can have IBR convert files directly in the University Complutense of MADRID, trying to use ODC to convert is redundant.

    ODC was out of the configuration of the box with the AAU.

    For this question: "but we do not know how to make the link between the ODC and UCM.»

    The documentation covers all this very well. what page of the documentation is misleading or causing problem you?

    The guide step by step would be the documentation of the ODC.

    -ryan

  • How to run a procedure with parameters in pl/sql collections?

    I created a procedure with parameter from the collection. Can somone help me how to run a procedure in passing the parameters in the collection.
    Package and how to create is successful. But I get the error message when executing the procedure.

    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    I gave the example of code here. Can someone please help me solve this problem.

    -Spec package

    create or replace package pkg_dist is

    TABLE index IS THE NUMBER of t_tab_num TYPE of PLS_INTEGER;


    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num);
    end pkg_dist;

    -Package body

    create or replace package body is pkg_dist

    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num) is


    Start


    IF (a (16) = 0) then
    (16) c: = 0;
    c (17): = 0;
    c (18): = 0;
    end if;
    c (15): = (14)-(15)-a (16);
    (16) c: = b (16) /b (17);
    c (17): = 50;
    (18) c: = a (16) * 2;

    end prc_test;
    end pkg_dist;

    -executeing procedure

    declare
    TABLE index IS THE NUMBER of t_tab TYPE of PLS_INTEGER;
    x t_tab: = t_tab (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
    y t_tab: = t_tab (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
    z t_tab;
    BEGIN
    pkg_dist.prc_test (x, y, z);
    dbms_output.put_line (z (18));
    END;

    Error:
    --------------------------------------------------------------------------------
    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    My suggestion would be:

    CREATE OR REPLACE PACKAGE pkg_dist IS
    
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist);
    END pkg_dist;
    
    CREATE OR REPLACE PACKAGE BODY pkg_dist IS
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist) IS
       BEGIN
          IF (a (16) = 0) THEN
             c (16) := 0;
             c (17) := 0;
             c (18) := 0;
          END IF;
    
          c (15) := a (14) + a (15) + a (16);
          c (16) := b (16) / b (17);
          c (17) := 50;
          c (18) := a (16) * 2;
       END prc_test;
    END pkg_dist;
    /
    
    DECLARE
       x   SYS.odcinumberlist;
       y   SYS.odcinumberlist;
       z   SYS.odcinumberlist;
    BEGIN
       x := sys.odcinumberlist (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
       y := sys.odcinumberlist (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
       z := sys.odcinumberlist (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
       pkg_dist.prc_test (x, y, z);
       DBMS_OUTPUT.put_line (z (18));
    END;
    /
    

    See you soon,.
    Manik.

  • I need help doing things with batch files

    This applies to All THE VERSIONS OF WINDOWS and probably relates more to MSDOS than any other.

    cmd.exe or notepad.exe and comand.com applications

    I'm doing some kind of Setup.

    I have a tool nice lottle I did that works with a batch file. and he has 3-4 text file sthat go with it. I wanted to make a batch file which would act as an installer. make the MainMenu.txt, ReadMe.txt, Credits.txt, DISCLAIMER.txt fill them with the correct values, then make the .bat file that acts as the user interface. and when this launch the batch file under its weight made it has created (and not as a child of cmd window) then delete itself so all that remained was the new files...

    I tried the command IF [NOT] EXIST filename command because it's the only IF the syntax I have any slight understanding of

    EXAMPLE OF

    mkdir EXAMPLE

    EXAMPLE of CD

    IF [NOT] EXIST MainMenu.txt GOTO CMAIN

    : CMAIN

    ECHO the text I want to be in the lead > MainMenu.txt

    pause

    EXAMPLE OF

    but when I run the command 'Betainstall.bat' file, it opens and then closes immediately. What would be nice if it was the CASE of WAT I TOLD it to. it doesent need to be opened, because it only creates a directory then makes em fills with files on and its done... but it doesent do anything. and since it closes too quickly it's a bit hard to read all the messages that appears. (im not fast enough for print scrn) and addition of the pause at the end did not a thing. and / k has ever helped me before

    so someone who knows nothing about MS-DOS or command prompt this is a great opportunity to showcase the prowess of youre

    I just need to find how to get cmd to delete the last entry of Y.

    If I could get the Y equal to NULL it should write the %M % and not okay right?

    For the first part of what I mentioned above, you can simply do:

    SET M =

    The M variable will then to null.

    However, for what is in quotes: No. get M set to null will do what you want.  Use the command I mentioned in my previous post.  Note the signs double% to get the result of %M % in the command of the user file.

    IF the echo % M %! == 1 ! Goto: whatever > USER - X 2. 0.Bat

    Then the USER - X 2. 0.Bat will contain the line:

    IF M %! == 1 ! Goto: whatever

    Now, from your original:

    SET /p M = type OK or CANCEL, and then press ENTER:
    IF %M % IS INSTALL OK GOTO
    IF %M % IS CANCEL LEAVE
    : INSTALL

    You can see that if the M variable contains not exactly the capitals OK or CANCEL capitalized (that you specified), then the second half of each IF statement will not be executed. Your sample of what is getting written to the file USER - X 2. 0.Bat, you typed tiny ok and it works again the part of the installation of your batch file because he simply fell thru to the: part of the INSTALLATION.

    What you want is a batch program that allows to anticipate all possible ways that the user could answer "correctly". When you check if the variable M is equal to OK, it checks that specifically. All other cases the letters will not be the exact match.  That's why I ran three different lines looking for okay, okay, then OK.

    The fall same thru happen here:

    SET /p M = press on, then ENTER:
    IF %M % == y GOTO RUN
    : RUN

    Because the only thing you're looking for is there it will be Goto: EXECUTION of the IF statement , if (and only if) M is exactly there, but if it is equal to anything else it will fall through to the next line which is your: block RUN. As you have, any response is typical for the "SET/p M = press on, then ENTER", it's going to fall through and get to the: RUN block. The only exception is that if the user presses the enter only key, it will then generate the error message that I mentioned and end the batch file. That's why I used the! at the end of the two %M % and on the end of what we test, such as OK! This test if the user pressed the key entry in itself without the batch file, which gives an error.

    So, instead of this:

    IF the ECHO %M % == 1 GOTO RUN > USER - X 2. 0.bat
    IF the ECHO %M % == 2 GOTO README > USER - X 2. 0.bat
    IF the ECHO %M % == 3 CREDITS GOTO > USER - X 2. 0.bat
    IF the ECHO %M % == 4 GOTO WARNING > USER - X 2. 0.bat
    IF the ECHO %M % == 5 GOTO EOF > USER - X 2. 0.bat

    Use this:

    IF THE ECHO % M %! == 1 ! GOTO RUN > USER - X 2. 0.bat
    IF THE ECHO % M %! == 2 ! GOTO README > USER - X 2. 0.bat
    IF THE ECHO % M %! == 3 ! GOTO CREDITS > USER - X 2. 0.bat
    IF THE ECHO % M %! == 4 ! Disclaimer GOTO > USER - X 2. 0.bat
    IF THE ECHO % M %! == 5 ! GOTO EOF > USER - X 2. 0.bat

    Or use which does the same thing, but look more pretty:

    IF the echo % M %! == 1 ! Goto: run > user - X 2. 0.Bat
    IF the echo % M %! == 2 ! Goto: ReadMe > user - X 2. 0.Bat
    IF the echo % M %! == 3 ! Goto: credits > user - X 2. 0.Bat
    IF the echo % M %! == 4 ! Goto: warning > user - X 2. 0.Bat
    IF the echo % M %! == 5 ! Goto: EOF > user - X 2. 0.Bat

    (Upper and lower case for the block names all answer the same, whereas they are not nit-picky as the tests within the statement itself. I put the: before the labels of block in the IF statement so I know it's a label. I left the uppercase EOF because it is an acronym for end of file. And I use IF instead of If since it's a small order and I like it to stand. This bit is just my personal preference.)

    Another thing, you can make is for your first redirection in User - X 2. 0.Bat is to use the single > crush entire previous existence of this file. Then for forwarding the following him, continue the > who is the operator 'Add file '.

    Better yet would be first to check if the file of the user - X 2. Bat is and give the user the possibility to replace, rename, or to have an abortion.

    Clear as mud now? :)

    Edit: I just looked and I see that you are already doing the single > for the first time. Pass over my hikes on this part. Laughing out loud

  • batch file to copy the file with the extension of the date - does not work in Windows 7

    Under XP, I got a batch file to copy files daily and rename them with the date, as:

    Project_Tracker_Copy.mdb

    TO

    Project_Tracker_Copy_2012_01_17.mdb - it would make the current format YYYY_MM_DD day

    next day, through Planner, he would run the batch and I'd end up with

    Project_Tracker_Copy_2012_01_18

    Here is the key part of the DOS command:

    Ren S:\archive_2012\Project_Tracker_Copy.mdb Project_Tracker_Copy_%date:~6,4%_%date:~0,2%_%date:~3,2%.mdb

    A batch file that runs hidden in Task Scheduler. [Task Scheduler starts the vbs & the vbs starts the batch file.

    This example shows how run the batch BackupCoreFiles.bat - the only point the vbs to packaging is so he can run hidden like Task Scheduler it would be otherwise in the default command window & that can be a distraction, if you work on something else at the time.

    Set WshShell = CreateObject ("WScript.Shell")
    Chr (34) WshShell.Run & "C:\Program Files (x 86) \Backup" & Chr (34), 0
    Set WshShell = Nothing

    The well-informed person who first posted this code was Ramesh Srinivasan how to run . BAT files invisible

  • All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    Script launched in until OS user 'A' on the 'A' server which launches sqlplus, then connects to a remote database through a service of tnsnames.ora as another user of the database and the results of this script are spoulées on the server "A".

    The file queued on the old server is written with rw-rw-r: read write user, group read the writing, reading and possession header that is the user of the OS. The file queued on the new server is written to rw-r-r user: reading writing, reading group, public reading and ownership oracle: dba.

    "" The user then has no privileges to modify the file and continue the process of transmitting the file, editing and deleting the file for the next set of commands. This allows us to keep the possibility to migrate to the new server we are unable to process orders.

    $ORACLE_HOME/bin/sqlplus - s user/password@prd1 @./script/CustomScript/R12_OM_UFPC-oracle.sql

    Background: old server running 4.8, Oracle 10.2.0.4 OEL

    New server running OEL 6.5, Oracle 11.2.0.4

    Tested so far:

    File and update umask to 0002 instead of 0022 is now generated as rw-r-r. However, the property is still oracle: dba.

    Update of ownershipt of $ORACLE_HOME/bin/oracle.exe of oracle: oracle (edi added the user to the oracle group) and chmod 6751 oracle.exe. This created several problems where crucial scripts, that is to say of sqlplus failed to run.

    Added! chmod 755 output.file.name - OS user 'A' is not allowed to change to mod.

    Added! command cp MV output file and that generated the file as a user of the operating system: oracle. It is a potential work around in case of emergency, but the developer would have to rewrite the countless scripts.

    Any ideas?

    I have reproduced the behavior of the old server and am able to spool a file via sqlplus under OS user. No changes have been made on the remote database server. All the changes have been on the new server hosting a small 11.2.0.4 database on a server running OEL 6.5 32 - bit OS.

    (1) removed the sticky bit $ORACLE_HOME/bin/sqlplus using chmod u-s, g-s, o - s suggestion of Billy ~ Verreynne

    (2) modified the main group for the 'oracle' user match the user operating system applications, while maintaining membership in the groups 'oracle' and 'dba '.

    -We are dealing with here EDI processes, so the Group was called edi.

    (3) modified property of the files tnsnames.ora and listener.ora for oracle: edi

    (4) restart the receiver

    (5) disconnect / reconnect

    Script runs as expected, the output file contains the correct ownership and permissions.

    Thank you all for taking a look and offering options.

    -Josh

  • call a batch file in the sql scripts

    Hi friends,
    I'm looking for a way to call any batch file in sql scripts. I avoid using the DBMS_SCHEDULER package because my application server and database server are deparaments.
    I use the sql script using the server.plz application.


    Ah, I see. Of course, this explains everything.

    Now to be serious: there is no way to run a batch SQL script. The Tools that present SQL statements to the database are often able to do; host in SQL * Plus may issue commands to the OS, the host of builtin forms is it too and with dbms_scheduler , you can run a shell script on the database server.

    So depending on the tools you use, there are several ways to run the OS commands. So far you didn't tell us what you want to do with what tools in the version you want to do. So to only answer is: it is not possible. You cannot run a simple SQL command script.

    see you soon

  • Run a batch file script

    Hi all

    I want to run a SQL script that is executed from a batch file.
    Lets say, I have the file loader.bat. This .bat file connects to Oracle and wants
    to run the .sql file

    The content of the file loader.bat is
    sqlplus 
    @C:\temp_val_id.sql
    At runtime, it calls in the name of user and password. I enter the user name and password and then log on to Oracle
    But the temp_val_id.sql file isn't exectuted.

    The output is as below, but .sql file does not run
    C:\>sqlplus
    
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 17:19:50 2012
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Enter user-name: utest_tt_senayat/password@silver3
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL>
    I'm now trying another method
    sqlplus 
    @@C:\temp_val_id.sql
    The result is the same as above. Do not run temp_val_id.sql

    Could someone please help me,

    Thanks in advance
    Saaz

    Saaz Ena wrote:
    sqlplus/nolog @test.sql

    test.sql content:

    connect &user/&pass
    select sysdate from dual;
    exit;
    /
    
    C:\work\test>sqlplus /nolog @test
    
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Mar 28 16:21:12 2012
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    Enter value for user: system
    Enter value for pass: manager
    Connected.
    
    SYSDATE
    ---------
    28-MAR-12
    
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
  • Error running batch file ODI scenario

    Hello, everyone!

    I load data into Essbase 11.1.2 views of MS SQL Server using ODI 11.1.1.5.0 and Local agent. I've created an interface that goes well if run manually ODI.
    Next, I created the script called MyScenario for this interface and odiparams.bat update file *...\agent\bin* file as follows:

    Set SECU_DRIVER = weblogic.jdbc.sqlserver.SQLServerDriver
    Set SECU_URL = jdbc:weblogic:sqlserver: / / < servername >: 1433; databaseName = < DatabaseName >
    Set SECU_USER = < user name for master repository >
    Set SECU_PASS = < coded for MasterRepository UserName password >
    Set ODI_USER = SUPERVISOR
    Set ODI_PASS = < coded for the SUPERVISOR password >
    Set WORK_REPOSITORY = < name of the repository to work >


    Then I created the batch file in which I wrote: *...\agent\bin > startscen MyScenario 001 GLOBAL 5 *.

    However the script is not executed with the following error message:

    ERROR ODI - 1132 internal Agent encountered a warning: ODI-1414: connection to the internal agent error: a JDBC error occurs when connecting to the master repository. Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: could not make connection JDBC; nested exception is java.sql.SQLException: Exception occurred while getting connection: oracle.ucp.UniversalConnectionPoolException: cannot get data source connection: java.sql.SQLRecoverableException: IO error: the network adapter could not establish the connection

    I'll be very grateful for any advice!

    The variables for the master repository are:

    ODI_MASTER_DRIVER, etc.

Maybe you are looking for

  • Where can I download the latest version of Firefox 3.6?

    My CPU is too old and too slow for the new version 4.0. I have an AMD Athlon XP 1600 + 1.40 Ghz 512 MB of RAM. NVIDIA Gforce2 MX400. I have windows XP and the requirements to get the latest version 3.6. Where can I download from? I can only find the

  • Satellite P200 1EE - this can produce to 1080 p via HDMI?

    Hello My first post on this forum. I recently bought this laptop and plugged into my LCD TV at home. However, I can't seem to get 1080 p via HDMI 1080i (my TV is able to accept 1080 p via HDMI). Anyone know if this is possible? (I've updated the late

  • get rid of the ads on web pages

    my daughter has firefox, & I tried, didn't want - but she's able to disable ads on facebook pages because it has firefox - how to do that with windows?

  • What is the maximum size of the MicroSD card support?

    I am ready to buy a 4 GB Fuze and will also buy a MicroSD card with it, but I don't know what size MicroSD to get. What is the largest MicroSD a 4 GB Fuze can support? Any help is appreciated

  • Upgrade to Windows 10 new disk when the Windows 7 hard drive does not

    I have a desktop HP with Windows 7 Pro and since last week, it will fail to start.   It seems that it is approaching, but everything does not end.    I would just buy a new SSD and upgrade to Windows 10.      I don't have Windows 7 installation flopp