User defined spoolfile name at run time.

Hi all,
What I want to run in SQLPlus is
PROMPT Enter a spoolfile name
SPOOL &SpFile
SELECT * FROM Scott.emp
SPOOL OFF
When I run this as a script - i.e. @foo.sql, it works fine - i.e. it prompts the
user for a name for the SpFile. However, when I copy and paste the text into
SQLPlus and try and run it, it fails - it runs through the PROMPT/SPOOL bit
of the script with the message
apps@WHITE> SPOOL &SpFile;
Enter value for spfile:
not spooling currently
apps@WHITE>
and produces no output. If I put SPOOL '&SpFile'; it produces a file
called ''.lst - yes two single quotes.lst.
Can anyone explain what is going on and how I can get the
behaviours to match in the interactive and batch modes?
TIA.
Paul...

SQL> spool off
SQL> spool &a
Enter value for a: c:\abc.txt
SQL> select count(*) from user_objects where
rownum<=1;Thanks for your interest, but you have slightly misunderstood me.
It will work fine if I have the spool &xyz in my_script.sql and then do
SQL> @my_script
but it does not* work if I copy and paste the contents of my_script.sql
at the SQL> prompt - i.e. all in one go.
This puzzles me, because it works fine if I copy and paste a multiline sql
statement which has an & in the SELECT part of the statement. I think it's
related to an issue I noticed recently whereby if you copy and paste an
SQL script into the buffer which contains non-SQL (i.e. column blah format a30),
for example, SQLPlus throws an error when you try to run what's in the
edit buffer by typing / and return.
This is why I started copying and pasting at the prompt in the first place,
but this is the first time I've tried to input a "non-SQL" variable name in
this fashion.
This is where I'm having the issue. Hope this is clearer now.
Paul...

Similar Messages

  • Reading from a file. How to ask the user for file name at run time????

    I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class FileRead {
        public static void main(String args[]) {
            Scanner scan = null;
            File file = new File("Results.txt");
            String number;
            try {
                scan = new Scanner(file);
                while (scan.hasNext()){
                number = scan.next();
                System.out.println(number);}
            catch (FileNotFoundException ex1){
                System.out.println("No such file");
            catch (IllegalStateException ex2){
                System.out.println("Did you close the read by mistake");
            catch (InputMismatchException ex){
                System.out.println("File structure incorrect");
            finally{
                scan.close();}
    }Any hints would be greatly appreciated. Thank you in advance

    I have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
    When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
    This code compiles but at run time it comes up with this error
    run-single:
    java.lang.NoClassDefFoundError: NamedFile
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)
    import java.util.Scanner;
    import java.io.*;
    class NamedFileInput
      public static void main (String[] args) throws IOException
        int num, square;   
        // this Scanner is used to read what the user enters
        Scanner user = new Scanner( System.in );
        String  fileName;
        System.out.print("File Name: ");
        fileName = user.nextLine().trim();
        File file = new File( fileName );     // create a File object
        // this Scanner is used to read from the file
        Scanner scan = new Scanner( file );     
        while( scan.hasNextInt() )   // is there more data to process?
          num = scan.nextInt();
          square = num * num ;     
          System.out.println("The square of " + num + " is " + square);
    }his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!!

  • Is it possible to load a user defined mathscript function at run-time in an executable?

    I am currently allowing a customer to define their own matlab script for post-processing their data file. This is all well and good in the development environment, beecause when I re-load this VI, it searches my MathScript search paths and re-loads the .m file if it has changed. However I am noticing that when doing a build to an exe the MathScript node seems to be compiled from the file as it is at build time.
    Is there anyway to avoid this? Can I programatically call the MathScript function such that it does the search at run-time? Any ideas would be much appreciated.

    Hey,
    How are you including the .m file? Do you think you could post a screen shot of your code?
    Thanks
    Britton C.
    Applications Engineer
    National Instruments

  • Update step limit name at run-time

    I need to run through some test steps in a TestStand sequence multiple times.  This wouldn't be a loop on a single step or group of steps but probably a goto a label "for" loop in TestStand.  BTW, TestStand 2.0.1 calling code from a LabWindows/CVI DLL via the standard prototype adapter.  Each iteration I need to have the test step limit names be updated with a different suffix.  So step1 might have results0 and results1 and on the 2nd run results0 would be renamed to results0b.  How do I update the limit names, at run-time, from a LabWindows/CVI function?  I.e. the first test in the sequence's Main would update the steps below it to update the suffix.  I started down the path of using TS_SeqContextGetProperty to get the sequence handle
    TS_SeqContextGetProperty( testData->seqContextCVI, &errorInfo, TS_SeqContextSequence, CAVT_OBJHANDLE, &seq_hndl );
    then using TS_SequenceGetNumSteps( seq_hndl, &errorInfo, TS_StepGroup_Main, &num_steps ) to determine the number of steps in the Main tab.  
    Enter a for loop:
    TS_PropertyGetValString( testData->seqContextCVI, &errorInfo, buf, TS_PropOption_NoOptions, ( char ** )&rslt_name ) with buf as "Sequence.Main[0].Result.Measurement[0]" errors out with an invalid name message.  The idea is to get this value, update it based on the iteration in TestStand ( this is already acquired and working ), and then set the value back.  Then, move on to the next step and so forth.
    Any suggestions?
    Thanks.
    -G-
    Solved!
    Go to Solution.

    So, I tried the example and it works but only for a single step.  I've tried two options:  1. having a single step that programmatically changes all the result names in all the other steps in the sequence. 2. having each step update the result names itself.  For thought 1 the loop would run and the changes would occur but when the function was exited I'd get an exception from TestStand.  No real information in the details as it looked like a memory corruption error.  I then examined the details of what occurred and tried more experiments.  If I had the loop have more than 1 iteration this behavior occurred.  If I comment out the set function it still occurs.  Then, for thought 2, it works like a champ on all the steps until I loop back to the top of the sequence.  Then, on the first step ( 2nd time through ) it bombs out.
    Attached is the code for the 2nd possible solution.
    Does anyone know what the problem is or if there's a way to do this?
    -G-
    Attachments:
    Change Step Name.txt ‏7 KB

  • How to pass column name at run time in function.

    how to pass column name at run time in function as parameter.
    thank in advance
    pramod patel

    Hello,
    Using dynamic sql you can pass column name to function. well I am not getting what you really want to do ? Please write in more detail. By the way I am providing one example here. see it uses dynamic sql.
    Create or replace function fun_updtest (p_columnname_varchar2 in varchar2,
    p_value_number in number)
    return number is
    v_stmt varchar2(500);
    begin
    v_stmt := 'update emp
    set '||p_columnname_varchar2||' = '||to_char(p_value_number)||'
              where empno = 7369';
    execute immediate v_stmt;
    return 0;
    commit;
    end;
    call to this function can be like this..
    declare
    v_number               number;
    begin
    v_number := fun_updtest('SAL',5000);
    end;
    Adinath Kamode

  • How to get sequence name in run time.

    hi
    I have several sub sequence called in the main sequence in TestStand. Those sub sequences have different sequence names, which i wanted to display by string indicator on the Labview Operator Interface. Is there a simple way to show the current calling sub sequence name during run time(run main).
    thanks.
    Message Edited by Appledoll on 07-12-2007 10:12 AM

    Hi,
    The easiest way is to use the NameOf() function. In this case where you wish to get the name of the current sequence the syntax NameOf(RunState.Sequence) yields the name. I attach a very simple example also.
    Getting the Name of Any TestStand Property Programmatically in TestStand
    Hope this helps
    Pelle S
    District Sales Manager
    National Instruments Sweden
    Attachments:
    Get sequence name.vi ‏15 KB

  • How to change Crystal Reports XI database name at run time from ASP code using ADO

    Dear All,
    I need advises regarding to my problem below
    I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page.
    The problem is how can I change a database from TEST01 to LIVE01 at the run time from ASP code as I already using TEST01 database on Crystal Reports and I do not want to set a new database location inside crystal for each reports
    Thanks and wait for your reply soon.
    Below is my code, which has no effect to crystal reports although I've change the database from TEST01 to LIVE01:
    <%
    Dim oADOConnection, oRptTable, oADORecordset, sql
    Dim struser, strpwd, strdriver, dblocation, dbname, strConnect
    struser = "sa"
    strpwd = ""     
    strdriver = "{SQL SERVER}" 
    dblocation = "SQL200501"     
    dbname = "LIVE01"    ' Changed from TEST01 to LIVE01
    strConnect = "User Id=" & strUser & ";"
    strConnect = strConnect & "PWD=" & strPwd & ";"
    strConnect = strConnect & "DRIVER=" & StrDriver & ";"
    strConnect = strConnect & "SERVER=" & DBLocation & ";"
    strConnect = strConnect & "DATABASE=" & dbName
    sql="Select * from Employee"
    Set session("oApp") = Server.CreateObject("CrystalRuntime.Application.11")
    Set session("oRpt") = session("oApp").OpenReport("C:\REPORTS\RPT01.RPT", 1) 'USING TEST01 DATABASE
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
    Set oADOConnection = Server.CreateObject("ADODB.Connection")
    oADOConnection.Open (strConnect)
    Set oADORecordset = Server.CreateObject("ADODB.Recordset")
    Set oRptTable = session("oRpt").Database.Tables.Item(1)
    oRptTable.SetDataSource oADORecordset, 3
    session("oRpt").SQLQueryString = CStr(sql)
    session("oRpt").ReadRecords
    %>

    Did you ever find a solution to this problem?  I have the same problem when moving reports from development to Test to Production environments.  If the DBName is not the same the report ignores the name provided at runtime.

  • How register user defined listener name with OEM

    DEFAULT LISTENER
    [oracle@localhost ~]$ lsnrctl status
    LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 06-SEP-2010 10:03:46
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    Linux Error: 111: Connection refused
    USER DEFINED LISTENER
    [oracle@localhost ~]$ lsnrctl status LISTENER_LIMCAMP
    LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 06-SEP-2010 10:04:03
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.106.72)(PORT=1521)))
    STATUS of the LISTENER
    Alias LISTENER_LIMCAMP
    Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
    Start Date 03-SEP-2010 19:42:11
    Uptime 2 days 14 hr. 21 min. 52 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /ora10gsoft/oracle/product/10.2.0/db_1/network/admin/listener.ora
    Listener Log File /ora10gsoft/oracle/product/10.2.0/db_1/network/log/listener_limcamp.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.106.72)(PORT=1521)))
    Services Summary...
    Service "LIMCAMP" has 1 instance(s).
    Instance "LIMCAMP", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    I am able to connected thru listener.
    But my OEM database control showing
    Host localhost.localdomain
    Port 1521
    SID LIMCAMP
    Oracle Home /ora10gsoft/oracle/product/10.2.0/db_1
    Status Down
    Host localhost.localdomain
    Port 1521
    Name LISTENER
    Oracle Home /ora10gsoft/oracle/product/10.2.0/db_1
    Location /ora10gsoft/oracle/product/10.2.0/db_1/network/admin
    Details TNS-12541: TNS:no listener
    My OEM taking the default LISTENER( which is not running). how to register OEM to take the listener (LISTENER_LIMCAMP).

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain
    192.168.106.72 localhost.localdomain
    would you please have a look into the below link which is the issue on the same server.
    Heartbeat failed to connect to standby : archive files not transfering....
    Edited by: SAKTHIVEL on Sep 6, 2010 11:45 AM

  • Optimal way to enable user to pick style at run time - Flex

    What I'm trying to do: allow a user to be able to select a color palette for a custom component by selecting from a drop down menu with a variety of icons.
    I have the drop down menu part down, but I'm trying to understand how to best handle the various styles in my code. Ideally I would have liked to be able to load styles at run time, but I don't see a major advantage with this so I'm now thinking about compiling in all styles. Still, I can't seem to find a decent way to structure the code. Hacking it seems pretty easy / fast, but there's got a better way than having a big fat array of values which can be indexed via some index associated with each icon - yuck!
    Would love to hear your thoughts or see any pointers to obvious ways to handle this.
    thank you!

    Wouldn't style sheets make this a lot easier where the user essentially just picks one?

  • Appending in file and supplying file name at run time using File Adapter

    Hi,
    Can we use File Adapter to write in a file in append mode. i.e. a BPEL process opening a file appending some text and closing the file each time it called.
    Another query is can we create the file at run time with the supplied file name?

    In order to append to a file, we can use Append="true" in the interaction spec for the File/Ftp adapter.
    <jca:operation
    FileType="ascii"
    PhysicalDirectory="/home/adapter/output"
    FileNamingConvention="OutputFile.txt"
    NumberMessages="1"
    Append="true"
    >
    Filename we can specify in wsdl...

  • Printer Name in Run Time

    Hello,
    Is there any standard API to get the name of the Printer from the program run time? Please let me know if anyone knows.
    Thanks,
    Genoo

    Please see if (FND_PRINTER_PKG) helps.
    FND_PRINTER_PKG -- 11i
    http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=FND_PRINTER_PKG&c_owner=APPS&c_type=PACKAGE
    PACKAGE: APPS.FND_PRINTER_PKG - R12
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_PRINTER_PKG&c_owner=APPS&c_type=PACKAGE
    Thanks,
    Hussein

  • BAPI -  user last modified Name, Date and Time in SU01 of a Particular User

    HI Experts,
    After searched a lot in SDN , i am posting this thread,
    I want to know any  Standard BAPI  to give LAST modified User name , time and Date in SU01 of a particular User.
    I checked * BAPI_USER_GET_DETAIL* , its giving LAST modified  time and Date in SU01, But I want Last modified user name as well.
    I have 2 questions related with the above scenario,
    1) Which BAPI gives the details of LAST modified User name , time and Date in SU01 of a particular User.
    2) Any Table is there to give details of LAST modified User name , time and Date in SU01 of a particular User for a time period ,
    For eg : 1 month, if i would have set the time line, it should give the three details .
    Regards,
    Saravana.S

    Hi,
    I am not sure, if there would be any BAPI particularly for giving such particular information. Even if you can, you  might have to call 2 BAPIs, one for finding the list of such users modified within 1 month eg., and then getting the mod date and mod time.
    BAPI_USER_GETLIST - this can be used for searching.. but tricky
    then you have to call another bapi for getting the details.
    One option is you can create a new Z BAPI using the table and get the results.
    Regards,
    Amit Mittal.

  • 2005 PL07 User define table name size changed?

    Hi everyone,
    I just upgrade Add-on from SBO 2004 to SBO 2005 PL07, there is a problem, when a DBDatasource bind to an User difine table, if the UDT name length <=7, the code runs good under, but under 2005 PL07, when UDT name Length >7, an error "Data source - Invalid table name" shows when code runs to the statement "oDBDataSource.Query(oConditions)".
    who knows what's the reason of this problem, is this by the UDT name longer than SBO 2005 PL07 SDK constraint or other reasons.
    Thanks in advance!
    Kathy

    Hi Kathy,
    I haven't experienced this error, but it looks like Barend has. I am not sure if he has solved his problem, but it seems to be the same. His table name is also longer than 7 characters. Look at this post posted a couple of days ago:
    SBO 2005 DBDatasource
    Hope it helps,
    Adele

  • Archive link : user defined document name in attachment list

    Hi
    I have created a content repository (OAC0), document type and had linked the doc n content rep with an SAP business object.
    I am able to attach documents to business object using archive link feature.
    If I attach more than one documents to an SAP business object, for same document type, all the documents are displayed with same name in the attachment list.
    Is there any way by which I can show the original document name as selected by user?
    Thanks in advance.
    Regards
    Ruhi Hira

    hi i have this problem myself all I know is that the original names are used for the following document types
    HRIBENEFIT PREL FAX 0053 -
    HRIBESCHKI PREL FAX 0021 2
    HRICERTIFI PREL FAX 0024 -
    HRICOLFOTO PREL FAX 0002 -
    HRICONTRAC PREL FAX 0016 -
    HRICONTRAD PREL FAX 0016 -
    HRIDATASEC PREL FAX 0002 -
    HRIDATES PREL FAX 0019 10
    HRIDIPLOMA PREL FAX 0022 +
    HRIEMPFOTO PREL FAX 0002 -
    HRIEVALUAT PREL FAX 0025 -
    HRIHEALTHI PREL FAX 0013 -
    HRIMASTERD PREL FAX 0002 -
    HRIPERAPPR PREL FAX 0019 10
    HRIREFEREN PREL FAX 0023 -
    HRIRESUME PREL FAX * -
    HRISOCIALS PREL FAX 0013 -
    HRISTUDID PREL FAX 0013 -
    HRITAXCARD PREL FAX 0012 -
    HRIVL PREL FAX 0010 +
    HRIWORKPER PREL FAX 0016 -
    read this thread:
    Link:[A couple of things regarding GOS and ArchiveLink for attaching Business Doc;
    i hope this wiil help you a least a little bit

  • Where to keep user defined config files at the time of deployment

    I am using oc4j server to deploy my application. As application requires some xml config files(say, my-config.xml) , do i need to mention at the time of deployment? if so, how to access those files from server side code?
    Can any one help me out??

    Similar posts around the same error.
    http://social.msdn.microsoft.com/Forums/windows/en-US/2cdb0394-b757-4b4c-96e6-927100d8eebd/cannot-start-your-applicationthe-workgroup-information-file-is-missing-or-opened-exclusively-by
    http://weblogs.asp.net/jeevanmurkoth/archive/2010/04/27/exception-cannot-start-your-application-the-workgroup-information-file-is-missing-or-opened-exclusively-by-another-user.aspx
    Bala

Maybe you are looking for

  • Creating Animated Gifs in Illustrator?

    In PS if you have a layered file, you can create an animated gif via SAVE FOR WEB AND DEVICES. But it seems you can only create static gifs via SAVE FOR WEB AND DEVICES in Illustrator from layered files. Please! Say that ain't so - that I'm missing s

  • EAL configuration error.

    I'm trying to add the Analytics Link Application Server to the Analytics Link Servers node but I'm receiving an error message. I'm providing the right data for server name, username and password. The error message is: Can't connect (Unknown Exception

  • Multiple "Instances" of Xcelsius dashboard

    Hi, I am using Crystal Vision Server XI, Crystal Reports XI R2, and Crystal Xcelsius 4.5.  I would like to know if there is a way to create one .xlf file that will point to a .rpt report for different divisions based upon their login in Infoview? I d

  • TreeView with checkboxes

    Hi, I was wondering if anyone had a simple solution on using a TreeView control with checkboxes. The only required functionality would be: Clicking on the CheckBox beside an item that has children will result in all children also becoming selected/un

  • File associations (always open with...) are constantly reverted

    Hi, This sounds like a minor problem but is a major hassle on every workstation. We want to change file associations for all types like opening all .eps with illustrator instead of Preview.app and many others. Our Workstations run Lion 10.7.1 and hav