Automating sql files via a command line prompt

Hi All
I've set up an SQL file that extracts information about students in csv format. This information is then imported into another piece of software that creates students e-mail accounts etc..
The program prompts the user to specify from when they want the data from e.g. list of student details that enrolled after 01-SEP-2002.
The Network Manager has now asked me if there is any way the extraction of the student data and import into the e-mail creation software can be automated. He suggested command line prompts as used in DOS e.g. dir/od *.sql > test where dir gives the directory the od orders the files by date.
The Network Manager wanted the extraction and import procedure run on a regular basis by simply just typing a 'command line'. The extraction would take place on an hourly basis especially during the main enrolment periods
Can anybody help me?
Thanks
Jen

I work mainly with UNIX, so cannot give you the actual DOS commands, but I would structure the program as below. I assume that you have some way of identifying the last enrollment you extract.
In psuedo code:
Set up any environment variables required
sqlplus -s user/password@enrollment_server @student_extract.sql
  -- student_extract.sql would spool to a fixed name file say enrollment.txt
  -- after extracting, it would update a single column, single row table with the
  -- the identifying field for the last enrollment extracted (this would also
  -- be used in the extract query as the lower bound)
Reset any environment variables required to connect to the email server
sqlplus -s user/password@email_server @load_email.sql
  -- load_email.sql would read enrollment.txt and do whatever is required
rename enrollment.txt to enrollment.txt.current-date-timeThis could be run out of an automatic scheduler if you have one, or manually from the command line.
HTH
John

Similar Messages

  • Automated Purge functionality using runjob command line prompt?

    We are currently running scheduled jobs through a command line interface using various batch scripts.  We are calling the runjob command.
    My question, is there a Purge command prompt that we could include in these scheduled jobs to automate desired purges?  We don't want to use the runopsjob command because this is taking away from our ability to view data in our created results books.
    Thanks,
    Jordan

    Hey Mike,
    So let me layout the situation we are currently in.  For our end-users, we generate results books showing data quality consistency issues between 2 systems.  Those results books may have upwards to 100 tabs that the users will go into and analyze for what exactly is causing the discrepancy.  Along with those results books, we populate Dashboards that will give a high-level understanding of what pages in the results books need attention as well as track our improvement overtime to present to upper management.
    Our issue is that our storage space isn't sufficient for the large quantity of processes and records being ran and populated in EDQ.  Therefore, we want to set up an automated purge schedule that we can use and incorporate with our command line batch scripts where we run the RUNJOB command.  This almost seems as if it should be consider an enhancement request to either allow RUNJOB to have an automated purge schedule functionality or allow RUNOPSJOB to populate results books and dashboards.
    What are your thoughts around this and what advice would you have moving forward?
    Thanks,
    Jordan

  • How can I setup a PAC File via terminal command line?

    I've tried using:
    networksetup -setautoproxyurl ethernet http://pacurl.com/proxy/test.pac
    I believe the command may be deprecated? What is the best way to get this done?
    Your thoughts on this are appreciated...

    Dear All,
    My problem is solved by the following code:
    exportBiarLocation=D:\ExportMyFile.biar
    action=exportXML
    userName=Administrator
    password=bl123456
    CMS=bldhkbo02:6400
    authentication=secEnterprise
    exportQuery=select * from ci_appobjects
    Save the above proterties file in a specific path.
    Run the above properties file by the following cmd command:
    C:\Program Files\Business Objects\common\4.0\java\lib>java -jar biarengine.jar ....\MyExport.properties
    Regards,
    Tamzidul Amin.

  • Advice on constructi​ng a test engine and formatting a spreadshee​t test file to perform command line interface testing on a product through telnet or serial interface

    Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a range of products through telnet or serial interface and output pass/fail results.

    Hello j. smith,
    TestStand gives you the ability to create "sequence files" which are lists of tests to be run sequentially or in parallel. These tests can be written in any language: LabVIEW VIs, C/C++ DLLs, EXEs, ActiveX objects, .NET Assemblies, etc.
    You can run your TestStand sequence files from a command-line prompt using the following syntax:
    \bin\SeqEdit.exe" /quit -run
    This will launch the TestStand Sequence Editor (and optionally prompt you for TestStand login information if you have this configured), run your sequence file, then exit.
    If you're using the TestStand process model, it can output your results to a report file or database if you configure this. To use a TestStand process mo
    del to execute your sequence file, use the following syntax:
    \bin\SeqEdit.exe" /quit -runEntryPoint
    Here's an example:
    C:\>"C:\Program Files\National Instruments\TestStand 3.0\bin\SeqEdit.exe" /quit -runEntryPoint "Single Pass" "C:\Program Files\National Instruments\TestStand 3.0\Examples\Demo\C\computer.seq"
    Note that multiple sequences and sequence files can be specified on the command line.
    TestStand supports remote sequence execution using DCOM (Distributed COM), which is an east way to remotely execute tests. But as for running tests or commands through a telnet or serial interface, you would have need to check Windows documentation on how to execute command-line remotely like this.
    David Mc.
    NI Applications Engineer

  • Fail to build SSIS/SSAS projects via VS2012 command line (devenv.exe) with SSDT BI tool installed

    Hello,
    I installed recently released SSDT BI tools for VS2012 and I can work on my existing SSIS/SSAS projects all well in VS2012. But when I try to build my SSIS/SSAS projects via the command line of VS2012, such as
    devenv.exe mySolution.sln /rebuild Release /out "C:\temp\buildLog.txt"
    I will get the error like below in the log file.
    Error: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    Is this a known issue? If yes, any fix has been planned?
    Thanks
    Jimmy

    Hi Jimmy Jin,
    This sounds like .NET framework problem, please refer to:
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    Thanks,
    Eileen
    If you have any feedback on our support, please click
    here
    Eileen Zhao
    TechNet Community Support

  • Setting proxy servers via the command line

    I am looking to find out how to set up the system to use http and https proxies via the command line instead of through system preferences. How do I do this. I have basic command line knowledge.

    This information is stored in a plist file and is easiest to manipulate with PlistBuddy. For example, to set the HTTP proxy name, use:
    /usr/libexec/PlistBuddy -c "Set NetworkServices:6CFBA910-E4A0-4418-82E5-66A6480EBC71:Proxies:HTTPProxy http://my.proxy.com" /Library/Preferences/SystemConfiguration/preferences.plist
    Note: 6CFBA910-E4A0-4418-82E5-66A6480EBC71 is a UUID and likely to be unique on each machine. I don't have another Mac handy to check this. If so, you'll need to do some heavy to find out which one is the interface you need to address.
    Try man PlistBuddy and/or a web search for more information on how this tool can be used.
    Try man PlistBuddy or a web searc for more info on using it.

  • Sql to xml on command line

    I'm trying to dump a large (+4MB) set of xml query results to a file from a sql string.
    In the environment I'm using, I can't use any Java.
    I tried writing pl/sql & sqlplus from the command line, but the size of the results overflowed the limits of the sqlplus buffers.
    Any ideas?
    thanks

    You can use the SAX APIs provided by XSU.

  • Command line prompt

    I am reading a book and it requires for me to go to a command line prompt for J2EE and type > java -version.
    I am using windsows XP as my platform.
    What file should I execute so I can open a window so I can get a command line prompt? And what is this window called?

    cmd
    in windows start menu - type
    cmd
    then enter
    called 'Command Prompt' in windows

  • Can I manage resource designates via the command line?

    I would like to manage resource designates via the command line and
    the <i>"unires"</i> command does not seem to have this function. Could I use
    <i>"uniadmrights"</i>?
    # uniadmrights -e -add -resrc -n 10000
    <br>
    -e modify user rights, search filter
    <br>
    -add set user right on (-e only, default)
    <br>
    -resrc resource administration
    <p>
    The <I>uniadmrights</I> command is not able to assign designate rights. You can assign
    rights such as the ability to create and manage public and administration
    groups. The "Resource administration" flag exists so far only on the
    server side, and it is currently not used by the client. This is for future use.
    <p>
    There are two ways to assign a designate to a resource:
    <ol>
    <LI>Log on as the resource via the client. There are only a few commands
    available, one of them being the "Access Rights".
    <P>
    <LI>On the server side:
    <P>
    Edit the /users/unison/misc/resource.ini
    file and create a new section to specify the resource designate.
    <P>
    [DES]
    Designate0 = S=Lastname/G=Firstname
    <P>
    Run the unires command as follows:
    <P>
    % unires -mod "R=resourcename" -s DES 10000
    [sysOpPsw]
    </OL>
    <P>
    <B>Note:</B> The full resource name should be used eg. "R=Resource/N=1/CA=2/ID=2
    57"

    This sounds like a job for wget . You'll have to build and run it on Unix or Cygwin.
    You could also build a test suite to do this in various testing tools. You could even write a short Perl or Groovy script to do this, or a slightly longer Java class.

  • G5 will not boot into OSX - stays at a command-line prompt

    My G5 will not boot into OS X. I would appreciate and and all advice. Thanks.
    What happened:
    I had the G5 running one morning, with the Isight camera on, plugged into the front-console firewire port. I was running EvoCam software.
    At about 2 hours into running, the cam stopped broadcasting – I got home to check it out three hours later, and the screen was black, and the fan was louder than I had ever, ever heard it on this box.
    I did a hard shut-down with the powerbutton on the Cinema Display monitor.
    At reboot, I see a grey screen for approx 5 seconds, with a dark grey apple logo, and then the screen goes to black, with a command-line prompt.
    It’s been like that ever since.
    I ran the Apple Hardware test, from the internal CD drive, and it shows no errors.
    I cannot boot from an OSX installer DVD. It won’t recognize it. It goes straight to the black screen and Command line prompt.
    I have re-seated the RAM, as well as the Airport Card. The only other card – which I have not re-seated, it the video card.
    I am able to use the machine in Target Mode, so I can extract data from the drives, which is great. Oddly enough, I’m able to use the front-console firewire port to connect to my other Mac in Target mode – with no problems. Also – in Target mode, the fan never goes above the usual quiet self.
    I would appreciate any advice one can provide. Thanks!
    The machine:
    Mac G5 dual 2.0 – First Generation (purchased December 2003)
    It’s on it’s 3rd Motherboard – and now it’s fully out of Applecare warrantee.
    OSX 10.4.9
    4GB Ram
    2 internal drives: 160GB + 300GB
    Airport Extreme
    20” Cinema Display (first generation)
    Mac G5 dual 2.0 – First Generation   Mac OS X (10.4.9)  

    Well, Apple Support does have articles on:
    Isolating Issues in Mac OS X
    http://docs.info.apple.com/article.html?artnum=25392
    won't boot or login
    http://docs.info.apple.com/article.html?artnum=106464#symp1
    And if those don't work, call.
    With G4 there is/was
    "Fix for a Mac that won't power up
    Mirrored Doors G4. When you pressed the power button, the button would light up, but the computer would not turn on. The fans on the power supply wouldn't turn on.
    FIX: unplug the machine, pull the clock battery, hit the power button to discharge. Then plug it in without the clock battery. The machine should boot perfectly. Shut down, reinstall the clock battery, and now the system is fully functional. Macosxhints
    http://docs.info.apple.com/article.html?artnum=300552
    Reseat video? try another video card?
    My Step #1 is to always boot into Open Firmware (and do reset-nvram, reset-all, if you can't do that, you are sunk).
    Oh, and What do you see in verbose mode on startup?
    Mac Pro 2GHz 4GB 10K Raptor 23" Cinema   Mac OS X (10.4.9)   WD RE RAID Aaxeon FW800 PCIe MDD-G4 APC RS1500 Vista

  • File adapter OS command line - Calling a command remotely ??

    Hi,
    We have a scenario where in which receiver file adapter after putting a file on the FTP  , a subsequent XML loader needs to be called which would load data into the client legacy ERP system.
    There seems to be some idea about doing it through file adapter OS command line.
    The problem is the how to call this loader command remotely from our file adapter OS command line.
    Any help would be appreciated ???

    >> The problem is the how to call this loader command remotely from our file adapter OS command line.
    The below link might be helpful ...
    http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature

  • Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a product through telnet or serial interface

    Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a range of products through telnet or serial interface and output pass/fail results.

    If I understand correctly, you want to do the following:
    1. Create one or more tab-delimited files that specify a series of query strings (that LabVIEW will send to your products) and expected reply strings (that LabVIEW will look for in response to each query)
    2. Run your LabVIEW program (the test engine) and have it execute one or more test scripts from file using either TCP/IP or serial communication to your units under test
    3. Track how many of the queries are met with the expected response, and output an indication of whether each step passed or failed
    If this is close to correct, then I've attached a sample test file and LabVIEW VI as an example; I chose the TCP/telnet method because it allowed me to use the ni.com Web site to simulate my tes
    t hardware. If you happen to own the LabVIEW Internet Toolkit, there's a VI called "Telnet Play Script" in the Telnet palette that does something fairly similar using TCP. The same general model would also work for Serial communications.
    Hope it helps,
    John Lum
    Attachments:
    test_engine.zip ‏24 KB

  • Compress/zip files from the command line in Windows 7?

    In Windows 7 is there a native way to compress or zip files from the command line?  I'd like to do it without installing any third-party utilities such as 7Zip.

    I fully agree that Compact is not the answer. There are additional concerns with the Compact command. It enables disk compression which is a total no-no. Very bad! It makes your computer very slow and is quite difficult to undo. The only time anyone should
    use this command is when they're removing disk compression because someone turned it on to save space.  Turning this off has to be done by booting into the recovery console, if my memory serves me correctly, and it's a real nuisance.  So
    definitely no to the Compact command.
    If you wanted to compress files before sending them to another drive, or over a network, or by email, then Compact wouldn't actually help at all because the files have to get uncompressed whenever they're accessed, especially before sending them anywhere. 
    When I say accessed, I mean that just looking at a file triggers the OS to decompress it in the background and present you with an uncompressed version of it then letting you change it and recompressing it again for storage every single time you access the
    file, which is why your machine gets slower.  If you have folders or files that have blue text instead of black, then you've probably already made this mistake.
    I would also like to know if there is a built-in command for zipping files/directories, or, if there isn't such a thing built into Windows, then I would like to know if this is feature is accessible through Visual Studio, which would be just as good as having
    a command-line program for those of us that do a bit of programming.
    If anyone knows if MS provides such a feature, either by command-line or through an API, then I'd love to hear about it.  Good luck to those of you that have disk compression turn on.

  • HT1428 How to change the account name in Mac OS X via a command line. I did a type-o on the account name. So instead of it saying "Company" it says "Comany"  for the account logon.

    How to change the account name in Mac OS X via a command line. When I created the account I mistyped the name. I have a management suite where I can execute remote scripts. I would like to run a script that changes the name from oldname to newname.
    None of these Macs have been used currently.
    Thank you,
    Brian

    If user account shortname, see Changing user account shortname

  • Launch remote control via a command line?

    Is is possible to launch a remote control session via a command line as well
    as the other "remote actions"?
    Thanks,
    Bryan

    On Wed, 29 Sep 2004 22:25:17 GMT, Bryan Miller wrote:
    > Is is possible to launch a remote control session via a command line as well
    > as the other "remote actions"?
    take a look at the online documentation which describes this..
    Marcus Breiden
    Please change -- to - to mail me.
    The content of this mail is my private and personal opinion.
    http://www.edu-magic.net

Maybe you are looking for

  • GE70 2OE win 8.1 upgrade

    Hi, I have a ge70 2oe and decided itd be time to go to windows 8.1 (since there were drivers available to download) So I did a clean install of windows 8 (since I cant go to 8.1 instant because of my key ) and on 8 I didn't install drivers because I

  • How to maintain a host file netry to run a BSP application?

    Hi, I am new to BSP. in order to run a BSP application are we supposed to maintain a host file entry and if yes what it should be??? Appropriate points will be rewarded kindly avoid this. irrespective of whether you give points or not the angels here

  • Disable PO document type!!

    Hi, I need to disable a document type in PO. If any one has already worked on this please let me know the possible ways to disable a document type. regards Sukant

  • Subscription Alertert

    A few months before the creative Cloud was announced I signed up for subscriptions for both Photoshop Extended and Dreamweaver. Then I received an email from Adobe that my Photoshop Extended Subscription would be converted to the Creative Cloud and I

  • Cannot load login module in SAP WAS 6.40 SP12

    I have developed a custom login module per the documentation in the SAP Help Portal and deployed it from the SAP NetWeaver Developer Studio to SDM successfully.  I've configured the J2EE Engine to use this module per the documentation.  After restart