How to spool with varible?

I need to spool query with the variable filename.
Concept like below ::
select HOST_NAME||'_'||INSTANCE_NAME||'_'||to_char(sysdate,'YYYYMMDD_HH24MISS')||'.txt' as Filename from V$INSTANCE;
SPOOL c:\&Filename;When i run this script it will prompt for input "Filename"
any suggest please.
Regards,
Suradech

SBH wrote:
Do like this
SQL> column spool new_value filename
SQL>
SQL> select HOST_NAME||'_'||INSTANCE_NAME||'_'||to_char(sysdate,'YYYYMMDD_HH24MISS')||'.txt' as File
name from V$INSTANCE;
FILENAME
IN-L-NLAA010009_abbprod_20100726_150322.txt
SQL> spool &filename
SQL> select sysdate from dual
2  /
SYSDATE
26-JUL-10
SQL> spool off
Oh, I forgot to set new_value.
Thank you so much.

Similar Messages

  • How to spool in excel sheet of table with 1561828 records

    how to spool in excel sheet of table with 1561828 records
    i think excel got only 65l limit?
    COUNT(*)
    1561828
    i am using windows box...any suggestions?

    Raman wrote:
    means excel 2007 can hold 15,61,828 records ? can i give like spool filename.xls?You can name the spool file anything you want, but surely you realize that naming it 'filename.xls' doesn't make it an xls file. A name is just a name. There are industry standards on certain names indicating certain file formats, but the name doesn't make it that format.

  • How to spool the data with out space

    Hi, My version is 10g. I am trying to spool the file. this is my sql file looks like.
    set pagesize 0
    set heading on
    set verify off
    set linesize 32767
    set trimspool on
    set feedback off
    set termout off
    set colsep '~'
    set underline off
    set echo off
    set term off
    sET NEWPAGE 0
    --SET SPACE 0
    SET MARKUP HTML OFF SPOOL OFF
    spool C:\text0728.txt;
    SELECT DISTINCT a.m_name, a_code, a.p_id, a.p_name,
    a.p_type, e._name, e.s_list from mname a,slist e
    where a.p_id=e.p_id;
    spool off;
    my spool file looks like this
    codename~matrix        ~888~nametarget           ~in~todao~~
    codename1~matrix1        ~879~name           ~in~todao~
    If we see matrix value have space *~matrix ~*
    I want the value to spool with out the space i.e *~matrix~*
    What to set for my requirment in sql file?
    Thanks.

    select a.m_name,
             regexp_replace(a_code,'[[:space:]]matrix[[:space:]]','matrix') as a_code,
             a.p_id,
             a.p_name,
             a.p_type,
             e._name, e.s_list *
    from
         mname a,slist e
    where
        a.p_id=e.p_id;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How may spool request can I create in the backend?...

    Hi Experts,
    How may spool request can I create in the backend? If yes, is there anywhere in the system can I set this value to increase number of spool request per user.
    Is there any condition which can prevent me create a new spool request?
    Yes all of the answer above is answered, so is there any offfical document from SAP states them.
    Thanks!
    - Anthony-

    Thx for the feedback. But, in fact, what was the real issue, originally?
    I forgot to inform you of that:
    1) [Note 193638 - Calculating spool number from file names as of 4.0A|http://service.sap.com/sap/support/notes/193638] (indicates the algorithm of UNIX file names). This note also indicates "For Release 4.0A, the maximum spool number has been increased from 99000 to 2000000000. The maximum number of output requests per spool request has been increased to 32767 as well."
    2) I think I forgot one of your initial questions:
    > Is there any condition which can prevent me create a new spool request?
    By default, SAP tries to append pages to existing spools with same characteristics. If they are always different, a new spool request is always created. So, you may change some characteristics so that they are identical and SAP will reuse existing spools. See rules in [Note 85318 appending documents to existing spool requests|http://service.sap.com/sap/support/notes/85318].

  • SPOOL: how to spool a table into many files

    I have a question here.
    currently i am trying to figure out how to spool out a table having like 4 columns and several rows; let say 6 rows - into 6 different files.
    usually what happens is by using spool, i get one file with all 6 rows in it. is there a way so that I can have 6 different files?
    thx!

    It is called a control break - something that was standard in many Cobol program in the 80's, but since seems have been lost in the mist of time.
    Pseudo code:
    loop
    fetch cur into buffer;
    exit when cur%notfound;
    rowCnt := rowCnt + 1;
    if rowCnt > MAX_ROWS_PER_FILE then -- the control break
    CloseFile( filevar );
    fileNum := fileNum + 1;
    rowCnt := 1;
    OpenFile( filevar, 'MY_SPOOL_'||TRIM(TO_CHAR(fileNum))||'.txt' );
    end if;
    WriteRowToFile( filevar, buffer );
    end loop;Of course, the 1st file needs to be opened and the last file closed too - that is not reflected in this basic example of a control break.

  • How to work with 360 video?

    I am new to AE and am trying to work with a 360 equirectangular video I shot with a Freedom 360 and 6 go pros.
    Are there any tutorials on how to work with 360 spherical videos? Do I need to download additional plugins?
    Thank you,
    Phil

    Phil,
    Of course, the image needs to be big for this, but the plugin you would use is CC Sphere.
    Drop your movie into a composition and apply CC Sphere to the video.
    Then set the Render option in the effect to "Inside".
    Under Shading set Ambient to 100% and Diffuse to 0%.
    Then scale inside the effect until the image fills the screen.
    Then you'll be able to use the Rotate Y controls in CC Sphere to spin around inside your video!
    You can also add Optics Compensation and Reverse the Lens Distortion to straighten out your image.
    Let me know if you have any questions!
    Trent

  • I am having much trouble with the new reminders in IOS7 and how it interacts with Outlook Exchange. Many features lost in the new version.

    When I downloaded IOS7, I found that the reminders/task app and how it interacts with Outlook Exchange is much more difficult to use. Some of the issues that I am having are...
    1. Trying to edit my task on my phone is not possible, if the notes are lengthy. When you click on the text to edit data near the top, it will scroll to the bottom and not allow you to edit the text because you cant see it.
    2. Now all of my task are in one long list. I can not move from day to day like we could in previous version IOS6
    3. When I do edit a short task reminder and click done, it crashes and completly goes away. It does save the edit though
    4. You can only add task at the bottom of each days reminders. This is very inconvient and much more difficult than IOS6
    5. There is a major delay or latency when interacting inside of reminders in this version. Much more than IOS6. It is very unstable and quirky.
    I have never seen Apple take a step back with a product until now. I am a huge Apple fan and always will be, so I am hoping they make enhancements to fix these issue. It is a big time prodcutivity killer.
    Thanks for any and all help you can give.
    Troy Meachum

    Some power supplies or designed so that if there is a short or overload they shut them selfs off and some will not turn back on. Some have a relay that will click back on and work, some you have to  cycle the power switch. Those that won't come back on will have to be replaced. I'm not saying that yours is that type as I have no way of telling. But if you have a friend who will loan you a good power supply you might try it. As someone else said just turning off the power will not darn all the power from some motherboards. To test this turn off your power supply than turn on the computer with the start botton. Mine will flash the lights and fans will start to spin than die. So every time you turn off computer to work on it. After turning off PSU hit the start botton to drian any power left in it before working on it. Also do this after unplugging it just to make sure.

  • How to deal with deadlock on wwv_flow_data table when http server times out

    There are some threads about a deadlock on the wwv_flow_data table. None of them contain a real explanation for this behaviour. In my case I will try to explain what I think is happening. Maybe it helps somebody who is hitting the same matter.
    In my case with APEX 3.2.1 I am navigating from one page to another. Doing this APEX will lock the table wwv_flow_data. As soon as the other page is shown the lock will be released. But now this other page contains a bad performing query (standaard report region). After 5 minutes the http server (modplsql) will time out and present the message "No response from the application server" on the screen. In the meanwhile the query is still running on the database server and the lock stays on the wwv_flow_data table.
    Normal user behaviour will be that the user will use the back button to return to the previous page and tries it again to navigate to the other page or
    the user will try to refresh the page with the bad performing query.
    And voila now you will have a deadlock on the wwv_flow_data table since a second session is trying to do the same thing while the first hasn't finished yet.
    How to deal with it?
    First of all. Have a good look at the bad performing query. Maybe you can improve it that it will succeed before the http server will timeout.
    In my case the 11gr1 optimizer couldn't handle a subquery factoring clause in the best way. After changing it back to a classical inline query the problem was solved.
    Secondly you could increase the timeout parameter of the http server. Although this not the best way.
    Maybe it would better if APEX in a next version would release the lock on the table wwv_flow_date earlier or do a rollback just before the moment that the http server is timing out.
    regards,
    Mathieu Meeuwissen

    Hello Shmoove,
    I saw your reply here and you probably understand the problems the HTTP 100 response may cause.
    I am trying to send image that was taken by getSnapshot. The problem is that the server respond with this HTTP 100 message.
    I suspect that the reason that my server doesn't recognize the file that I'm sending from J2me is that the "server to client" response to the 100 message comes after the second message of (see what the TCPIP viewer shows down here):
    POST /up01/up02.aspx HTTP/1.1
    Content-Type: multipart/form-data; boundary=xxxxyyyyzzz
    Connection: Keep-Alive
    Content-length: 6294
    User-Agent: UNTRUSTED/1.0
    Host: szekely.dnsalias.com:80
    Transfer-Encoding: chunked
    400: Client to Server (126 bytes)
    78
    --xxxxyyyyzzz
    Content-Disposition: form-data; name="pic"; filename="david.jpg"
    Content-Type: application/octet-stream
    400: Connected to Server
    400: Server to Client (112 bytes)
    HTTP/1.1 100 Continue
    Server: Microsoft-IIS/5.1
    Date: Wed, 23 Mar 2005 00:47:02 GMT
    X-Powered-By: ASP.NET
    Any help will be appreciated,
    David

  • How to sync with two computers not at the same time, I'm registerd with one computer

    How to sync with two computers (not at the same time), I'm registered with one computer and am trying to connect with second computer with same iPhone. To sync the first time with the second PC "Firefox Sync Option tells me Create New account or Connect, when I connect it gives me a Passcode and on iPhone it also gives me a Passcode, than how do I connect? Both the iPhone and PC gives me a Passcode and have now idea what to do with them.
    Where do I find my Sync Key ? so I can install manually if it works ?

    Use the Sync Key ''(Recovery Key)'' from the PC that you used to initially setup your Firefox Sync service, when setting up that 2nd PC with Sync. You need to use '''Add a device''' to setup the 2nd and subsequent devices on a Sync account. <br />
    https://support.mozilla.com/en-US/kb/add-a-device-to-firefox-sync

  • How to agree with terms of i tune  in order to update applications

    How to agree with terms of i tune  in order to update applications

    Are you agreeing to the terms, but then being asked to agree to them again and again, endlessly? Or is something a bit different going on?

  • How to deal with OpenCL grey out issue.

    First off, I'm not native english speaker.
    I have Nvidia GeForce 550 Ti video card, and its support OpenCL v1.1.
    I'm also face a "random" OpenCL grey out issue like other people here, but I found the "issue" and how to deal with.
    open a command windows (using WinKey + R, and type cmd <enter>)
    type "cd C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)" <enter>
    type "sniffer_gpu" <enter>  -->> to check your GPU has OpenCL in Photoshop?
    When GPU is in power-saving mode (core running in 51Mhz, using MSI Afterburner monitor), I running sniffer_gpu, got this report
    C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)>sniffer_gpu
    Device: 0000000000328D68 has video RAM(MB): 1023
    Vendor string:    NVIDIA Corporation
    Renderer string:  GeForce GTX 550 Ti/PCIe/SSE2
    Version string:   3.0.0
    OpenGL version as determined by Extensionator...
    OpenGL Version 3.0
    Has NPOT support: TRUE
    Has Framebuffer Object Extension support: TRUE
    OpenGL ok
    Return code: 1
    C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)>
    No OpenCL support
    Then, I switch GPU back to normal status (core running at 900Mhz)
    C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)>sniffer_gpu
    Device: 00000000001F8D68 has video RAM(MB): 1023
    Vendor string:    NVIDIA Corporation
    Renderer string:  GeForce GTX 550 Ti/PCIe/SSE2
    Version string:   3.0.0
    OpenGL version as determined by Extensionator...
    OpenGL Version 3.0
    Has NPOT support: TRUE
    Has Framebuffer Object Extension support: TRUE
    OpenGL ok
    OpenCL ok, version=1.1 CUDA 4.2.1
    Return code: 3
    C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)>
    OpenCL support !!
    Nowadays, most of new GPUs were support power-saving, but when sniffer_gpu running at GPU power-saving state, the OpenCL computing report maybe "time-out", cause the detector "guess" the GPU does not support OpenCL. This is why many people says "OpenCL" sometimes work, sometimes grey-out.
    I hope this bug can be fixed, or at least people can understand how to "enable OpenCL everytime when you launch photoshop".
    Bye.

    Do check the following link
    http://blogs.oracle.com/soabpm/2010/01/soa_suite_11g_weblogictransact.html

  • How to deal with "Error 1001. The specified service already exists" when install a service using installer package?

    Hi everybody,
    I wrote a "Class Library" project which is a service using Visual Stodio 2008 recently, then tried to use a Visual Studio 2008
    Setup Project to install it.
    Here is what I did for the "Class Library":
    1. Finish the program.cs, Service.cs
    2. Add Installer
    3. Change the serviceInstaller so that "StartType" to be Aotumatic
    4. Change the ServiceProcessInstaller2 so that "Account" to be LocalSystem
    5.
    6. Click in F5 (Start Debugging)
    Here is what I did for the Setup Project:
    1. Add the exe file built from the "Class Library" project to the Application Folder
    2. On the Custom Action Editor, add the exe file from 1 to Install and Commit
    3. Change the property of the project so that "RemovePreviousVersion" to be true
    4. Click on F6(Build Solution)
    Then I tried to run the msi file from the built of the Setup Project. Because I modified the two projects serveral times, I uninstalled the Class Library using "Control Panel->Add or Remove Programs" before I reinstall. Two things I notived:
    1. After unstall, the registry was not cleaned up about the installed program
    2. After several rounds install/uninstall, I got "Error 1001. The specified service already exists"
    My questions are:
    1. How to cleanup the registry when uninstall a program?
    2. How to deal with the "Error 1001. The specified service already exists"?
    3. Did I do anytbing wrong with the "Class Library" or the "Setup Project"?
    Thanks a lot!
    Helen

    Hi Simon, not a problem!
    I spent some more time on this and here are few more notes:
    it is called Major Upgrade, when you are installing new version of the product upon a previous one and
    MSI supports 2 strategies:
    Strategy 1. Install a new version and uninstall previous one. (Install a new version right upon previously installed version (file merging is performed based on dll version number) and the delete previously
    installed files)
    Strategy 2. Uninstall previous version and install a new one (Delete all previous files and install from scratch new files.)
    From the first look it seems that 1st strategy is weird and buggy. But, remember, MSI is great because it's transactional!!! That means that if once some of the phases (Installation, Uninstallation, Rollback, Comit) fails, your machine
    will be reverted to the previous state and it'll be still functional. 
    Let's consider both strategies:
    Consider you have installed product_v1.msi and you want to install product_v2.msi.
    Strategy 1
    1. MSI engine copies files from Product_v1 directory to TEMP directory
    2. MSI engine merges files based on the assembly version (between v1 and v2)
    3. Once merging is completed successfully it removes files in TEMP (RemoveExistingProducts  action triggers it) and you got product_v2 installed, otherwise if it fails MSI engine revert machine to V1 and copies previous files from TEMP.
    Strategy 2
    1. MSI engine tottaly removes all files from v1.
    2. MSI engine installs v2 files and if something goes wrong you cannot revert back, because RemoveExistingProducts  allready worked out and MSI doesn't have files to revert machine back
    I recommend to everybody to use Strategy 1 and leverage MSI transaction functionality. And you can set this strategies by defining sequence of RemoveExistingProducts action. See more info
    here.  So, I think it's not even a bug in VS as I said in the upper post it is default recommened behaviour.
    AND, you got "Error 1001. The specified service already exists"
    because if we follow Strategy 1 MSI engine tries to install Windows Service on top of the existing service and OF COURSE it fails MSI engine (StopServices, DeleteServices actions are executed before actual
    installation and  they look at ServiceControl table). In order to stop service first and delete them you have to fill ServiceContol table of the MSI (and then StopServices, DeleteServices actions will recognize what to they have to stop
    and delete), like this:
    *clip*clip*clip*
    ' see http://msdn.microsoft.com/en-us/library/windows/desktop/aa371634(v=vs.85).aspx for more info
    ' Update the Service Entry to stop and delete service while uninstalling
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD_Service', 'Service name', '160', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    ' Update the Service Entry to stop and delete service while installing
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD2_Service', 'Service name', '10', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    *clip*clip*clip*
    We can uninstall service first by following Strategy 2, but then we lose transactional support.
    So, Simon did I encourage you to change your code a bit?:)
    And, btw, if you don't want to change the strategy, please don't rely on SequenceID in MSI table, it can be change, you have to get the at the runtime.
    Hope it will help to everybody!
    See also more advanced explanation of how MSI works
    here.
    Truly yours, Marat

  • How to deal with credentials for external applications using a Java Client/

    Hi Guys,
    This is the case. I am integrating an external application with an ADF Application. I have implemented some programmatic ViewObjects that are being filled up by a REST Java Client Wrapper. Everything is working fine but the issue is that the credentials the wrapper is using are hard coded inside the java class. I am thinking to ask for the credentials at the beginning of my taskflow and then store them somewhere and use them then to create my client wrapper (passing them in the constructor).
    However, I don't know if my approach is good and I would like you to share your experiences or how to deal with this.
    Regards

    You can use Credential Store Framework to store the credentials securely in the weblogic server instead of hardcoding in the java class.
    The Credential Store Framework:
    - enables you to manage credentials securely
    - provides an API for storage, retrieval, and maintenance of credentials in different back-end repositories
    Check the documentation on CSF API -
    http://docs.oracle.com/cd/E29505_01/core.1111/e10043/devcsf.htm
    Major Steps -
    1. Create a credential map and key in em console to store the password (http://docs.oracle.com/cd/E25054_01/core.1111/e10043/csfadmin.htm)
    2. Use CSF API to retrieve the stored password
    3. In jazn-data.xml give permissions to access CSF key and map

  • How to deal with payment of vendor to us (credit notes I guess)

    Normally I use F07 for outgoing payments, it's linked to vendors, but how to deal with incoming payments of vendors?
    We got paid two invoices(credit notes I guess) and I want to put them under the right vendor, but how do I do it?
    I can't use F07 I think because I need to use positive amounts (for normal purchase invoices) and can't use negative amounts in this transaction. F08 is for ingoing payment but that session is linked to customers I thought..not for vendors?
    How to deal with this kind ot transactions? What transaction can I use the best for payments like this
    (we got paid an amount , no invoices yet, but I know the vendor).

    whith F-02 it is possible I noticed.

  • How to deal with file(for example .xml)? what format of dir should be?

    I'd like to operate the file in disk, and want to use relative directory?
    How to deal with file dir? what format of dir should be?

    Hi Kamlesh,
    Thanks for your response.
    Actually, In the "Process External Bank Statement" window, i see that there are few entries which is for the previous year and which has not been reconciled. I have never worked practically on BRS and hence, i am scared to make any changes in the clients database without being confident on what i am doing. I need to reconcile for one of their Bank a/c for the month of April '08. I have the copy of the statements for the month ending 31st Mar 08 and 30th Apr 08. The closing balances are as below:
    31/03/08 - 2300000.00
    30/04/08 - 3100000.00
    Now my OB for Bank a/c for April '08 in SAP is 2300000.00 Dr.
    When i go to External Bank Reconciliation - Selection Criteria Screen (Manual Reconciliation), here are the detail that i enter:
    Last Balance: INR -7,000,000.00000 (Grayed out by the system)
    Ending Balance: INR -3,100,000.00000 (Entered by me)
    End Date: 30/04/08 (Entered by me)
    "Reconciliation Bank Statement" Screen opens up and shows the below balances in the screen:
    Cleared Book Balance: INR -7,000,000.00000
    Statement Ending Balance: INR -3,100,000.00000
    Difference: INR 3,800,000.00000
    As per the Bank statement, i have found all the transactions listed out here for the month of Apr '08 but, i also found that the open transactions for the previous month from April '08 have been lying in "Process External Bank Statement" window.
    Could you please help me solve my issue as to what needs to be done or could you also get me some links from where i can get few documents for processing External Bank Reconciliations?
    That will be of a great help for me. I need steps as to what needs to be done first and then the next so that i can arrive at the correct closing balance for the month April '08.
    Thanks in Advance....
    Regards,
    Kaushal

Maybe you are looking for

  • Analysis Authorization Pre Filtered Values

    Hi all Gurus, I am currently using Analysis Authorization setup and when I run report with no values input in the variable input screen it seems to display ALL the records in the info provider BUT not by what I am able to see based on my authorizatio

  • Error Message installation itunes 10.5.2 Mircosoft VC.80.Crt,Hresult 0*80070002

    Hello, I am trying to install itunes 10.5.2 to my computer running Windows Vista 64 bit. I always get the same error messages, in the following orders during install intunes. Itunes. an error occured during the installation od assembly "Microsoft VC8

  • His / Her iPods-One Mac mini-2 separate logins users....

    and how can I sync her ipod on the mac. We both us one mini in office with two users. I want to sync all her emails,Mail, iCal,Address book as I do on my login side. Cheers

  • Getting 404 errors

    Hello: I have EM up an running. It looks fine. I can login and manage my database. The only problem is that faily often when I click on a button or link, I get a 404 error. If I hit back and try again, the operation goes thru just fine. It does not h

  • Find/Replace Missing With New Monitor

    Hi, I've been happily using DW CS4 for about a year now with 2 19" monitors. I recently am stuck using a single 22" monitor which is generally fine, but my Find/Replace window is now missing. I'm assuming it is off somewhere in the 'virtual' screen.