How do you incorporate a .SQL file in another script?

I have a SELECT statement in a file that cannot be altered and must be run as it is sent to me. I am creating another table using this SELECT statement. I just want to run my own script which gets part of its content from the one sent me. That way, if the - you might call it 'sub script' changes, I won't have to change anything. It goes something like the following, though this is greatly changed and simplified.
But I want to read everything in the block from a separate file rather than have it copied and pasted every time as it is now. Thank you.
select e.emp_ID
,e.data1
,e.data2,
from empdata e
     BEGINNING OF THE MAIN REPORT (this is pasted
from other suq-query at the present moment)
select distinct w.emp_ID, w.empwages
from wages w
     END OF THE MAIN QUERY
) main
WHERE
main.wages > 40

Another way to read OS file data in SQL is using External Tables.
Random example (there are more in the documentation):
CREATE TABLE test_external
( id   NUMBER(8)
, col1 VARCHAR2(20) )
ORGANIZATION EXTERNAL
( TYPE oracle_loader
  DEFAULT DIRECTORY william_data
  ACCESS PARAMETERS
  ( RECORDS DELIMITED BY newline
    LOGFILE 'test_external.log'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    ( id
    , col1 )
  LOCATION ('test_ext2.dat','test_ext1.dat')
);The OS file directory is specified indirectly. Rather than putting '/somewhere/data' in the table creation command, you create a directory object using
CREATE DIRECTORY william_data AS '/somewhere/data';Notice you can specify more than one data filename (you'll probably only need one). You can also change this attribute with ALTER TABLE.
Notice the line "TYPE oracle_loader" - the ORACLE_LOADER access driver is documented here (there is also an "ORACLE_DATAPUMP", which you don't want).
Once set up, you just query the table and it reads the file.

Similar Messages

  • How do you open a DVD/file in another search engine

    how do you open a DVD/file in another search engine?

    Hi
    I think it is simpler than that: place DVD in computer and then try to run a video from the disk. It will not run using Safari, but I know it runs in Firefox which I have on the computer.
    I believe that I can depress one of the moifier keys while clicking an item on the application menu bar to open a menu where you can open the dvd using Firefox or another application.
    Should be simple, but yet to find solution.

  • How do you call two actionscript files in another as3

    My problem is that i what to call two actionscript files in another one, but cant do it.
    This is are the two codes i want to play at the same time in my scene:
    Code 1
    * Inventory System Manager
    * DATE: 07/24/2010
    * AS3
    * UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
    package 
        import flash.display.Sprite;
        import com.freeactionscript.inventorySystem.InventorySystem;
        public class Main extends Sprite
            private var _inventorySystem:InventorySystem;
            public function Main()
                //InventorySystem(reference to stage in the fla)
                _inventorySystem = new InventorySystem(this);
    Code 2
    * Player Movement - 8-way keyboard
    * VERSION: 1.0
    * DATE: 9/23/2010
    * AS3
    * UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
    package 
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.KeyboardEvent;
        import flash.ui.Keyboard;
        public class Main extends MovieClip
            // player
            private var _player:MovieClip;
            // player settings
            private var _playerSpeed:Number = 4;
            // movement flags
            private var _movingUp:Boolean = false;
            private var _movingDown:Boolean = false;
            private var _movingLeft:Boolean = false;
            private var _movingRight:Boolean = false;
             * Constructor
            public function Main()
                createPlayer();
                // add listeners
                stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);           
                stage.addEventListener(KeyboardEvent.KEY_DOWN, myOnPress);
                stage.addEventListener(KeyboardEvent.KEY_UP, myOnRelease);
             * Creates player
            private function createPlayer():void
                _player = new Player();
                _player.x = stage.stageWidth / 2;
                _player.y = stage.stageHeight / 2;
                stage.addChild(_player);
             * EnterFrame Handlers
            private function enterFrameHandler(event:Event):void
                // Move up, down, left, or right
                if ( _movingLeft && !_movingRight )
                    _player.x -= _playerSpeed;
                    _player.rotation = 270;
                if ( _movingRight && !_movingLeft )
                    _player.x += _playerSpeed;
                    _player.rotation = 90;
                if ( _movingUp && !_movingDown )
                    _player.y -= _playerSpeed;
                    _player.rotation = 0;
                if ( _movingDown && !_movingUp )
                    _player.y += _playerSpeed;
                    _player.rotation = 180;
                // Move diagonally
                if ( _movingLeft && _movingUp && !_movingRight && !_movingDown )
                    _player.rotation = 315;
                if ( _movingRight && _movingUp && !_movingLeft && !_movingDown )
                    _player.rotation = 45;
                if ( _movingLeft && _movingDown && !_movingRight && !_movingUp )
                    _player.rotation = 225;
                if ( _movingRight && _movingDown && !_movingLeft && !_movingUp )
                    _player.rotation = 135;
                //i will do
                if (_player.x > 550)
                    _player.x = 550;
                    _player.x = +_player.x;
                else if (_player.x < 50)
                    _player.x = 50;
                    _player.x = +_player.x;
                if (_player.y > 350)
                    _player.y = 350;
                    _player.y = +_player.y;
                else if (_player.y < 50)
                    _player.y = 50;
                    _player.y = +_player.y;
                trace ("Valor en x: " + _player.x);
                trace ("Valor en y: " + _player.y);
             * Key Press Handlers
            public function myOnPress(event:KeyboardEvent):void
                switch( event.keyCode )
                    case Keyboard.UP:
                        _movingUp = true;
                        break;
                    case Keyboard.DOWN:
                        _movingDown = true;
                        break;
                    case Keyboard.LEFT:
                        _movingLeft = true;
                        break;
                    case Keyboard.RIGHT:
                        _movingRight = true;
                        break;
             * Key Release Handlers
            public function myOnRelease(event:KeyboardEvent):void
                switch( event.keyCode )
                    case Keyboard.UP:
                        _movingUp = false;
                        break;
                    case Keyboard.DOWN:
                        _movingDown = false;
                        break;
                    case Keyboard.LEFT:
                        _movingLeft = false;
                        break;
                    case Keyboard.RIGHT:
                        _movingRight = false;
                        break;
    Hope you help me =)

    You need to have a reference to an instance of one class in the other class or the other way round in order to communicate between the two. Alternatively you can call a static function of one class from an instance of the other class.
    Anyway, I suggest reading about object-oriented programming first (can be even a Java book) to understand how things work. Such basics really help and it's never shame to read it.
    Good luck

  • Novice: How do you manually "move" one file above another file

    Hi,
    Sorry if this a FAQ, I'm an iTunes novice.
    I have a series of MP3s that need to stay/be played in sequence. Changing/renaming them will be a royal pain.
    The filenames are numeric, e.g.:
    1009x09
    1009x10
    1011x11
    The problem I have as I'm "Importing" them from the original MP3 CDs is that the file named "1010x10" keeps getting appended to the bottom of the list, rather than staying in sequence. This (so far) is the only file this is happening to.
    How can I "force it/move it" to stay in sequence?
    Thanks,
    Mike

    First, put them in a playlist.
    Make sure there is a little triangle in the space at the top of the number column. If not, click that spot to get the triangle.
    Now just grab any track you want and move it (by click and drag) up or down to where you want.

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • How can you tell if a file is being used in your project or not?

    How can you tell if a file in your bin is being used in your project or not? My director dragged hundreds of reference files into my project and only used a few of them. I'd like to do some house cleaning and delete the ones that are not in use. This project file has 100 sequences in it, so it would be a tough manual hunt to figure this out.
    In Premiere Pro (or Flash for example), where all the information is in the Project Bin such as in/out times and duration, there is where it tells you how many times that piece of media has been used or if it hasn't been used yet.
    Can FCP tell me this info?
    Thanks for yout time!
    -Monty

    Monty,
    Within FCP, there is a menu item called "Media Manager" (depending on what version you are in). This would be worth your while to look into. It basically organizes your project by moving/archiving any used assets of a project and leaving out un-used assets. It saves a ton of disk space.
    For example, say you have a 5 minute clip with an in/out point that is just 30 seconds. Media Manager will "archive" just that 30 seconds, not the entire clip. There is even a setting that you can add additional "handles" time to the front andd back of the clip if you think you may need to add or change transition.
    Do a google search. I was just watching a few Youtube videos on this myself.
    Jonathan

  • How do you convert a jpeg file into word document so i can edit it?

    How do you convert a jpeg file into word document so i can edit it?

    http://office.microsoft.com/en-us/mac-word-help/training-edit-pictures-in-office -for-mac-2011-RZ103709558.aspx

  • How do you create a jar file in JDeveloper 11.1.2.0.0

    How do you create a jar file in JDeveloper 11.1.2.0.0

    1) Select the project for which you would like to generate the jar.
    2) Right Click the selected right and select 'Project Properties'
    3) Select the 'Deployment' in the left tab.
    4) Click on 'New' to create a new deployment profile and in the popup dialog, select 'Jar File' profile type and provide the name.
    5) Press 'ok' to save the changes.
    6) Select the project and right click and select 'Deploy to' and select the jar profile name you have specified.
    The Jar library is generated and the full path to the library jar is shown in the log window.
    Thanks,
    Navaneeth

  • How do you open Illustrator CS6 files in CS5

    how do you open Illustrator CS6 files in CS5

    Hi codfather33,
    Please downsave your Ai file from AICS6 to Illustrator CS5 version and then open this file in AICS5. This would ensure that any content is not dropped or expanded unwantedly.
    Thanks,
    Dhirendra

  • How do you load exs. format files into EXS 24 sampler?

    How do you load EXS24 format files into the EXS24 sampler? the only format I can load directly is aiff and wav. can't find any posts addressing this question? please help

    You don't load them in, you need to put them in:
    *System/users/your user name/library/application support/logic/Sampler instruments*
    Restart Logic if it's running, they will then appear in the EXS library.

  • How do you open a cs7 file in indesign cc?

    How do you open a cs7 file in indesign cc?

    When you say InDesign CC, doo you mean the InDesign CC release from this year, or are you still using InDesign CS6 through a cloud subscription? There are a lot of users confused by this.
    If you have CS6 through a subscription you are entitield to the new version for free and should go to creative.adobe.com and download the newest version of the Creative Cloud Desktop Application and get the new versions of the applictions you use.

  • How do you change a Photographs file name on a iMac?

    How do you change a photographs file name on a iMac?

    Same way as you change the name of any file: click on the file once to highlight it, change the name, click return.

  • How do you fix a movie file so Apple doesn't consider it a podcast anymore?

    How do you fix a movie file so Apple doesn't consider it a podcast anymore?

    Try right clicking on the Podcast / Get Info / Options / Media Kind: Change to Movie

  • How do you convert a jar file into a java file,  ?

    how do you convert a jar file into a java file ?
    I am new to Java ,but have a little experience in C++ and Visual Basic.
    I want to edit and maybe create my own mobile games that are written or converted into jar files.
    At the moment I am using Java NetBeans , and Easy Java( the java pad).
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?

    801283 wrote:
    how do you convert a jar file into a java file ?You generally don't. There exist decompilers, but if you're meant to have the source, you should either have it because you are the author, or you should be able to get it from the author.
    I am new to Java ,but have a little experience in C++ and Visual Basic.Does that experience include turning .exe files into C++ code? Because that's the equivalent of what you're asking
    I want to edit and maybe create my own mobile games that are written or converted into jar files.Eh?
    Are you saying you want to take existing games and modify them? If the creators allow you to modify their source, then they'll provide you with that source (the .java files). If you're allowed to add things but not modify, you don't need .java files. Just documentation, which, again, the creators should be providing.
    Or are you saying you want to create your own games and distribute them in jar files? If so, there's no need to turn jars into .java.
    However the only solution I tried was to open the JAR file in winrar and see that its made up of png picture files,
    midi music files and class files. Unfortunately when I uncompressed the JAR file , there was NO java file to be seen and the JAVA editors Do not show the class file like a Java file. So why is there no extension Java file in the mobile JAR game ?Why would you expect there to be one?

  • HT3825 so how do you convert the raw files to jpeg in iphoto?

    how do you convert the raw files to jpeg in iphoto?

    Many thanks Barbara and dj_paige.
    What I didn't mention is that I'm using PSE 5 with ACR 4.6, if its relevant.  I'm thinking of updating to the next version when its out in the hope that it will run with Windows 7 64 bit or I may go to Lightroom.
    I can now see that I can batch convert a whole folder of files using "process multiple files" as dj_paige suggested but that is too many at once as the settings I choose won't be relevant for all the pics in the folder. 
    I was hoping to batch convert say 5 or 6 similar photos at a time with the same settings. I'm not quite clear what you're suggesting but I'm hoping that its a "work round" using two stages to achieve this. 
    I can't see a list of open files within ACR to ensure that they are all selected as you suggest. 
    What does clicking Open rather than Done mean?  Does this amend the original RAW file to the settings selected so that if I then "process multiple files" on the whole folder to convert from RAW to JPEG they will in fact have already been processed in smaller groups so I can convert without applying any further changes?
    If so, what settings should I apply to "process multiple files" to ensure a simple conversion of file type rather than any further adjustments?
    Any further help on this would be much appreciated.
    Andrew

Maybe you are looking for

  • Cannot send email from my college email account

    For some reason, I'm not able to send an email to my professors. I know it's not my account, in general. I'm pretty sure it has to do with the Mac format because I have sent an email from my account on a PC. Does anyone know how I can change my email

  • ITunes eats my computer

    Whenever I access the iTunes store, the homepage loads without a problem. If I try to browse for music, I do not have any problems either. Once I click a link from the browse menu or the homepage, iTunes immediately starts using 100% of my processor

  • I need to upgrade my applications but my e-mail is no longer available. How can I upgrade them using a different e-mail?

    I need to upgrade my applications but my e-mail is no longer avaliable.  How can I change my e-mail?

  • Confirmations - print GR

    Hi experts, I have a MM background but I am new to SRM, so I would appreciate some guindance from you.... I am using SRM 5.0 (extended scenario) and one of the requirements is to print labels when doing a GR confirmation. Is it possible to do it in S

  • I can not download new iTunes. Error message....

    "This iTunes installer is intended for 32-bit versions of Windows. Please download and install the 64-bit iTunes installer instead" But I dont know where to go to download the 64-bit installer...Please help! Thanks, Brandy