How to print the name of the .sql file in the same file using sqlplus

Oracle 10g on Linux platform.

I am trying to print the name of the .sql script file in this file, but could not. Here is the file:

test. SQL
select '&0' from dual;
But instead of print, it is asked for the entry:
SQL> @test.sql
Enter value for 0: 
Can any body give me a clue as how can I print the name of the file.

A quick Google search and I found this...

http://blog.tanelpoder.com/2007/12/26/sqlplus-is-my-second-home-part-5-reading-the-name-of-currently-executing-script/

Content of a1.sql

appinfo set to
Select sys_context (' USERENV', 'MODULE' ') of double;

He'll be back...
SQL > @a1

SYS_CONTEXT ('USERENV', 'MODULE')
-------------------------------
01 @ a1.sql

James.

Tags: Database

Similar Questions

  • How to print the same image twice on a piece of paper

    I try to print a graph of 5 x 7. I can open it in Microsoft photo viewer and the option to print as a 5 x 7 (2) is displayed, but when I click it it just pushes the chart to the top of the paper and leaves half white background. Is it possible that I can essentially put 2 of the same graphics on a piece of 8 x 11 paper and print it like that? I was just going to cut them after printing, so that way I can use half of the book, I'd use if I were to print everything on their own piece of paper

    If you select "5" x 7 "(2)" then replace "Copies of each image" 2, and you should get two 5 x 7 images side by side.

  • How to print the transaction validation sql?

    All,

    With the help of Studio Edition Version 11.1.1.3.0.

    I got a violation of primary key constraint that I can't quite understand. I can insert fine lines and everything looks very much like the page refreshes, but when I sign, I get the error. I would like to know what is committed to the database. I understand the problems normal display when your association is not composite: http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadveo.htm#CEGJAFCF, but in my case, this one is.

    How to print the SQL that is generated when getDBtransaction.commit () is called?

    That should tell me why I get a command validation error (if that is what it is).

    Thank you
    Will be

    Add - Djbo.debugoutput = console for the properties of the project

  • How to print the jobes username printed by printer usingnetwork

    Please how to print the user name on paper printed for each print job printed paper

    If you want on each page, you can explore the properties of the printer to see if your printer driver supports this.

    • Click Start
    • Click on printers and faxes
    • Right-click your printer
    • Click on properties

    From there, my printer does print... properties via buttons and then the Options page, but your printer may be different.

    Separation pages (page between each print job) can do a job for you, but I've never used them so I can't advise further. If all goes well, another contributor may be able to advise on this. Or you could Google "separator pages XP.

    Tricky

    EDIT: It seems that Shenan Stanley is ready to explore the pages of separation with you

  • How to get the full DDL using SQL developer

    Hi all

    I need get the full DDL a table with the details of the index partitions, synonyms, comments (if any) and give information if given any role, use SQL developer. We can achieve the same thing using shortcut F4 on name of the table into a frog, then selecting tab DDL. Is it possible to get the same in SQL Developer also?


    Also how I see existing procedures using SQL developer?  A toad, we were able to achieve using the schema browser.

    Hi all

    I reached by - right click on connection - diagram open... and any browser will even...

  • How to print the full path when you print photos with CS6?

    How to print the full path on the photo when printing photos with CS6?

    Hello

    You will need to use a Script to print the name of the file in Photoshop Cs6

    Something like Add file name as text layer "Julieanne Kost's Blog of »

    Concerning

    Assani

  • recentley most of the documents in firefox to print prints on 1/4 of the page and not the full document. When I print the same thing in safari, it prints very well. Please tell us how can I get good print in firefox

    If you use Firefox to print most documents (boarding cards, identified mastercard, genealogy documents) printing shows only 1/4 of the page, is located in the left lower quadrant and doesn't print not part on the right side of the information. When I go into Safari and print the same documents in 2 minutes what they always print very well. We like Firefox and prefer to continue to use, but if we are unable to print, we use Safari more often

    Check and tell if its working.

  • How to print the page on WiFi printer using ideapad a1

    How to print the page on wifi printer using ideapad a1

    Cloud Print (available in the game store) use Google chrome to print from the A1 motorway. You must have Chrome installed on your computer. If not connected to Google (required) or your PC/Mac/Linux computer is turned off, it will be printed when you log-n.

  • How to print the contents of a hard drive?

    Title: list of files on a specific drive.

    How to print the contents of a hard drive?  I would like to be able to remove the old files, but it would be easier if I could print the content rather than scroll through the file by file.

    Hello

    These should help:
     
    How to save and print a list of directory for a file and the folder of Vista (Windows 7 is the)
    same)
    http://www.Vistax64.com/tutorials/114593-file-folder-directory-list-print-save.html

    How to add view and directory of print in the context Menu in Vista and Windows 7 file
    http://www.Vistax64.com/tutorials/146031-context-menu-add-view-print-file-directory.html

    Use this free program which is great:

    KarenWare - printer - free directory
    http://www.KarenWare.com/PowerTools/ptdirprn.asp

    How to add the feature print directory for files in Windows XP, Windows Vista or Windows 7
    http://support.Microsoft.com/default.aspx/KB/321379

    I hope this helps.

  • How to print the date on the pictures

    Can someone advise please how to print the date the pictures on my HP C6380 All in one printer.  I managed to change the settings to do that before, but now it's me beating.  I have a fault if I can.

    Thus, because there is no date and time setting on the printer that you will use the software you have to super impose a time and date on the photo.  Then print it on the printer.

  • ADF: How to print the query and the query passed into the class executeQueryForCollection methof impl VO parameters.

    Hello

    Kindly let me know how to print the query, and the parameters passed to it? I tried with the params parameter in super.executeQueryForCollection (qc, params, noUserParams); but could not succeed.

    I need save the query and the parameters passed to it. Kindly help.

    Thanks in advance,

    Kalpana.

    Here you go

    Coding with Passion: Oracle ADF - Debug Mode object query with parameters

  • How to print the image in grayscale in the rich black?

    How to print the image in grayscale as PDF as black process only instead of CMYK?  I'm on FM10

    Ed,

    What file format you save the image in? It is important, as indicated by error. If you left it as a PSD, then FM performs a conversion to RGB. A TIFF or EPS file properly remains blank (i.e. on the plate of K). Other formats, such as PNG to grayscale are actually indexed color and solve RGB when FM creates the PDF file in the presence of plates of Spot and where the components are mapped to the CMY plates also.

    Here is a sample generated using SaveAsPDF with the CMYK option with the same 'gray levels' file saved in the format PNG, TIF and EPS in Photoshop (Note how the PNG isn't all there, on the plate K):

  • How to print the Outline view only?

    How to print the map view black and white only? I've pasted the outline of a layer, hiding all other layers, but still printed Preview color mode.

    Only way I know is t take a screenshot and print that.

  • Epson 880 printer won't STOP PRINTING THE SAME DOCUMENT.

    How can I get my printer to stop printing the same document over and over again?

    Moved from feedback

    Original title: printer IS NOT STOP PRINTING THE SAME DOCUMENT.  I HAVE a COMPUTER WINDOWS 7 AND ONE PRINTER EPSON 880 and need to know how to stop it. print

    Hello Irene,.

    When the printer prints, you will see a small printer icon to the taskbar (lower-right). Click it and you'll see the files that are printing. If you view the document, please remove it from the print queue.

    If this is not enough, then proceed as follows.

    1. type Services.msc in the box Start of search and press on enter.

    2. Locate the print spooler and right click on the service and then click stop.

    3. when the Print Spooler service is stopped, go to C:\WINDOWS\System32\spool\PRINTERS and delete all the files mentioned in the record. This will clear the current print jobs.

    4. once the files are deleted, return to the Services window and start the service print spooler.

    Hope this information helps. If you have any questions, please let us know.

  • How to create the user account using the command?

    How to create the user account using the command?

    Open cmd as administrator, and then type the following commands one after the other

    NET user / add program mypassword
    net localgroup administrators program / add
    net share concfg * C:------/ grant: program, complete
    This will create a user account with the name "Program" and the password "MonMotpasse".

    You can create the user name and password of your choice.
  • How to map the same tag of the element with a different value in BI Publisher rtf model.

    Hello

    I have an xml file with the same name in the < tag > element and I do not know how to associate the same < tag > element to different string in the document rtf template attribute.

    For example: "' Eswitch <number > is repeated in this xml file, when I am mapping this element to the document rtf with a different string, I have same value 'D00002 ' . I should get values D00002 and DMR00002.

    < document >

    < TitleBlock >

    < number > D00002 < / number >

    < itemType > Document < / itemType >

    < lifecyclePhase > preliminary < / lifecyclePhase >

    < description > gtedgg < / description >

    < shippableItem > n < / shippableItem > < / cartridge > < / Document >

    < DMR >

    < TitleBlock >

    < number > DMR00002 < / number >

    < itemType > DMR < / itemType >

    < lifecyclePhase > preliminary < / lifecyclePhase >

    test nomenclature model bom1 < description > < / description >

    < POS > < value > Test < / value > < / POS >

    < shippableItem > n < / shippableItem > < / cartridge > < / DMR >

    < / AgileData >

    I followed steps below for map document model rtf with the same tag xml with a different value.

    1. install Office word 2013.

    2 BI Publisher for desktop software installed. It will add a BI Publisher plugin to the word document.

    3. with the help of desktop publisher BI, created a model of document rtf file.

    4 imported the document rtf template example xml file.

    The data is loaded successfully.

    5 tires model rtf field symbol to map the tags to xml to rtf document attributes element.

    7 saved the document in PDF format.


    Thank you

    Please mark it correct so that it is useful for others to find the solution to a similar request.

Maybe you are looking for

  • Is it possible to use more than 8 boards with Toshiba bulletin board?

    I want to have more than 8 boards on the Bulletin Board.Y at - it a setting I can change to achieve this goal?

  • Unknown "PC servers" in the Finder

    My home network is running on an Airport Extreme. We have two MacBook Pro, El Capitan, an old iMac G5 running OS 10.5.8 running, a Hello networked laser printer, wireless printer/scanner, a smart TV and a booster of "micro cell" signal for my mobile

  • smart web print icon

    Hello. SWP, I installed and it works fine but there is no icon sheet. I tried the Manager and SMP is activated ok, so is the icon. Can anyone suggest a solution?

  • nothing happens when I click 'change user '.

    Followed the steps in the PANEL re switching users, still no response. Tried the strikes and am, you are prompted for a password that does not exist.

  • Lost the ability to copy files from one disk to another?

    My setup is a drive C and D inside the Tower, then a MyPassport external USB for weekly backups of player and a MyBook to USB 2 external rarely used to store large files. Everything is defragmented, at least 20% free space on each disk and ran checkd