Newbie: how to launch query, located in a part of a file

When I put a query in a file, I can run the query using the filename, as follows:
file content:
===
select whatever from where-ever where however;
exit;
===
Command:
sqlplus username/password@databasename @filename
I would like to put a list of queries within one file and run only one of them as I please, as follows:
file content:
===
first_query:
select first from first_table where first_condition;
exit;
second_query:
select second from second_table where second_condition;
exit;
===
Commands:
sqlplus username/password@databasename @filename->first_query
sqlplus username/password@databasename @filename->second_query
Does anybody know whether this is possible and how?
Thanks
Dominique

You would have to pass a command line parameter and have it somehow conditionally execute one part based on the value of the parameter. SQL*Plus does not provide a built-in way of doing this but with some ingenuity there is probably a workaround.
Why would you not use a proper programming language though?

Similar Messages

  • How to CIF product locations for many parts from R/3  to SCM SPP

    We are trying to CIF product locations of 2500 parts. We are able to take only 10 parts
    in one transfer. Can anyone help us with this. How do we transfer all these parts in a single attempt.

    Thanks for your answer.
    In the product selection screen in CFM1, there are limited no of rows that can be copied in one go. The next set of rows have to be added by scrolling down.This becomes very manual if we have to do it for 2500 parts.
    Can u suggest a better way of doing this activity?

  • Warning message about CMP problem when launching query - how to suppress?

    Dear Experts
    How can I suppress warning message that did not stop the query from running?
    I encounter this message when 1st launching it. The next run , it does not show. But if user run it  i think may still show. How to suppress it?
    The message is :
    =================
    Characteristic [Z_I_NN_FN]Application Sub Grou of the MultiProvider is not provided by the PartProvider ZC_00N; this means it is not identified. However, [Z_I_NN_FN]Application Sub Grou is compounded to 0COMP_CODE and 0COMP_CODE is identified with characteristic Z_I_MM_FM for InfoProvider ZC_006.
    In this case, there is a compounding or CMP problem with [Z_I_NN_FN]Application Sub Grou in the MultiProvider for PartProvider ZC_006.
    Processing characteristics with CMP problems in the data manager is very complicated and can have a negative impact on performance. The data manager cannot use SIDs for these characteristics (at least not in the corresponding InfoProvider) because the initial SID = 0 for [Z_I_NN_FN]Application Sub Grou is not the same as the initial compound key for 0COMP_CODE [Z_I_NN_FN]Application Sub Grou (that is, when real values are posted in ZC_006 for 0COMP_CODE).
    For this reason, hierarchies for [Z_I_NN_FN]Application Sub Grou must often be read at leaf level. Furthermore, it is not possible to use hierarchy aggregates for [Z_I_NN_FN]Application Sub Grou or for the remaining InfoProviders.
    System Response
    Where possible, the system tries to avoid negative impacts on performance. Unfortunately, such performance issues cannot be avoided if the correct results are to be displayed.
    Procedure
    When working with important MultiProviders, you should always avoid characteristics with CMP problems.
    ====================
    Please advise how to address CMP problem error message when launching query.
    regards
    Pascal

    Hi Pascal,
    Why dont you select those compounding objects in Multiprovider itself.As far as i understand while activating the MP it throws an error if compounding objects are not selected.
    One more thing to add which i noticed you can try running the query on analyzer if you are running it on RSRT.
    You can see the data even if MP is not active on analyzer but not on RSRT.
    Hope it helps.
    Regards,
    AL

  • How to Launch an Integration Builder under two different java versions

    How to Launch an Integration Builder under two different java versions     1
    1. Situation     2
    2. How To Do     2
    2.1 jre preparation     2
    2.2 Put them into the system     2
    2.3 Execute a Java Web Start under jre 1.4.x version     3
    2.4 Change Java Runtime Versions     3
    2.5 Launch an Integration Builder     6
    1. Situation
    OS: windows 2000 pro – English
    Java version: jdk 1.5.x was already installed. (It’s not permitted to change.)
    I don’t have any authorization to install any software on the PC.
    But I need to use an Integration Builder.
    I already knew URLs of an Integration Builder (http://<hostname>:50000/rep/start/repository.jnlp).
    2. How To Do
    At this moment, an Integration Builder (XI 3.0) can be launch under jre 1.4.x environment (on windows).
    2.1 jre preparation
    I download j2re-1_4_2_10-windows-i586-p.exe from http://java.sun.com/j2se/1.4.2/download.html
    I installed it on my home PC and copied all files from C:\Program Files\Java\ j2re1.4.2_10\ into my USB.
    2.2 Put them into the system
    I pasted j2re1.4.2_10 folder from my USB into the windows 2000 pro system.
    Finally, I could list up all of javaws.exe under this system.
    c:\j2re1.4.2_10\javaws\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\bin\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\jre\bin\javaws.exe
    c:\Program Files\Java\jre1.5.0_05\bin\javaws.exe
    2.3 Execute a Java Web Start under jre 1.4.x version
    I executed c:\j2re1.4.2_10\javaws\javaws.exe .
    2.4 Change Java Runtime Versions
    Go to File-> Preferences -> Java
    As you can see, it indicates 1.5 version.
    Click [FIND] button.
    Click [NEXT] button.
    Click the j2re1.4.2_10 folder.
    Click [NEXT] button.
    A JRE Finder is able to find javaw.exe automatically. Or you can indicate C:\j2re1.4.2_10\bin\javaw.exe directly.
    Click [NEXT] button.
    Finally, there are two Java Runtime Versions. Now you need to uncheck the Enabled column of 1.5 version and check 1.4 version.
    Click [OK] button.
    Well, in the General tab, I selected None for Proxies.
    2.5 Launch an Integration Builder
    In the Location field, I typed the URL of an Integration Builder jnlp.
    http://<hostname>:50000/rep/start/repository.jnlp
    SAP Integration Builder comes up inside Applications area.
    Select it and click [Start] button.
    If you click Environment-> Integration Builder (Configuration), you can launch Integration Builder: Configuration.
    [PDF file location] with screenshots
    http://SDN.mobilian.org/SDN/How2LaunchIB.rar
    ===================Advertisement==========================
    How do you search SDN?
    What about [<b>SDN Search Widget</b>]?
    SDN Search Widget
    =========================================================

    I am not getting anywhere with deploying my application or
    applet.
    I have set up my bc4j project. It contains all my VO info,
    links, application module. (proj a)
    I then have another project with DbInfo in it(has all my rowset
    info), Multiple Frames, and my Applet.java file.
    Actually I have an Applet.java file and a Application.java file
    because I was seeing if both/either worked. Anyway they seem the
    same, except for that extra window that comes up when you run the
    applet.
    I follow the steps in the oracle directions (from earlier post).
    And all seems ok. But at ---->
    [*] Select the subdirectory under myhtml where your applet's HTML
    file
    is located, and enter the directory path of the 'staging'
    directory you
    created in step 3 above, if different from the default.</li>
    [*]Select the HTML files that JDeveloper created to run your
    applet.</li>
    [*]Select all of the Java source files in your project that make
    up the
    applet.</li>
    I have no HTML file associated with my applet, at least that I
    know of.
    So do I need to create one, or should it of been done
    automatically.
    Also, I trying to figure out what will be the best way to deploy
    my project. Applet or stand alone application is what my first
    choices have been so far. I have read that there is some issues
    with applets being served from a different server than the
    database. So a stand alone application was my front runner, but
    I haven't gotten either way to work yet.

  • How to find out locations whether it is in use or not in use

    Hi All,
    I want to delete all unused locations from my FDM application. Can you please help me, how to find the locations that are not in use?
    Regards,
    PB

    You can view the tdataseg(x) table that the location is associated with and sort by period key as needed.
    Select PartitionKey,Part Name,Partsegmentkey
    from tpovpartiton
    This will return the location, location id and segment key.  The segment key is the data segment that the location is associated with.
    You can then query this table and sorty by period key to see what periods the location has data imported for.
    This should give you an idea and you can then delete your locations from within the Metadata > Locations Menu in FDM.
    Keep in mind that once the location is deleted, and data associated with the location will also be deleted (Historical Data)
    Hope that answers your question.

  • How to enable query suggestions

    How can the query suggestions be enabled in the Firefox address bar?

    Go to the Privacy tab (i.e. \Firefox\Options\Options) and for the Location Bar, choose "History and Bookmarks" (using the drop-down arrow).
    Next, go to the Advanced tab and under the General sub-tab, check the box that reads "Search for text when I start typing". Save and restart your browser.
    Hope that works.

  • PSE6 for MAC - How to launch the Organizer?

    I have changed from PSE5 on Windows to PSE6 on a Mac. When I opened PSE5 a screen would pop up to ask if I wanted the Editor or the Organizer. If I chose the Editor and later needed my organizer, I could click on the PSE5 icon and the same choice screen would come up.
    When I opened PSE6 on our new mac (yes, I'm a mac newbie) it automatically opened the Editor and I cannot find how to launch the organizer. when I click on the PSE6 icon again it just takes me right back to my open Editor.
    Any help on how to launch my organizer would be greatly appreciated!

    I have to say that gives me a sick feeling in my stomach! I use PSE for digital scrapbooking and have all my backgrounds and embellishments categorized by color and element type (thousands of them). I really thought I'd be able to import my catalog.
    Thank you for your help - at least I can end my search for the organizer.

  • Left my phone in the movie theatre..what do I do? how do i contact location services?

    I just left my phone in the movies...and now they are closed!  how do I contact location services to make sure it is still there?

    If you were running iOS 5 or higher, had enabled iCloud and Find My iPhone before losing it, you can go to icloud.com on your computer and try to locate it as outlined here: http://help.apple.com/icloud/#mmfc0f2442.  If it's turned on, still has Find My iPhone enabled, and has a connection to the internet, it should appear on the map.
    If you didn't enable Find My iPhone before losing it you won't be able to locate it.

  • How do i use location service to ind my iphone?

    how do i use location service to find my lost iphone?

    Silica Gel usually comes in a porous bag within a perforated box. Put the bag and the phone in a ziplock bag together. If you buy loose silica gel just put it in the plastic bag, then put the phone on top of it. Try not to get the grains of silica gel in the openings on the phone, as it will be hard to get out.

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • How can I re-locate an audio track?

    I moved the audio track that I'm using from iTunes so it shows a yellow hazard triangle within my iMovies project. I have moved the audio clip back to where it was in iTunes but iMovie can't find it, and I can't find an option to re-locate the clip. How do I re-locate?
    I could just drag the audio back in and delete the original, but it had lots of editing already with volume and cutting bits out here and there that I don't want to have to repeat if possible.

    If you hover your cursor over the yellow triangle, it may give you the path it is looking for.

  • "how to use Query include one month "

    Hi all expert,
    How to make a request how to add table "QTYSALES one month yesterday"
    so that I can compare with this month.
    Query me this:
    SET ARITHABORT OFF
    SET ANSI_WARNINGS OFF
    SELECT T0.ItemCode, T0.Dscription,T1.OnHand, convert(varchar,SUM(T0.BaseQty*T1.NumInSale)) AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,convert (varchar,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END)))AS 'TURN OVER IN MONTH'
    ,round(convert (varchar,(t1.onhand/(SUM(T0.BaseQtyT1.NumInSale)/DAY(GetDate()) Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END))),4)* 30 AS 'Turn Over Days'
    FROM DBO.INV1 T0 INNER JOIN DBO.OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())
    GROUP BY T0.ItemCode,T0.Dscription,T1.OnHand
    union
    SELECT T1.ItemCode, T1.itemname,T1.OnHand, '' AS 'Qty Sales',DAY(GetDate()) as 'Days',
    Case WHEN Month(GetDate()) in (1,3,5,7,8,10,12) THEN 31 WHEN Month(GetDate()) in (2,4,6,9,11) THEN 30 ELSE 28 END AS 'Total days'
    ,'No Sales' AS 'TURN OVER IN MONTH'
    ,NULL
    FROM DBO.OITM T1
    WHERE T1.ITEMCODE NOT IN (SELECT ISNULL(ITEMCODE,0) FROM INV1)
    GROUP BY T1.ItemCode,T1.itemname,T1.OnHand
    ORDER BY 1
    thanks for all
    Edited by: rachelhel on May 20, 2009 8:06 AM

    haiiii allll pls help...thankss
    Hi consulatant B1
    How to use Query
    My goal is to create a table to see * The number of sales in a month yesterday *
    I want to make a request showing the amount of sales at the end of the month.
    For example this month is on May 25, so I want to show the Quantity of one month April 25
    I have tried several times, but still just wrong.
    I need expert help to solve the problem for me.
    thanks

  • How can I re-locate the 'Title' box on the first slide of my slideshow??

    how can I re-locate the 'Title' box on the first slide of my slideshow??

    You can't.  It's not a user controllable feature.
    OT

  • I moved iTunes folder location, now all my personal song ratings and playlists are gone.  How can I get them back?  All the iTunes files are intact, just in a new location.  Running iTunes 11.1.5.5

    I moved iTunes folder location, now all my personal song ratings and playlists are gone.  How can I get them back?  All the iTunes files are intact, just in a new location.  Running iTunes 11.1.5.5 on Windows 7

    Put everything back the way it was.
    Them move the folder correctly.
    http://support.apple.com/kb/ht1364

  • How can I query all the members of a group using querbuilder?  I cannot find any related properties

    How can I query all the members of a group using querbuilder?  I cannot find any related properties describing members under /home/groups/s/sample_group in jcr repository.

    Hi,
    FieldPoint Explorer is no longer used to configure FieldPoint systems. However, I do not think that the configuring your system in FieldPoint Explorer is causing the error.
    FieldPoint systems are now setup in Measurement and Automation Explorer (MAX).  Information on setting up FieldPoint systems in MAX can be found in the MAX help under: Installed Products>> FieldPoint. Also, I recommend upgrading to the latest FieldPoint driver and version of MAX.  The FieldPoint VI's will be slightly different when you upgrade, so there is a good chance that this will eliminate the error.
    Regards,
    Hal L.

Maybe you are looking for

  • How do I get color management options in PSE9?

    I have been trying to print pictures on an HP printer and when I do they come out fairly red and pink.  When I go under more options under printing and select color management the only option that I have to adjust is print space.  I have a PSE9 book

  • SAP installation hangs while installation EHP4 ready on Solaris-Oracle

    Hi, I am in a process of installing EHP4 READY on Solaris , with ORacle database. at 13 Phase CREATE DATABASE, the installation hangs up when i check the log    ora_sql_results.log  it says    SP2-0310: unable to open file "ora_scr_tmp.sql" not getti

  • Can I move a French iPhone to US AT&T?

    My girlfriend lives in France. If I buy her an iPhone and she uses it on their Orange network, when she moves to the US can she change out the SIM card and subscribe to the AT&T network?

  • [xfce4] network-manager-applet not asking for Wifi password

    I am running XFCE with  the gnome network-manager-applet and kwallet as password storage and I do not want to use the gnome keyring because it is making many problems with my current setup. There are multiple ways to store passwords in NetworkManager

  • Regarding interface in the ABAP-HR

    Hi Experts,          Iam new to ABAP-HR,          I have 2 custom table which are updated with OT records from one batch program.          Now i have to generate two files for regular OT data file and Off-Cycle OT data file respectually. What i have