How to Add an SQL script to another existing SQL script

I have just created an SQL script and i need a way to join it with several other existing SQL scripts.
I don't want to change any of the other scipts, i just need to add my new script on to the existing ones.
I've looked at some of the functions and they don't seem to work for me.
Let me use this as an example.
Here is my new script:
SELECT DISTINCT max(case when EC.EQUIPMENT_CLASS like '%_ERT' then 'Y' else 'N' end) over (partition by E.CURRENT_SERVICE_ID) as ERT
FROM EQUIPMENT E,
EQUIPMENT_TYPE ET,
EQUIPMENT_CLASS EC
WHERE E.EQUIPMENT_TYPE_ID = ET.EQUIPMENT_TYPE_ID
and EC.EQUIPMENT_CLASS = ET.EQUIPMENT_CLASS
and E.CURRENT_SERVICE_ID = 38514
I need to add this to an existing script such as this:
SELECT E.EQUIPMENT_NUMBER,
E.EQUIPMENT_TYPE_ID,
ET.EQUIPMENT_TYPE_DESC
FROM EQUIPMENT E,
EQUIPMENT_CATEGORY ECAT,
EQUIPMENT_TYPE ET,
EQUIPMENT_CLASS EC
WHERE ET.EQUIPMENT_TYPE_ID = E.EQUIPMENT_TYPE_ID
and EC.EQUIPMENT_CLASS = ET.EQUIPMENT_CLASS
and EC.EQUIPMENT_CATEGORY = ECAT.EQUIPMENT_CATEGORY
and E.EQUIPMENT_ID = 113950
* The Reason why i can't just add the line i need together with the existing script, is because it's giving me invalid data from what i want to see. When i run them separately i get the desired results.
Not sure if anything can be done like this or not, but if so, i'd appreciate a shove in the right direction.
thanks

I have just created an SQL script and i need a way to
join it with several other existing SQL scripts.
Do you simply want to append your newly created query to the file that contains an existing query ?
>
I've looked at some of the functions and they don't
seem to work for me.
Not sure how this is a SQL or PL/SQL related question, you'd probably want to just append the files using a text editor or maybe an OS command like cat or type.
>
* The Reason why i can't just add the line i need
together with the existing script, is because it's
giving me invalid data from what i want to see. When
i run them separately i get the desired results.
You may want to explain how the data is different from what you are expecting. In any case, your queries do not end with the sql terminator - the ";" character or a forward slash "/" at the first column of a line after the query; maybe that's the culprit.
Consider this:
SQL>
SQL> host type c:\t1.sql
select first_name from employees where rownum = 1
SQL>
SQL> @c:\t1.sql
  2  /
FIRST_NAME
Ellen
SQL>
SQL> host type c:\t2.sql
select last_name from employees where rownum = 1
SQL> @c:\t2.sql
  2  /
LAST_NAME
Abel
SQL>
SQL> host type t3.sql
select first_name from employees where rownum = 1
select last_name from employees where rownum = 1
SQL> -- now, t3.sql contains both the queries of t1.sql and t2.sql
SQL> -- however, they do not end with the sql terminators
SQL>
SQL> @c:\t3.sql
  2  /
LAST_NAME
Abel
SQL> -- the first query was not executed...
SQL>
SQL> -- t3.sql has been fixed now
SQL> host type t3.sql
select first_name from employees where rownum = 1;
select last_name from employees where rownum = 1;
SQL> @c:\t3.sql
FIRST_NAME
Ellen
LAST_NAME
Abel
SQL>pratz

Similar Messages

  • How to add a phone number to an existing contact o...

    Hi all,
    Should be simple but apparently it is not: how to add a phone number to an existing contact on the E71 ?
    I can not believe Nokia made a mess out of such a simple, basic function!
    dovale 

    I just want to add another telephone number to an existing contact. I don't want to Add detail, Edit label, etc., just to add another telephone number! Simple.
    Apparently  the solution is this:
    On main screen write any number 0123456789 >> Press >> Option >> Save to Contacts >> Update Existing (Scroll or name your last saved contact or where you wanted to add new number) then save! 
    It is an amazingly anti intuitive and convoluted solution but I'm afraid that the entire UI of S60 3rd addition is one big UI mess!
    dovale 

  • How to add the library of linphone into existing project ?

    How to add the library of linphone into existing project ?

    How to add the library of linphone into existing project ?

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • How to add an unique column to an existing table?

    How to add an unique column to an existing table?
    I have a large table which has no unique constraint. and I want to add an unique column for it. How to do it?
    Does adding a sequence is a good choice? How to do it?
    Thank you

    Hi,
    alter table tablename
    add constraint contraint_name unique (columnname);but before that you need to check in the table.column there is no duplicate record exist.
    Does adding a sequence is a good choice?
    Your talking about unique constraint then yes.
    Regards,
    Taj

  • How to add one more field to an exist internal table

    hi abapers
    i am a very new abap programmer and just started learning it.
    i want to know How to add one more field to an exist internal table.
    lemme me put my question in a very simple way.
    i have a internal table having fields f1,f2,f3 and which also that internal also contains some data.
    now i want to add two more fields (mm & nn) to that internal table now.
    how can i do that.
    and i wanna know the websites names where i can find some brain teasing questions in abap programming.
    eagerly waiting for ur reply
    regards,
    Maqsood A Khan

    Hi, MAQSOOD.
    You can insert more fields in your internal table like this.
    refer this code snippet.
    DATA : BEGIN OF tbl_itab OCCURS 0.
            INCLUDE STRUCTURE zsdtc009.
    DATA :  vkorg   LIKE vbak-vkorg,  "inserted one
            vtweg   LIKE vbak-vtweg,  "inserted one
            vkbur   LIKE vbak-vkbur,  "inserted one
            vkgrp   LIKE vbak-vkgrp,  "inserted one
           END OF tbl_itab.
    you can also read the book "Teach yourself abap in 21 days"
    at http://cma.zdnet.com/book/abap/
    but that book is just about basic concept of abap and report program.
    it doesn't give a lecture for on-line program.
    you can get pdf version books(about abap, sap...things) from sap.
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    I wish I could help you.
    Regards
    Kyung Woo.

  • How to add a rescue email to an existing apple ID ?

    how to add a rescue email to an existing apple ID ?

    Click here for information. If you can't add one through the method described in that article(it requires correctly answering two of the questions), contact the iTunes Store staff via the link in the 'Additional Information' section.
    (104616)

  • How to add the new dep area in existing cod

    Dear all,
    how to add the new dep area in existing cod we are planing to implement the IFRS by using leading ledger and non leading ledger present we are using OL leading ledger
    present we are using dep area 01 ,15
    how to achive the parallel accounting in asset accounting how to add new dep area 30 in existing COD
    if any document plz refer me  

    Hi Bhayyapu,
    Please refer to the links given below.
    New Depreciation area
    Adding a New Depreciation Area to Existing Assets - Financial Accounting (FI) - SAP Library
    Hope this will help you.
    Regards
    Eugene

  • How to Add Shopping Cart items to an existing PO

    hai friends
    how to Add Shopping Cart items to an existing PO
    Regards
    Emil

    Hi,
    go to the Manage PurchaseOrder
    (BBP_POC) transaction.
    Then, I enter the "Item data" tab and I go to add shopping cart item part and click on "Start Search".
    I select one item in a shopping cart appearing in the screen and press "Add to Purchase Order" button.
    BR,
    Disha.
    Do reward points for useful answers.

  • How to add a new filter in an existing web service method (BIWS - WEBI document)

    Hello Experts, we have 7 web service query's connected to a dashboard. Basically it is one WSDL URL and 7 Get Methods...Web service queries are BIWS (via WEBI document instance). There are filters setup for each of these web service methods.
    Recently there was a request to add 2 new fields to the webi document and also the 2 fields need to be included as filters in the 7 methods. I know there is an option to edit the method, but when i edit the method, i cannot find the 2 new fields in list to set as filters.Can anybody help me understand how to add filters to an existiing web service method? I do not want to delete the method and republish the block as web service.
    Any help will be great and points rewarded.
    Thank you
    Ann

    Hi Ann,
    The reason you are not able to see any of the new columns as a option to select in your web service block is because when you have published that block, they were not present. Add these two new objects in your block and publish it again. You will be prompted for duplication content. Select the highlighted block for duplicate and now you can see the new added objects in the filter option. Update and this will overwrite your published block. Please note, web services do appear to behave weirdly when used with dashboards so I request you to please try it in a separate test report first.
    Hope that helps.
    Regards,
    Tanisha

  • How to add a new field to an existing Generic Search result list?

    Good day,
    I'm new to the concepts of the Generic Search Framework.  I'm attempting to add a new field to an existing result list, and have that new field restricted to a value of "C".  This new field will not be displayed, it is only used to ensure that Invoice Documents with a DocStatus of "C" are returned to the B2B Application.
    From the *modification\generic-searchbackend-config.xml file, the existing
    <h4><property-group name="billing_resultlist_B2B_R3">
      <property name="BILLINGDOC" columnTitle="sbt.sbs.genericsearch.billing.invoice.title" parameterType="rowkey" hyperlink="b2b/documentstatusdetailprepare.do" linkParamClass="com.sap.isa.ui.uiclass.genericsearch.GenericSearchUIDynamicContent" linkParamMethod="buildAttributesForBillingDocumentDetails" linkTargetFrameName="form_input" />
      <property name="BILL_DATE" type="date" columnTitle="status.sales.date" writeUnderProperty="BILLINGDOC" defaultSortSequence="DESCENDING" />
      <property name="NET_VALUE" type="number" columnTitle="status.billing.detail.netvalue" fieldOutputHandlerClass="com.sap.isa.ui.uiclass.genericsearch.GenericSearchUIDynamicContent" fieldOutputHandlerMethod="buildBillingNetValue" cssClassName="amount" />
      <property name="CURRENCY" type="hidden" />
      <property name="PAYER" columnTitle="gs.hd.gl.partner" linkParamClass="com.sap.isa.ui.uiclass.genericsearch.GenericSearchUIDynamicContent" linkParamMethod="buildShowPartnerLinkSales" />
      <property name="PAYERS_GUID" type="hidden" />
      <property name="SD_DOC_CAT" type="hidden" />
      <property name="OBJECTS_ORIGIN" type="hidden" />
    </property-group>
    </h4>
    I'm trying to better understand how the R/3 tables and columns are specified in the Generic Search Framework.  I know that the R/3 table and field is: VBRK.RFBSK, but in the configuration XML files, I never see this exact information specified.   How it is specified to be a part of the result set?
    After reading the section in the Development and Extension Guide, I also learned about the "allowedValue" definition, and I believe that I will use that to specify the "C" value for the Invoice Document Status field.
    I would greatly appreciate any help.
    Thanks,
    _kevin

    Hi Kevin,
    this means you are working in this section of the generic-searchbackend-config.xml
                 <property-group name="SearchCriteria_B2B_Billing"
                                 useSearchRequestMemory="true">
    Below this property
                    <property name="IRT_BDH_BILL_TYPE"                    
                              type="box"
                              entityType="BEART_BILL_TYPE"
                              tokenType="EXP"
                              requestParameterName="rc_documenttypes"
                              label="gs.att.lbl.doc.type"
                              UIJScriptOnChange="GSloadNewPageR3(this);">
                        <allowedValue value="ORDER"           description="b2b.status.shuffler.key1val2"/>                   
                        <allowedValue value="QUOTATION"       description="b2b.status.shuffler.key1val1" />
                        <allowedValue value="INQUIRY"         description="b2b.status.shuffler.key1val11" />
                        <allowedValue value="ORDERTMP"         description="b2b.status.shuffler.key1val3" />
                        <allowedValue value="CONTRACT"        description="b2b.status.shuffler.key1val4" />
                        <allowedValue value="INVOICE"         description="b2b.status.shuffler.key1val5"  default="true"/>
                        <allowedValue value="CREDITMEMO"      description="b2b.status.shuffler.key1val6" /> 
                        <allowedValue value="DOWNPAYMENT"     description="b2b.status.shuffler.key1val7" />
                        <allowedValue value="AUCTION"         description="b2b.status.shuffler.key1val9" />
                    </property>
    please try adding this new property
                    <property name="DOCUMENT_STATUS(1)"
                              entityType="CL_CRM_REPORT_SET_STATUS"
                              tokenType="RAN"
                              type="hidden"
                              requestParameterName="rc_status_head1" value="C" />
    This should do the trick. Unfortunately, I don't have a E-Commerce scenario with an ERP backend for testing purposes available to you have to test it yourself. Keep me updated with the test results !      
    Philipp Koock
    SAP CRM Web Channel Consultant
    http://www.koock.net

  • How to add a footer row to an existing table?

    The LiveCycle on-line help is pretty cryptic on this one . . . .
    I have an existing table in a form in which the designer (me) left off a footer row by mistake. In lieu of deleting the table and rebuilding it using the Table Assistant, is there a way to add a footer row to the existing table? The on-line help seems to indicate that it's possible, but offers little in the way of instruction on how to do it.
    Thanks in advance!
    Bill

    Hi Bill,
    in your hierarchy view of your table,
    selsct the body row of your tabke and
    right-click and select 'Insert'.
    Then select 'Rows below'.
    You will see a new row beneath your original body row.
    Select your new row, and in your Object tab, select 'Footer Row' under type.
    Now, under the Pagination tab select wether you want to see the footer row on every page or just the last page.
    Good Luck!
    Zoe

  • HT1296 how to add new photos without deleting the existing photos in ipad

    Hi,
    Can anyone tell me how to add new photos/PDF books from my PC to iPad without deleting the exsting data in iPad?

    Hello AJ2349
    If it is prompting you that it will replace the data on your iPhone, then that is typically the result of syncing with a different computer. The only way you can bypass that is to replace the media on your device and then sync. Now it will only replace items that would be considered purchased items like music, movies, TV shows and Apps and would not delete any pictures from your iPhone. Alternatively you can setup a Shared Photo Stream and then add the Photos there without syncing your iPhone with your computer. Check out the articles below for more information.
    iOS: Issues syncing content with multiple computers using iTunes
    http://support.apple.com/kb/ts1474
    Managing content manually on iPhone, iPad, and iPod
    http://support.apple.com/kb/ht1535
    iCloud: Shared Photo Streams FAQ
    http://support.apple.com/kb/HT5903
    Regards,
    -Norm G.

  • How to add new price break lines to existing PO quotations?

    Hi,
    I am using a custom interface (to insert quotations data into PO headers/lines interface tables) and PO documents open interface to create PO Quotations in Oracle.
    I need to modify this interface to:
    1. Update existing price break lines for a quotation line.
    2. Add new price break lines to existing quotation line(which may/may not have exsiting price break lines).
    Please let me know:
    1. What modifications need to be done to the existing code.
    2. What values needs to be passed to the action columns in PO_HEADERS_INTERFACE and PO_LINES_INTERFACE for above scenarios?
    Any ideas/help will be appreciated.
    Thanks
    Imran

    Hi Imran,
    I have done a similar exercise for BPA price breakup.. Let me know if you need that as reference. I can share that :).. Please provide your personal mail id..
    Regards,
    S.P DASH

  • How to add a new pin to an existing subvi

    Hi,
    I've been using Labview for sometime now but I still haven't found a convenient way to add a new pin to an existing subvi other than opening up the subvi and adding a control or whatever and then highlighting the code and using create subvi. Then naming this new subvi with the name of the old one. There must be a better way than doing this ??
    Thanks.
    John

    Hi John,
    I think you want to have a new connector where you can wire to.
    Open the VI, create the control or indicator on the front panel and then make a right click on the icon. Choose show connector pane. Your mouse cursor changes to the wire cursor. Click in the pane on a free connector and then click on the new control/indicator. This way the control/indicator is assoicated with the connector on the connector pane. Keep the rule controls left indicators right side. If there is no more connector left you can choose a new pane.
    Normally we use only a limited set of panes for all subVIs to avoid benches in the wires. Most we use the pane with 4 connectors left and 4 connectors right.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

Maybe you are looking for

  • I would like to add skype on my 2g ipod touch.  It says I have to have a 4.3 iOS.  How do I get that?

    I would like to add skype on my 2g ipod touch.  It says I have to have a 4.3 iOS.  How do I get that?

  • How can one resize a cell editor when in use in a JTree?

    It is possible to resize, for example, a JTextArea cell editor while it is being used in a JTable by having a document listener check the preferred height and then changing the rowHeight of the table to fit that. This gives the nice effect of the tab

  • CSS trouble (disk full without useful file)

    Hi all, i've got problem with CSS 11150 SW Version: 5.00 Build 63, so i can try to upgrade OS of CSS but after 3 timeout in uploading the disk was full with a part of the OS (i've tried 3 times...). SO now i have not idea about how can i clean the di

  • I have no apple store in my country

    Hello my macbook doesnt want to start since yesterday. I already had the probleme a month ago and i brought the machine to an apple store. But I'm actually in senegal and there is no apple store in my country. What can I do ?

  • Previous persons data on download

    Hi, We have an inquiry screen where you can list the research output of a person and download the data to excel. For some reason the 'download to excel' link on the report grabs the previous persons data instead of the current query - but I can't see