Parameter to script files

i wish to pass a parameter to .sql file. Please help me urgently...................
i have a query that calculates on the basis of invoice number. I have a script file that has the query which displays the output in formatted pattern.
Now i wish to pass invoice number as the parameter to .sql file but i donot know how to do this. please help

See sections 2 and 9 of http://otn.oracle.com/support/tech/sql_plus/htdocs/sub_var.html
-- CJ

Similar Messages

  • How to spool file to where start script file located

    I'm writing a sqlplus script, eg. runMe.sql, which is going to run in customer env, will generate some data files eg. result.csv.
    By specify location such as 'spool /certain/path/on/disk/result.csv', I can spool to any path I want. However, my concern is  below:
    1. We gets many customers and the script might be run under different location.
    2. I don't know where customer would save the script, furthermore, I don't want customer to input location manually every time.
    3. Generally, customer would run the script something like "sqlplus username/password@sid @/certain/path/on/disk/runMe.sql". They don't want to pass any parameter at run time.
    4. I wanna spool file to "/certain/path/on/disk" automatically, as a result, result.csv file would appear under same path with runMe.sql.
    5. I tried "spool ./result.csv" but it navigate to where sqlplus session is running.
    6. Also tried &0 etc, but make no sense.
    Can anyone tell me how to obtain start running script file path in sqlplus script(runMe.sql) ? Just like access command parameters under Linux.
    $0 is the name of the command
    $1 first parameter
    $2 second parameter
    $3 third parameter etc. etc
    $# total number of parameters
    $@ all the parameters will be listed
    Thanks in advance.

    Are you looking for SQLPATH ?
    A good and clear example by Paul @ https://forums.oracle.com/message/3727891
    In this way your customer has to set one environment variable SQLPATH=/location/of/script/file/where/they/put/your/runMe.sql and just say :
    spool %sqlpath%\result.csv
    in your runMe.sql.  So, runMe.sql and result.csv will be on SQLPATH location.
    Regards
    Girish Sharma

  • Password not to be a command line parameter within scripts

    Hi,
    We have a few batch programs wherein the database passwords are stored as a command line parameter in an environment variable script.
    But the customer wants to avoid this.
    What are the options of storing password externally but which should be accessible to the batch programs.
    Please advise.
    Regards,
    Narayan

    user7202581 wrote:
    Hi,
    We have a few batch programs wherein the database passwords are stored as a command line parameter in an environment variable script.
    But the customer wants to avoid this.
    What are the options of storing password externally but which should be accessible to the batch programs.
    Please advise.
    Regards,
    Narayan
    Might solution depend upon OS name & version?
    Might solution depend upon Oracle version (to 4 decimal places)?
    Might solution depend upon where script file resides on DB Server or remote client system?
    Yes, options exist, but I refuse to speculate based upon total & complete lack necessary details.
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002

  • Running script file from VB

    Hi,
    Is there any shell command or exe to run oracle script file from VB?
    thanx

    You should be able to call WinExec() (Windows API) there are bound to be MS KB articles that cover this. Create a small CMD file that you pass a parameter to with the SQL Script name and then exec that.

  • Script file for test automation.

    I have a file “HPE3631A configure output.vi” (DC power supply). This file I downloaded from NI web for using control our DC power supply. I would like to use a script file that can automatically process and configure the output voltage, current parameter? I do not have to click mouse for change the voltage and current parameter. We would like use this script file as one of our test automation.
    What format file can use as a script? Is any example file I can use as a reference (it does not have to be HPE3631A).

    I don't have an example. You are free to create a script file in any format that you want. To give you a little help, say you have a comma separated file. The first field could be instrument address. The second field could be a function. This might be Initialize, Configure Voltage,Configure Trigger, etc. The following fields could be parameters that you pass. Some functions would require more parameters than others. Look at the number of functions in the driver and see if you want to duplicate them and how many parameters they require or whether you want to break some of them down into something smaller. When you've decided that, then you can determine how to read the file and parse out the commands. Do you want to do error checking here or someplace else? What I mean is, what if the file contains the word "Initilize" instead of "Initialize". What if a voltage parameter is out of bounds?
    Like I mentioned, you could have a LabVIEW VI generate the script. Imagine a front panel text ring in which you have listed all of the various functions. If function b is selected, have logic that displays the correct number (and type) of other parameters required. When the selection is complete, click an OK button to display the new step in a table. A table is nothing more than a 2D string array so saving it to a file is then simple.

  • How to "commit" only certain lines of code in the script file?

    Hi there,
    Is there a way to execute only certain lines of code in the script file without executing all the code in it. Wihtout using the comment syntax.
    e.g: there are lines to create views and in the next set of line there are lines to create procedures. I only want to execute the lines that create views.

    another workaround is to create a procedure that accepts parameters. such that the parameter will be the basis for what objects in your conditions that it should met to perform the operations that conform with your business rules. an example is given below.
      create or replace procedure create_object(pObjectType varchar2) as
      begin
        if pObjectType = 'VIEW' then
        elsif pObjectType = 'PROCEDURE' then
        else
        end if;
      end;

  • Error unable to open script file

    I have been using DW8 since it came out. I am running Windows 7. Everything was working fine until I had hard drive failure. Replaced hard drive reinstalled Windows and DW8. Now when I try to insert an image I get the message "unable to open java script file c:\program files\Macromedia\Dreamweaver 8\configuration\objects\common\AccessibleImage.js (error 2)".
    I have done the usual--rename config file--reinstall DW8--clean register and reinstall--run as admin.--run in compatibility with XP SP2, etc. but nothing works.
    Help would be invaluable to me.

    Your version isn't listed here but something on this page may help you...
    http://helpx.adobe.com/dreamweaver/kb/troubleshoot-javascript-errors-dreamweaver-cs4.html

  • How to Print Post Script Files

    Hi All,
    I am trying to make a utility software in foxpro that could print post script file on:-
    1) Post script printer
    2) Non Post Script printer
    Operating System Windows 95 & above
    Help is requested from all the community members
    Reagards
    Harsh

    PostScript printer - send it to the printer port e.g. LPT1: with a simple copy.
    Non-PostScript printer - you'll need to buy a PostScript RIP, or perhaps use Acrobat Distiller to convert the PostScript to PDF, then print the PDF with Acrobat's API - see the Acrobat SDK. (This is not possible with the free Reader).

  • How can I assign a action to a button of the many scripts in the script file.

    How can I assign one action of many actions in a script file.
    I have many actions in a script file and I want to run one of them by clicking a button on the panel. However, loading the script I can not isolate the action that interests me.

    Hello,
    Try System Preferences>Energy Saver>Options tab, uncheck Allow power button to sleep computer.
    Some possible other options...
    Control-Eject
    The dialog box "Are you sure you want to shut down your computer now?" appears with options to Restart, Sleep, Cancel or Shut Down. After the dialog appears, press the R key to Restart, press the S key to Sleep, press the Esc key to Cancel, or press the Return key to Shut Down.
    Control-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and restarts the computer.
    Control-Option-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and shuts the computer down.
    Command-Option-Eject
    Puts the computer to sleep.
    Shift-Control-Eject
    Puts all displays to sleep.
    Power button (if the computer is not responding)
    Press and hold the power button on the computer for six seconds to shut down the computer.
    http://support.apple.com/kb/ht2448

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

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

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

  • Intermittent : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.

    I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.
    The first step in the wrapper is to create a Transcript file using following code
    if ($Host.name -ne "Windows PowerShell ISE Host") # Transcript does not work within ISE
    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    $path = "c:\corp\$timestamp" + "_$pid.txt"
    Start-Transcript -path $path -append
    As expected the folder contains files with timestamp & pid in name
    08/08/2013  11:00 AM            14,388 2013-08-08-11-00-01.158_1620.txt
    08/08/2013  11:00 AM            12,506 2013-08-08-11-00-01.485_936.txt
    08/08/2013  11:00 AM            12,994 2013-08-08-11-00-01.735_9328.txt
    08/08/2013  11:00 AM            12,024 2013-08-08-11-00-01.766_8624.txt
    08/08/2013  11:00 AM            13,902 2013-08-08-11-00-01.860_1756.txt
    08/08/2013  11:01 AM            15,142 2013-08-08-11-01-31.392_10120.txt
    08/08/2013  05:00 AM            14,982 _1692.txt
    However note the last file, it has a zero length date time value in the name
    The error recorded by PowerShell is
    get-date : The term 'get-date' is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Corp\Powershell\DMPRun-ScheduledTask.ps1:171 char:18
    +    $timestamp = (get-date -format "yyyy-MM-dd-HH-mm-ss.fff")
    +                  ~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (get-date:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
    IE get-date has failed and returned a zero length field as the timestamp
    Can anyone think of a good reason why get-date would fail intermittently?
    Do I have to code defensively for base Powershell functions?

    I implemented David's suggestion and now I intermittently get
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_08_55_02.ps1:15 char:1
    + import-module Microsoft.Powershell.Utility
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand
    I added a trap chain (My Powershell skills do not yet include recursive trap coding, any suggestions welcome)
    trap {
        trap {
            "Trap1"
            "Exception: " + $_
            "Error: " + $Error[0]
            "Message: " + $_.Exception.Message
            "InnerException: " + $_.Exception.InnerException
            "StackTrace: " + $_.Exception.StackTrace
            "FailedItem: " + $_.Exception.ItemName
            import-module Microsoft.Powershell.Management
            import-module Microsoft.Powershell.Security
            import-module Microsoft.Powershell.Utility
        "Trap2"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        import-module Microsoft.Powershell.Management
        import-module Microsoft.Powershell.Security
        import-module Microsoft.Powershell.Utility
    import-module Microsoft.Powershell.Management
    import-module Microsoft.Powershell.Security
    import-module Microsoft.Powershell.Utility
    trap {
        "Trap3"
        "Exception: " + $_
        "Error: " + $Error[0]
        "Message: " + $_.Exception.Message
        "InnerException: " + $_.Exception.InnerException
        "StackTrace: " + $_.Exception.StackTrace
        "FailedItem: " + $_.Exception.ItemName
        exit 1
    get-date
    Now I intermittently get ..
    Trap2
    Exception: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Error: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    Message: Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    InnerException:
    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
       at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
       at System.Management.Automation.AnalysisCache.CacheExportedCommands(PSModuleInfo module, Boolean force, ExecutionContext context)
       at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadUsingModulePath(PSModuleInfo parentModule, Boolean found, IEnumerable`1 modulePath, String name, SessionState ss, ImportModuleOptions options, ManifestProcessingFlags manifestProcessingFlags,
    PSModuleInfo& module)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, String name)
       at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
    FailedItem:
    import-module : Access to the path 'PowerShell_CommandAnalysis_Lock' is denied.
    At D:\temp\loop_jc2_2013_11_25_09_19_52.ps1:26 char:1
    + import-module Microsoft.Powershell.Security
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], UnauthorizedA
       ccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow
       erShell.Commands.ImportModuleCommand

  • How can I run a SQL script file...

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

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

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

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

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

  • How to create parameter and control file like filename + date

    Hello there
    I am trying to create parameter and control file with following command
    in SQLPLUS
    create pfile='/u03/oradata/WEBDB/backup/initWEBDB.ora' from spfile;
    In RMAN
    copy current controlfile to '/u03/oradata/WEBDB/backup/cf_longterm.cpy';
    how can I put date at the end of filename like
    initWEBDB8jan06.ora and cf_longterm8jan06.cpy
    Thanks in advance
    Lionel

    ASM is reliable but a smart DBA is very careful. If ASM is doing mirroring this is like RAID doing mirroring. What happens if you accidentally delete one copy ... the other one disappears instantly. Not a good idea.
    With respect to redo logs you need a minimum of three groups, two members, and one thread per instance. So a 2 node cluster should, at a minimum have 12 physical files.
    Not mirroring the redo logs, assuming multiple members, is not as critical.

  • Trying to install iTunes 8.0, can not find script file error

    I recently tried to upgrade Win XP for iTunes 8.0, and got the following error msg:
    can not find script file “C:\program files\uninstall scripts\quicksilver player 7.4\install.wsf”
    HELP!
    Tony

    Hey Tony, you don't happen to work for a large aerospace company, do you? My guess is that you do, because I work at the same place, and the problem is with our company's distribution of quicktime. email me off list and I'll tell you how to fix it.
    bralston at mac dot com

Maybe you are looking for

  • How do I print mirror image

    I am trying to create an iron transfer for my son.  I can't figure out how to turn it into a mirror image.  It's in word right now.  I bought the transfer paper and it included the software but the software doesn't work with the Mac.  Any suggestions

  • Nokia Should resolve the c3 video crash problem

    Hi friends. I just bought Nokia C3 on 8th November. Everything was okey until itried to play video. I just transfered some video files to my c3's 2gb memory card through Nokia PC Suite. After playing for 5 second the phone hanged and restarted. I tho

  • Recovery of notes from iMac

    I had a few notes on my iPad mini which I have backed up to my iMac.  I have an older Mac running snow leopard as it works for me.  I backed up my iPad mini to the computer and not the iCloud and since then my screen broke on May iPad mini.  Conseque

  • Problem in editing tjspGenerateEditForm.jsp

    Hi all, I have a problem: What I want to do is when an admin user who is a member of an admin users group and tries to edit a users informations, all the fileds can be seen. But for any user except member of this administrators group, the fields shou

  • Asking for sims card on my iPhone?

    asking for sims card on my iPhone?