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

Oracle 10g on Linux platform.
I am trying to print the name of .sql script file in that file but could not. Following is the file:
test.sql
select '&0' from dual;But instead of printing, it is asking for input:
SQL> @test.sql
Enter value for 0: Can any body give me a hint as how can i print the file name.

Use this
SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT
and see
SQL> create or replace procedure get_dir_list
2 (p_directory varchar2)
3 is
4 l_null varchar2(100);
5 l_directory varchar2(100);
6 BEGIN
7 l_directory := p_directory;
8 sys.dbms_backup_restore.searchfiles(l_directory, l_null);
9 FOR x IN (select fname_krbmsft fname from x$krbmsft) LOOP
10 dbms_output.put_line(x.fname);
11 END LOOP;
12
13 END;
14 /
Edited by: HuaMin Chen on Jun 26, 2012 12:26 PM

Similar Messages

  • How to print out multilingual reports from the main report using Xliff temp

    Hi all,
    How to print out multilingual reports from the main report using Xliff temp?
    When I want main report call subtemplate and finish xliff tranlation
    <?for-each@section:INVOICE?><?end for-each?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    Prints out fine with Finnish translation
    But if I want in main program to check what language is used e.g.
    if trx_number = 142 call Finnish translation and if trx_number =144,
    call English translation.
    <?for-each@section:INVOICE?><?end for-each?>
    <?if:TRX_NUMBER=’142’?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    <?end if?>
    <?if: TRX_NUMBER=’144’?>
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
    <?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
    <?end if?>
    Prints out always in English and never the Finnish translation.
    Program goes fine to if branch but does not print out Finnish
    Does anybody know what could be wrong?
    BR
    Kari

    Thanks Amit,
    I have two layout, main-layout and sub-layout
    Main layout call subtemplate
    I have registered layout and xliff-file
    Main template
    Localized Templates
    File Name           Language Territory
    XXNS_INVOICE_MAIN.rtf      English
    SUB template
    Localized Templates
    File Name           Language Territory
    XXNS_INVOICE_SUB.rtf      English
    Translatable Template
    File Name           Language      Territory
    XXNS_INVOICE_SUB.rtf      English      United States
    Available Translations
    Language Territory Progress
    English Finland Complete
    If main report call subtemplate and finish xliff tranlation
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    Prints out fine with Finnish translation
    But if I want in main program to check what language is used e.g.
    if....
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
    .....end if;
    if....
    <?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
    .....end if;
    Prints out always in English and never the Finnish translation.
    Program goes fine to if branch but does not print out Finnish
    Do you it's set up problem or program problem
    BR
    Kari

  • How to print PDF files using java print API

    Hi,
    I was goign throw lot of discusion and reading lot of forums related to print pdf files using java api. but nothing seems to be working for me. Can any one tell me how to print pdf files using java api.
    Thanks in advance

    Mike,
    Can't seem to get hold of the example described in your reply below. If you could let us have the URL to get then it would be great.
    My GUI application creates a pdf document which I need to print. I want to achieve this using the standard Java class PrinterJob (no 3rd party APIs I'm afraid, commercial restraints etc ..). I had a stab at it using the following code. When executed I get the pretty printer dialog then when I click ok to print, nothing happens!
    boolean showPrintDialog=true;
    PrinterJob printJob = PrinterJob.getPrinterJob ();
    printJob.setJobName ("Contract.pdf");
    try {
    if (showPrintDialog) {
    if (printJob.printDialog()) {
    printJob.print();
    else
    printJob.print ();
    } catch (Exception PrintException) {
                   PrintException.printStackTrace();
    Thank you and a happy new year.
    Cheers,
    Chris

  • How to print Pdf files using Adobe Reader

    How to print Pdf files using Adobe Reader

    Open the PDF file with File > Open... in Adobe Reader and print it with File > Print

  • How to execute .sql file using ODI

    Hi All,
    I need to execute .sql file using ODI.
    I tried @{path}{file} command in ODI procedure selecting oracle technology.but it is failing.
    Do any one have any other idea to execute .sql file.
    Thanks in advance

    Ohk...I think you can try creating batch file(.bat) if its Windows & call that from ODIOSCommand.
    The bat file should contain scripts which call .sql file using sqlplus  & there you can use @{path}{file} format.
    See if this helps.
    Regards,
    Santy

  • How to clone 40 mac mini at the same time using network clone (like Ghost)

    how to clone 40 mac mini at the same time using network clone (like Ghost)
    Any Ideas ?
    Thanks

    Rather than a 100% identical clone to 40 Macs, I suspect you want the same basic image to be loaded on to those 40 Macs but will require some individualisation so that for example each has a unique computer name.
    NetRestore and System Imaging Utility can do this but a lot of people including myself prefer to use DeployStudio which has more capabilities. See http://www.deploystudio.com
    DeployStudio can be used to like NetRestore to restore an image to multiple Macs at the same time which is like multiple people downloading at the same time, but it can unlike the standard NetRestore also be configured to use multicast traffic which is more like a TV broadcast whereby multiple people receive the same transmission at the same time. This can be more efficient for imaging larger numbers of computers at the same time. For example 1Gbps shared between 40 computers is only 25.6Mbps each, but if you multicast a single transmission of 100Mbps to 40 computers then all 40 can listen to it at the same time and still be receiving 100Mbps even on the same network connection.

  • How to print external file using ABAP program

    Hello
    I want to print an external file which is located in server (
    20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
    thank you
    Vikram.
    Message was edited by:
            Vikram Bojja

    extract the data and pass to script or smartform for printing

  • How to switch between 2 windows of the same application using Cmd+Tab

    Hi,
    I am using my mac now since about 10 months. I was used to work with Linux and Windows XP.
    Something I am badly missing on mac os x is the possibility to switch between 2 windows of the same application using cmd + tab just like it simply works for Linux and Windows (and maybe many other OS out there!).
    Very often I have 2 text files open in 2 editor windows (e.g. TextEdit) and need to copy and paste text from one window to the other. I was used to simply use ALT+TAB. But here I have to get my right hand away from the keyboard and use the mouse to change the focus from one window to the other and then use the mouse again to get the focus back to the previous TextEdit windows.
    THIS REALLY *****!!!! It makes me crazy. I cannot believe that such a "modern" OP does not support this action. I must be doing something completely wrong or did not understand the mac correctly. Right?
    Does anyone have an idea how I can get mac to do something all other operating systems so easily do?
    Thanks
    Quartz84

    Hi Kappy,
    well what you are saying is obvious to me. This is not the point for me and not what I wanted to know. But I think you answered my question anyway: OS X is unable to switch between windows of the same application as I mentioned in my example.
    WHY NOT???
    Every other OS is able to differentiate between windows and not just applications.
    Another example: The Mail application and an Email editor window. When you are writing an Email and you want to switch to the main window of the Mail application to read something you must again use the mouse!
    I mean Apple seems to be "somehow" using FreeBSD in the background and even in FreeBSD's window manager it is possible to switch between windows of the same application.
    Well, in the Apple world it is always the pour user who is not intelligent enough to understand Apple's philosophy ;-(
    To me this is not modern, it is simply a weakness of the OS.
    Cheers
    Quartz84

  • How to print three different Barcodes in the same line

    I am trying to print Barcodes for three different fields in a single line, it is taking the combined one & printing only one barcode for  all those three fields.
       When I tested it by printing them in diff lines, it is working fine. But the requirement is to  print all fields in the same line

    Hi
    Look at this , may be useful
    To Create a Bar code prefix:
    1) Go to T-code - SPAD -> Full Administration -> Click on Device Type -> Double click the device for which you wish to create the print control -> Click on Print Control tab ->Click on change mode -> Click the plus sign to add a row or prefix say SBP99 (Prefix must start with SBP) -> save you changes , it will ask for request -> create request and save
    2) Now when you go to SE73 if you enter SBP00 for you device it will add the newly created Prefix
    Create a character format C1.Assign a barcode to the character format.Check the check box for the barcode.
    The place where you are using the field value use like this
    <C1> &itab-field& </C1>.
    You will get the field value in the form of barcode.
    Which barcode printer are you using ? Can you download this file and see.
    http://www.servopack.de/Files/HB/ZPLcommands.pdf.
    It will give an idea about barcode commands.
    Check this link:
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    Check this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a94c851ea11d189570000e829fbbd/content.htm
    Hope this link ll be useful..
    http://help.sap.com/saphelp_nw04/helpdata/en/66/1b45c136639542a83663072a74a21c/content.htm
    go through these links and cose u r previous threads,
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    smartform - barcode
    http://www.erpgenie.com/abap/smartforms.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-basis/print-barcode-with-smartform-634396
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/printing-barcode-733550
    Detailed information about SAP Barcodes
    A barcode solution consists of the following:
    - a barcode printer
    - a barcode reader
    - a mobile data collection application/program
    A barcode label is a special symbology to represent human readable information such as a material number or batch number
    in machine readable format.
    There are different symbologies for different applications and different industries. Luckily, you need not worry to much about that as the logistics supply chain has mostly standardized on 3 of 9 and 128 barcode symbologies - which all barcode readers support and which SAP support natively in it's printing protocols.
    You can print barcodes from SAP by modifying an existing output form.
    Behind every output form is a print program that collects all the data and then pass it to the form. The form contains the layout as well as the font, line and paragraph formats. These forms are designed using SAPScript (a very easy but frustratingly simplistic form format language) or SmartForms that is more of a graphical form design tool.
    Barcodes are nothing more than a font definition and is part of the style sheet associated with a particular SAPScript form. The most important aspect is to place a parameter in the line of the form that points to the data element that you want to represent as barcode on the form, i.e. material number. Next you need to set the font for that parameter value to one of the supported barcode symbologies.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to force SQL*Loader to assign the same SYSDATE for all rows?

    I want to use SQL*Loader to load some rows and a "SYSDATE" generated column, but making sure this date is THE SAME for all rows. I have seen that if I load HUNDREDS of rows there is a little difference between them (in terms of seconds). I guess it is "the moment each row entered the DB", but I need the same value for all rows (preferably, "the moment SQL*Loader was launched"). Is there any way to achieve this?
    Thank you very much.

    Hello user2393320.
    Given some thought, using a date value to identify all records from a single load isn't very wise.
    Are you able to create a procedure on the database that could be executed during SQL*Loader's execution? If so, you could develop the procedure to take in the record number of the row being loaded as an input parameter and output this unique date value for all rows loaded. The procedure would need to store the date value in a table when the first row is being loaded and return the stored date value as its output. This obviously assumes that only one sqlldr session is running at any time.
    I highly recommend using a numeric sequence in the control file instead of a date to identify each file load:
    , file_load_seq SEQUENCE(MAX, 1)
    Another approach would be to load the record number being loaded in addition to the sysdate:
    , record_number RECNUM
    Hope this helps,
    Luke

  • How do I read and write at the same time using the NI-CAN channel API?

    Here's the situation.  I have one CAN bus, and I need to read and write channel data (using the channel API) at the same time both at an interval of 20 ms.  It's easy to do one or the other using the channel API, but you can't setup a channel task to do both.  It's either input or output, not both.  Is this even possible?

    Hi,
    yes , this is possible. But you have to create two tasks, one for input and one for output. see the attached example for LabVIEW.
    If you download and install NI-CAN 2.4 you will get this example and one for C and VB as well.
    DirkW
    Attachments:
    Single Sample Input Output same Port.vi ‏79 KB

  • Print different text elements on the same line

    Hi all,
    1.
    Is it possible to print different text elements on the same line ? with multiple write_form
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             element       = 'TITLE1'
             WINDOW        = 'INFO'
         EXCEPTIONS
              ELEMENT       = 1.
    CALL FUNCTION 'WRITE_FORM'
         EXPORTING
             element       = 'TITLE2'
             function      = 'APPEND'
             WINDOW        = 'INFO'
         EXCEPTIONS
              ELEMENT       = 1.
    How to print TITLE1 and TITLE2 on the same line ?
    TITLE2 in bold.
    2. How to print 2 text elements on the same line with include statement ?
    /: include test1 ...
    /: include test2
    Thanks
    Edited by: Moo Yac on Sep 22, 2008 8:23 AM

    To be more specific :
    I want to print the following
    Text_symbol1:$Var1$      Text_symbol:$Var2$
    on the same line.
    where Text_symbol1 and Text Symbol2 are defined in SO10 for different languages.
    Thanks.

  • How do I add my name to the camera data file in meta data?

    When reviewing the meta data on my photos I see the camera model number, serial number, focal length, etc.  The camera owner field is blank.  How do I add my name to the camera owner field?
    I'm using Photoshop CC, on a windows 8.1 Pro platform.  Any help would be greatly appreciated.
    Caitlin

    I did add all the info on the menu section you mentioned above.  Unfortunately it does not show up as "Owner" when you view the data file in Photoshop CC for some reason. Copyright info shows properly, but not camera owner.  It's not a big problem anyway, just a pride of ownership thingy .  I downloaded the GeoSetter program, and after reviewing the meta data contained there I don't see an option for "owner" there either.  Perhaps its something that Adobe plans to implement someday, who knows. Thanks for your suggestions everyone.
    This is my first DSLR, all I have shot in the past have been film cameras and we didn't have any of this fancy info available unless we wrote it down somewhere, smile.  I was still using my old Nikomat that I purchased in 1972 when I was stationed in Japan. I was a bit stubborn when it came to switching to DSLR sorry I waited so long now.
    Oh, Trevor, sorry to learn you may be using something other than Nikon, I didn't know there was another brand other than Nikon!
    Caitlin

  • How to put two files with the same name into the same folder?

    How can I put two files with the same name and the same extention into the same directory?
    Is this even possible?
    Thanks in advance. 

    Are you sure? I would be very surprised if that was the case.
    How does the computer/filing system differentiate the files, if not by their names?
    How do you tell the computer which one you want? (On the command line.)

  • How to check my job name from the database...

    I have written one job scheduler which is as follows :
    SQL> ED
    Wrote file afiedt.buf
    1 DECLARE
    2 X NUMBER;
    3 JobNumber NUMBER;
    4 BEGIN
    5 SYS.DBMS_JOB.SUBMIT
    6 (
    7 job => X
    8 ,what => 'scott.SPLITSMS;'
    9 ,next_date => SYSDATE+1/1440
    10 ,interval => 'SYSDATE+1/1440 '
    11 ,no_parse => FALSE
    12 );
    13 JobNumber := to_char(X);
    14* END;
    15 /
    PL/SQL procedure successfully completed.
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    how to check my job name from the database...
    what is the command used to check the job_name ????
    and how can i ensure that my job scheduler is running properly...???
    please help ........my dear friends.....!

    957029 wrote:
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not existYou can use DBA_* views only if the User has been Granted a DBA Privilege.
    how to check my job name from the database...
    what is the command used to check the job_name ????You can use USER_JOBS view to check. But, is it not that you have just created the Job, so you must be knowing it?
    and how can i ensure that my job scheduler is running properly...???If USER_JOBS.FAILURES is Non Zero, that means the Job has encountered a problem that needs to be Investigated. Similarly, the LAST_DATE, LAST_SEC, NEXT_DAY, NEXT_SEC can be used to determine if the Job has been running successfully.
    if you are on 11g, you should consider using DBMS_SCHEDULER.

Maybe you are looking for

  • My iPod nano's bluetooth won't connect with my Macbook Pro after pairing, why?

    Just purchased a new 7th generation iPod nano, synced it up to my iTunes account using the cable and charged it fully. All working fine, except for when I tried to then connect it via bluetooth. My Macbook Pro (which also has all the latest updates)

  • Output preview functionality in SRM

    Hi, We are using SRM 550 Scenario: ECS We receive the following popup-message while using the PO output preview functionality in SRM : "Global data missing for purchase order". Has anybody have an idea how I can fix this issue? Thank you very much in

  • Legacy flat file - XI - R/3 (IDocs)

    Hi Liu, I was trying to have some hands-on with XI 3.0 demo. I tried with the following scenario- Legacy flat file -> XI -> R/3 (IDocs) e.g., say to create BOM data or material Master. I take the flat file - create my own External Data Type, message

  • 2 Factor Authentication YouTube Uploads.

    I have gone to Google and put iMovie in for two factor authentication.  When ever I close down iMovie I have to go back to Google revoke the old one and do it again. So here is the question. When I put the Authentication code in for Youtube after I c

  • Problem with holding back button to flash phone

    I cant intall xrecovery. I tried many tutorials. It just do not work when i hold/ spam click back button at white sony logo. I cant even reintall my soft using SUS, becouse nothing is going on when i press back button (according to SUS instructions).