Create a batch file "very urgent"

i want to create a batch file that run every hour to update the user_status table fields according to the following formula
if login = 1 and login_time status = 0 then login =3

Write this statement into a text file and name it as
say test.sql
UPDATE user_status
   SET login = 3
WHERE login = 1
   AND login_time = 0;Then write a script in UNIX as following
$vi test_script.ksh
!# /bin/ksh
sqlplus `@test.sql`save it
write a crom job for every hour.
Codes not tested...
Hope this helps
Ghulam

Similar Messages

  • Running a batch file - VERY URGENT .. help

    Hi people
    I am attempting to run a batch file from with a JSP page.
    the code i am using is:
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec("cmd.exe /c d:\\uploadfiles.bat");
    This jsp file is located on the c: of a webserver.
    the uploadfiles.bat is located on the d: of the webserver and the code is:
    copy d:\videos\008214?.rm d:\blah
    copy d:\images\008214.* d:\blah
    copy d:\xml\008214.* d:\blah
    cd \blah
    pkzip -es -m 008214.zip *.*
    copy 008214.zip d:\upload\008214.zip
    del 008214.zip
    If I run this batch file from a command line, it works fine, though when I try and call it through my JSP page, it doesnt do anything .. a command window just pops up for a while, and then closes.
    How can I fix this ... I need this quite quickly
    Thanks people

    1) It is O.K. that you see nothing in that console. Its output is captured by Java and is not displayed on the screen.
    In general, that console should not be visible, but actually it behaves differently according to JDK and OS versions (treat that as a feature).
    2). Look at this article:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    It it does not answer your problem, try to search the forums:
    http://search.java.sun.com/search/java/index.jsp?qp=%2Bforum%3A31&nh=10&qt=%2B%22exec%22+-%22Replies%3A+0%22&col=javaforums
    Questions about Runtime.exec() has been asked hundreds of times.
    3) runtime.exec() can execute BAT files. It is not necessary to specify that "cmd /C".

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • I want to create a "batch file" that will copy files from one folder into another, overwriting what is currently in there.

    I've got a game that has a folder with Saved Games (Okay, it's Minecraft). I don't always have my external drives because I take my Mac Mini from my house to my friend's house and of course back after we finish playing.
    There are times where I want a back up so that if something happens we can restore it as easily as possible.
    What I've been doing is copying the particular saved game and pasting it to my desktop, replacing the new backup over the old backup. I'd like to be able to create a "batch file" so that I can just double-click on it and it will copy and paste overwriting the old version.
    Since this is being automated I've been thinking. It would be nice to have 10 backups which I would like to have numbered from 1 to 10 (and not 0 to 9).
    I'd like the batch file to delete backup 10 then rename backup 9 to 10 and 8 to 9 and so forth until backup 1 becomes backup 2 and then my live copy then gets copied to my desktop. I guess that one really doesn't need a number after it. It can have the exact same name.
    Don't worry about automating the restore. I just want the backup part of it automated. I'm not a UNIX guy but I've tried to figure it out and it is just not working. So ... if someone out there can reply with a solution for me that would be great.
    Extra credit for automatically compressing the backups with the built in compression utility so my backups use less space.
    Thanks in advance.

    I have another psd (adjustment_layer.psd) file that only has one layer, and it is an adjustment layer. . 
    That is possible. An adjustment layer must be over a layer. The layer that it is over can have its visibility off but there needs to at least two layers in your (adjustment_layer.psd) file.  For you can not have and adjustment layer without a layer to adjust.
    Are all your PSD file the same in size  x px by y px at z DPI?
    It would be easy to create an action just to add the adjustment layer you want if your (adjustment_layer.psd) file adjustment layer, layer mask is a reveal all or hide all mask. You can Batch the action or use the Image processor script and have it include your action that add the adjustment layer  you do not need to write a script.
    I would also record that action to add the adjustment layer clipped to the layer below. There is a bug in CS4 and CS5 Action Player. Actions that have recorded adding adjustment layers to be applied to all layers below may play incorrectly.  You will have to pay to get a fix  for this bug for Adobe is not going to apply a fix the the current releases of Photoshop. The bug is so far slated to be fixed in CS6 time will tell.

  • How to create a batch file for a java program?

    I have a java project in JCreator and the project is organised into packages. I have also configured JCreator to provide 2 arguments to the main method when the project is executed.
    I would want to create a batch file (.bat) for this project where the batch file can automatically use the arguments set in JCreator when the program runs.
    How do I go about creating the batch file?

    where the batch file can automatically use the arguments set in JCreatorThat all depends JCreator... can you get those arguments somehow?

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • Creating a batch file to launch a program with user input variable.

    I am trying to create a batch file that allows a user to be prompted to put in a value and then launches the program associated and that particular file. In this case the files are CIF files that pull up saved data inputs. Below is my script so far and what I am trying to accomplish is the user presses 1 and hits enter and is prompted to enter the CIF file name, then the application launches and the paramaters open the selected CIF file.ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2, for your task or 3 to EXIT
    ECHO ...............................................
    ECHO.
    ECHO 1 - Open Cape Pack CIF FIle
    ECHO 2 - Open Calculator
    ECHO 3 - EXIT
    ECHO.
    SET /P M=Type 1, 2, or 3 then press ENTER:
    IF %M%==1 GOTO Cape Pack
    IF %M%==2 GOTO CALC
    IF %M%==3 GOTO EOF
    :Cape Pack
    cd %windir%\Program Files (x86)\cape211\...
    This topic first appeared in the Spiceworks Community

    I am trying to create a batch file that allows a user to be prompted to put in a value and then launches the program associated and that particular file. In this case the files are CIF files that pull up saved data inputs. Below is my script so far and what I am trying to accomplish is the user presses 1 and hits enter and is prompted to enter the CIF file name, then the application launches and the paramaters open the selected CIF file.ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2, for your task or 3 to EXIT
    ECHO ...............................................
    ECHO.
    ECHO 1 - Open Cape Pack CIF FIle
    ECHO 2 - Open Calculator
    ECHO 3 - EXIT
    ECHO.
    SET /P M=Type 1, 2, or 3 then press ENTER:
    IF %M%==1 GOTO Cape Pack
    IF %M%==2 GOTO CALC
    IF %M%==3 GOTO EOF
    :Cape Pack
    cd %windir%\Program Files (x86)\cape211\...
    This topic first appeared in the Spiceworks Community

  • How we can create the batch file to download the data in from URL in ssis

    hi,
    any one help on one the below requirement.
    i have to create one batch file to download the report(reports is in csv format) from URL...
    requirement should be like this...
    1. we have some reports is there in the URL..
    2.when ever we execute the url, the report should be download and save it to the local folder.
    3. this requirement i have to write in the batch file
    should any one let me know how we can create the batch file for the above requirement.

    Hi Priya.N,
    If you use SQL Server Reporting Services for reporting, you can use Visakh’s suggestion to create a script file which calls Reporting Services Web Service to render a report in CSV format and save a batch file to the destination folder, and then create a
    batch file to run the rs.exe utility which can executes the .rss script file. For more information, please see:
    Report Server Web Service
    ReportExecutionService.Render Method
    rs Utility (rs.exe) (SSRS)
    If you use other reporting tools, it depends on the reporting functionality and this requirement may be not achieved.
    Regards,
    Mike Yin
    TechNet Community Support

  • Create a batch file that will loop a copy command that will call it as a task from another application

    I've created a script to copy large files from one system to another system. Unfortunately the transaction language of that system isn't feature rich, so I can't code a loop to copy multiple files to move concurrently. My goal is to create a batch file that
    will do the loop of copying multiple files, after being called by the application that is copying the large files one at a time. Can I get some pointer on how to do this? Basically, the code is like this:
    Copy from  \\Server_1\directory\sent_file.xyz
    To   \\Server_2\Directory\received_file.abc
    So the purpose is to perform the successful copy, then if the copy is good, execute the loop until completed.

    Might look around here.
    http://gallery.technet.microsoft.com/scriptcenter/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=storage&f%5B0%5D.Text=Storage
    Or ask over here.
    MSDN Scripting forum
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Create text files-very urgent

    how can i create a text file using 'comma' as delimiter.moreover table is having
    around million records,i want to create a sy for eg.about 10 thousansd.is it a
    time consuming process.Pls help me

    Using SQL*Plus to format the output is easiest way
    set colsep ,
    set lines 1000
    set pages 1000 -- or you can use pages 0 to suppress the column headings
    spool output.txt
    select * from emp where rownum < 10
    spool off
    EMPNO,ENAME ,JOB , MGR,HIREDATE , SAL, COMM, DEPTNO
    7369,SMITH ,CLERK , 7902,17-DEC-80, 800, , 20
    7499,ALLEN ,SALESMAN , 7698,20-FEB-81, 1600, 300, 30
    7521,WARD ,SALESMAN , 7698,22-FEB-81, 1250, 500, 30
    7566,JONES ,MANAGER , 7839,02-APR-81, 2975, , 20
    7654,MARTIN ,SALESMAN , 7698,28-SEP-81, 1250, 1400, 30
    7698,BLAKE ,MANAGER , 7839,01-MAY-81, 2850, , 30
    7782,CLARK ,MANAGER , 7839,09-JUN-81, 2450, , 10
    7788,SCOTT ,ANALYST , 7566,19-APR-87, 3000, , 20
    7839,KING ,PRESIDENT, ,17-NOV-81, 5000, , 10
    You can play around with your SQL and column data format to how you want
    Cheers
    Dave

  • Is it possible to create a batch file in Mac OS?

    In MS-DOS, a batch file is a text file containing a series of commands intended to be executed by the command interpreter. It's very convenient and handy. Is it possible to do the same in Mac OS? I tried the automator of Mac OS and copied the workflow, but it is quite clumzy and painfully slow, and stops working afte a relaunch.

    Having come from a Apple ][ & DOS background, it took me a while to learn Automator. It's more graphical so some concepts took a "AHA!" moment. You don't mention what "stops working" but likely it's "just" a step that is missing from your workflow. For example, in one of my workflows, the "AHA!" was realizing I needed to specify a name by "Get Specified Finder Item" before I could work with it.
    Perhaps you'd be more comfortable with Applescript, especially if you've done any C or other programming language beyond batch files.
    If you're up for it, or if your needs are that complex, you could create shell scripts. In fact, my latest Automator work flow calls a shell script because it's actually the KeePass Windows executable run in Mono. I know I probably could have done the whole thing as a shell script, but Automator was easier and would have been simple if it wasn't for this one shell script.

  • Communication b/w SAP and VB .exe file - Very urgent.

    hi,
      I am currently in a project implementing SAP for a cement manufacturing company. Here we have a VB .exe file which takes parameters and return values. now we need to connect this to application to SAP R/3 to pass data to that application and access the data from that .exe file.
    Note: we don't have any source code for that vb .exe file its a third party software.
    Its an very urgent one....
    please guide me how to do it with all steps.
    Any material please pass to [email protected]
    Thanks in advance.

    form grosswt .
      refresh itab3.
      clear itab3.
       Executing VB EXE file to get the weight from weigh bridge
      call function 'WS_EXECUTE'
       exporting
          DOCUMENT                 = ' '
          CD                       = ' '
          COMMANDLINE              = ' '
         inform                   = 'X'
           cd      = 'C:\SAPWEI'
         program                  = 'C:\sapwei\MyVB.exe'
          STAT                     = ' '
          WINID                    = ' '
          OSMAC_SCRIPT             = ' '
          OSMAC_CREATOR            = ' '
          WIN16_EXT                = ' '
          EXEC_RC                  = ' '
        IMPORTING
          RBUFF                    =
        EXCEPTIONS
          FRONTEND_ERROR           = 1
          NO_BATCH                 = 2
          PROG_NOT_FOUND           = 3
          ILLEGAL_OPTION           = 4
          GUI_REFUSE_EXECUTE       = 5
          OTHERS                   = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       Fetching Value from VB text file
      call function 'WS_UPLOAD'
       exporting
        CODEPAGE                      = ' '
         filename                      = 'C:\sapwei\w1.txt'
        FILETYPE                      = 'ASC'
        HEADLEN                       = ' '
        LINE_EXIT                     = ' '
        TRUNCLEN                      = ' '
        USER_FORM                     = ' '
        USER_PROG                     = ' '
        DAT_D_FORMAT                  = ' '
      IMPORTING
        FILELENGTH                    =
        tables
          data_tab                      = itab3
      EXCEPTIONS
        CONVERSION_ERROR              = 1
        FILE_OPEN_ERROR               = 2
        FILE_READ_ERROR               = 3
        INVALID_TYPE                  = 4
        NO_BATCH                      = 5
        UNKNOWN_ERROR                 = 6
        INVALID_TABLE_WIDTH           = 7
        GUI_REFUSE_FILETRANSFER       = 8
        CUSTOMER_ERROR                = 9
        NO_AUTHORITY                  = 10
        OTHERS                        = 11
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      loop at itab3.
        v1 = itab3-num.
        pgrwt = v1.
      endloop.
      message 'Save Gross Weight' type 'S'.
    endform.                    " grosswt

  • How to create a batch file

    Hi,
    I have a project named Haridwar which i made using net beans and resides in the location(C:\Documents and Settings\nijesh\My Documents\NetBeansProjects\HARIDWAR) it has a build folder in which the classes folder contains the haridwar.class file and a src folde that has a haridwar folder in which my java file resides (these are created automatically by netbeans) what i want to do is
    1. create a jar file for this project
    2. create a batch process that runs my jar file every day.
    can some one please help me in how i should be doing the two processes.
    Thanks in advance

    Google for "java executable jar" and follow the directions.
    .bat files can be created with any text editor.
    Scheduling can be done with Windows OS capabilities.
    %

  • How to Create a batch file to display and count specific words in log file

    Hi All,
    I have requirement Program to be written that will go through a log file and look for following key words.
    Unexpected Essbase error
    And also it will count the # of times the word error appear in a log file.
    You may use batch file or Perl script to complete this task.
    e.g. in the log file - It will flag yes that keyword "Unexpected Essbase error" found and word error occurs 9 times.
    Pls help me in know process to achieve above requirement.
    and pls let me know what is perl scripting ?
    Thanks in Advance
    Regards,
    SM

    Sorry but it sounds like you have been asked to do something and you have pasted the requirement on the forum, have you done any research to find out which scripting language you are going to use or any find examples, there are so many differents examples and help on the internet it just takes a little bit of time and investment.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to create a batch file to stop/start only essbase services 11.1.2.2

    Hi,
    I have a requirement to build a batch file to schedule stop or start essbase. This batch files should run daily once. Version 11.1.2.2.
    I have tried to prepare a batch file which is calling the default service restart batch StartEssbase.bat and stopEssbase.bat.
    Stop process is running fine. But, Start is not success. When I run StartEssbase.bat and stopEssbase.bat manually essbase is restarting successfully.
    I tried with the command like START ESSCMD.exe "Password" also. Still it is not working.
    Could any one please help with the batch scrpit how can I build to start or stop essbase.
    Thanks
    Srilatha Dasari

    Hi,
    You can use these...
    Start essbase-------------------------------
    REM ----------EssbaseAgent Start----------
    net start HyS9ESBAgent11.1.1_hypservice_1
    SET CHK46=%ERRORLEVEL%
    IF "%CHK46%" NEQ "0" (
         ECHO "ERROR IN STARTING THE ESSBASE SERVICE"
         EXIT /B 46
    ) ELSE (
         ECHO "STARTING ESSBASE SERVICE WAS SUCCESSFUL"
         EXIT /B 0
    PAUSE
    Stop essbase----------------------------------------
    REM ----------Stopping of ESSBASE Service----------
    SET ESB_BIN_DIR=E:\Hyperion\products\Essbase\EssbaseServer\bin
    SET SRCDIR=F:\Essbase\bin
    SET MSHSRC=%SRCDIR%\ShutdownServer.msh
    SET SERVERNAME=XXXXXXXX
    SET USERNAME=XXXXXX
    SET PASSWORD=XXXXX
    REM *****************CALLING ESSBASE ENVIRONMENT SCRIPT***********************
    CALL %ESB_BIN_DIR%\setEssbaseEnv.cmd
    CALL %ESB_BIN_DIR%\ESSMSH %MSHSRC% %USERNAME% %PASSWORD% %SERVERNAME%
    SET CHK10=%ERRORLEVEL%
    IF "%CHK10%" NEQ "0" (
         ECHO ------------------------------------------------------
         ECHO [%DATE% %TIME%] ERROR IN STOPPING THE ESSBASE SERVICE
         ECHO ------------------------------------------------------
         EXIT /B 10
    ) ELSE (
         ECHO ------------------------------------------------------
         ECHO [%DATE% %TIME%] STOPPING ESSBASE SERVICE WAS SUCCESSFUL
         ECHO ------------------------------------------------------
         EXIT /B 0
    The maxl is like
    login $1 $2 on $3;
    alter system shutdown;
    exit;
    Regards
    Snehasis

Maybe you are looking for

  • How do I use iPhoto to get photos into 3G phone?

    Hi, I was wondering how best to import images into my iPhone 3G for viewing. Most of my image files are large high quality 2 -4 MB files. Is there an easy way to downsize the files for viewing on the iPhone 3G? Does iPhoto have a setting specific for

  • Comma inside quotes in FCC

    Hi Gurus, In a File Content Convertion scenario, I am having an issue as next: the sender CC will pick the file and put all data between comas in different fields. Example: file: data1, data2, data3 File mapped: <field1>data1<field1> <field2>data2<fi

  • (OM) Organizational unit

    I'd like to know if it's possible to get more than one view within OM? Such as hierarchical, fonctional, geographical, legal, and analytical? And if so, how to get that, do I have to overwrite O object with extr attributs in order to link objects bet

  • Forwarding Mail using Rules Question

    Why is it that if I set up a rule to forward messages sent to a certain address, the message doesnt apppear in my sent folder. It makes it hard to check that the ruile is working and to keep trap of what has happened. IS there a way to switch that on

  • Update 65 millions of rows

    Hi! What's the best way to update 65 millions of rows? I don't have free space to create a new table. Thanks André