Need help with INSERT and WITH clause

I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause"
with t1 as(
select a.budat,a.monat as period,b.vtweg,
c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
c.wrbtr,
c.matnr,
c.menge,
a.monat,
c.zuonr
from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='D'
and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
,t2 as(
select a.BUKRS,a.BELNR, a.GJAHR,t1.vtweg,t1.budat,t1.monat from t1, ldw_v1.bkpf a
where t1.zuonr=a.xblnr and a.blart='WL' and bukrs='8431'
,tcogs as (
select t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
sum(bseg.wrbtr) as COGS,bseg.matnr,bseg.kunnr,sum(bseg.menge) as QUANTITY
from t2, ldw_v1.bseg
where t2.bukrs=bseg.bukrs and t2.belnr=bseg.BELNR and t2.gjahr=bseg.gjahr and BSEG.KOART='S'
group by t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
bseg.matnr,bseg.kunnr
,t3 as
select a.budat,a.monat,b.vtweg,
c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
case when c.shkzg='S' then c.wrbtr*(-1)
else c.wrbtr end as NTS,
c.matnr,c.kunnr,
c.menge*(-1) as Quantity
from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='S'
and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
,trevenue as (
select t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,
sum(t3.NTS) as NTS,t3.matnr,t3.kunnr,sum(t3.QUANTITY) as QUANTITY
from t3
group by t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,t3.matnr,t3.kunnr
select NVL(tr.budat,tc.budat) as budat,
NVL(tr.monat,tc.monat) as monat,
NVL(tr.vtweg,tc.vtweg) as vtweg,
NVL(tr.gjahr, tc.gjahr) as gjahr,
tr.hkont as NTS_hkont,
tc.hkont as COGS_hkont,
NVL(tr.prctr,tc.prctr) as prctr,
NVL(tr.MATNR, tc.MATNR) as matnr,
NVL(tr.kunnr, tc.kunnr) as kunnr,
NVL(tr.Quantity, tc.Quantity) as Quantity,
tr.NTS as NTS,
tc.COGS as COGS
from trevenue TR full outer join tcogs TC
on TR.BUDAT=TC.BUDAT and TR.MONAT=TC.MONAT and TR.GJAHR=TC.GJAHR
and TR.MATNR=TC.MATNR and TR.KUNNR=TC.KUNNR and TR.QUANTITY=TC.QUANTITY
and TR.VTWEG=TC.VTWEG and TR.PRCTR=TC.PRCTR
Edited by: user13566113 on 25.03.2011 5:26

Without seeing what you tried it is hard to say what you did wrong, but this is how it would work
SQL> create table t ( n number );
Table created.
SQL> insert into t
  2  with test_data as
  3    (select 1 x from dual union all
  4     select 2 x from dual union all
  5     select 3 x from dual union all
  6     select 4 x from dual)
  7  select x from test_data;
4 rows created.
SQL>

Similar Messages

  • Need help to insert and update records in MDM

    Hi ,
    I am trying to develop an webdynpro application which can create and update records in tables of a repository of MDM . For example .. I want to insert values and later update values in Vendor table.
    I am new to webdynpro and MDM. If any one can help step by step or can send a sample code which I can be ready to use that would be great help.
    If anyone can have a sample code .. kindly mail to "[email protected]"
    It is urgent. Please help.
    Regards,
    Niraj
    Edited by: Niraj Kumar on May 23, 2008 6:50 AM

    Hi Niraj,
    Are u going to work with webdynpro Java/ABAP?
    some materials which are found useful are sent.
    Cheers,
    Mary

  • Need help to import and syncronize HCM pagelets with Interaction Hub, how can I do that?

    Hi,
    I need help to import and synchronize HCM pagelets with Interaction Hub, how can I do that? The default page "Select Remote Content" of the WorkCenter "Unified Navigation WorkCenter" is not working as well, when I run the import/sync button I get the following error message:
    Integration Gateway: General Connection Failed (158,10836)
    This error is thrown when there is no valid response.
    Possible errors include:
    Bad gateway URL
    Sync Service Timeout set and Service actually timed out.
    Java exception thrown - Check Application Server for possible Java exception

    Do you have integration configured between the two systems?  It sounds like you don't from the error.  Here is a walk-through on setting up Unified Navigation although it assumes you have integration already working.  If you haven't done that, it's documented a hundred different places.
    http://remotepsadmins.com/2013/03/04/peoplesoft-unified-navigation-with-peoplesoft-applicatations-portal-interaction-hub/

  • Need help re-synching iPods with new computer and getting iTunes to...

    Need help re-synching iPods with new computer and getting iTunes to recognize our iPods (it doesn't even recognize them when they're plugged in).
    Hubby wiped my harddrive for me, so now I need to get everything back in proper places. I'm using windows XP and installed iTunes once again (I believe it's version 8). I also installed all of my iTunes songs. Now I need to know where to go from here. We have 3 iPods and I need to get them all synched once again. I know how to create different libraries for each of us, but I can't figure out how to get our songs back into our iTunes libraries. When I open iTunes and plug in an iPod, iTunes doesn't even show that an iPod is plugged in.
    What do I do now to get each of our iPods synched with our own libraries?
    TIA
    Brandy

    Thanks Zevoneer. The "Restart ipod service" worked and itunes is now recognizing my ipod! Hooray!
    Okay, now how do I synch all of our ipods with our individual libraries (I don't want all of my kids' songs and vice versa)? We each have hundreds of songs on our ipods that we don't want to lose.
    Thanks again!

  • I have misplaced my iPod Touch 4th Generation. According to Find my iPhone, it should show up in offline mode. I need help on locating it with a software or some other way. Help?

    I have misplaced my iPod Touch 4th Generation. According to Find my iPhone, it should show up in offline mode. I need help on locating it with a software or some other way. Help?

    There is no other way.
    Sorry

  • Need help on struts configuration with ColdFusion 10 using IIS

    We need help on struts configuration with ColdFusion 10 using IIS.
    Earlier we were using ColdFusion 8 with IIS 6 for one of our application.  This application internally calls struts. After upgrading to ColdFusion 10 struts calls are not loading. We get 404 error.
    In ColdFusion 8 struts were configured using  actions extension .do in IIS from this file-
    C:\ColdFusion8\runtime\lib\wsconfig\jrun_iis6.dll.
    But in ColdFusion 10 this file is not present as ColdFusion 10 uses Tomcat in place of Jrun.
    Also there is no information in ColdFusion log file.

    Duane wrote:
    doctormirabilis, Welcome to the discussion area!
    1) how can i configure the time capsule in order to operate as a remote base station synchronizing with the relay using the ethernet port?
    Configure the Time Capsule to act as a bridge (not distributing IP addresses). Also configure the Time Capsule to create an 802.11n wireless network with a unique network name (SSID). That's it.
    2) how can i avoid that my powerbook while accessing my wireless network does connect through the relay station instead of using the time capsule?
    Configure the Time Capsule to use a different network name than the WDS link between the 2 AirPort Express (AX). Configure the PowerBook to use the Time Capsule network.
    There are 2 pieces of information that you should be aware of...
    (1) None of the PowerBooks are capable of 802.11n.
    (2) The WDS link cuts your available bandwidth in half. So the wireless link to your neighbor's has a maximum potential of 27 Mbps.
    Let's for a minute assume that you have a Mac compatible with 802.11n. In your configuration the time you could take advantage of the 802.11n speed is when the Mac is sending/recieving data directly from/to the Time Capsule.
    There would be NO speed increase in Internet access. The speed of Internet access is going to be controlled by the slowest link in the path to the Internet. That is probably the connection to the ISP. The next slowest path is the WDS link to your neighbor's.
    Duane,
    I am in a similar situation, sharing internet with my neighbor. Do you think it would be plausible to hook up a vonage phone adapter to time capsule's ethernet port if time capsule is bridging from my neighbor's router in the configuration you have described? A check of my upload speed shows 1.67Mbps (powerbookG4 w/ airport extreme). Vonage reccommends 90kbps minimum upload speed. Am I going to lose some speed putting the Vonag adapter behind time capsule?
    Thank you

  • My Ipad on version 6.1.2 , I can not updated to 6.1.3  and I can not restore it as we'll . I have tried with ITunes and with the device it self , please help

    I can not restore my IPad and I can not update it  . I tried with ITunes and with the device as well
    Any help. Please

    It really helps if you describe what is happening, otherwise there is no way to offer meaningful suggestions. Just saying "I can't ..." Doesn't tell us anything helpful.

  • I need help in downloading and installing a previously purchased version of Photoshop Elements 12: AD012822594 1057-0247-4177-3303-6451-8067  or   1057-0904-6949-7119-8323-9165

    I need help in downloading and installing a previously purchased version of Photoshop Elements 12: AD012822594 1057-0247-4177-3303-6451-8067  or   1057-0904-6949-7119-8323-9165

    Please do not share serial numbers  or Order numbers on Forums . Serial numbers and order numbers  are very confidential.
    You can only share serial number with Adobe Customer support staff.

  • Need Help in installations and connecting displays. Please!

    Hello Everyone,
    Need Help in installations and connecting displays. Please!
    Im planning on installing in a cafe shop : (Store Self improvement)
    4 TV's (can be  Built in Wi-Fi) Store menus
    2 touch screen tablets.  To be use as Emenu (digital Menu)
    1 60' TV ( Built in Wi-Fi) as Entrainment displays and in store advertising
    What do I need to organize my project and make it looks cool and how to manageand controll all of the displays TV.

    TNSTAAFL
    I DO NOT work for Best Buy, Geek Squad and any way affiliated with them. I am a self-employed repairman. I specialize in TV's and desktop computers. I do not take sides. If BB is wrong I will say so. If you are a moron with a false sense of entitlement, then I will tell you.

  • Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for

    Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for assistance!

    That's going to be a ridiculous waste of money and energy.
    First of all, the current ATI drivers don't support multiple GPUs, so at the moment even a single 4870X2 would be only a 'normal' 4870 (which is quite a speed beast already). GFX drivers evolve rapidly, so things might look different next month, but when it comes to Linux and hardware there's one Golden Rule: stay away from the newest stuff and wait for proper support to get coded.
    I also wonder what power supply could possibly cope with the differences between idle and full load; that's way beyond 400W. But then, I'm one of those "quiet&green" types where >100W idle is already a bit much.
    I kind of understand that you want to get it done and not worry about hardware for the next 10 years or so, but that's simply not how the hardware world works and never did. At least not for the average consumer.

  • STO with shipping and with billing, in PGI- Error Msgs- VL-608 & VL-609

    Hi..
    I have generated outbound delivery in STO  with shipping and with billing process.
    But, in PGI Quantity not picked and when i click PGI two error msgs came with message class-VL and message numbers 608 and 609.
    VL - 608 - Delivery has not yet been putway/picked (completely)
    VL - 609 - Delivery has not yet been completely processed in WM.
    I think this is related to Warehouse settings.
    Please help me in issuiging goods.
    Thank You.
    Govind.

    your issuing storage location is warehouse managed. hence you need a transport order to move the materials from the stroage bins to the interim storage type 916 for goods issue.
    Such TO is created with LT03 and need to be confirmed with LT12.  Then the status changes to picked. And subsequently you can post goods issue.

  • This is a second try to get help. I need help to uninstall and reinstall Photoshop cc 2014

    Bridge is not working well, I need to reinstall Photoshop cc 2014 .  Someone from Communities was suppose to help me. 

    Hi John,
    I used the chat "Creative chat support"  this afternoon at around 14:40
    and the person, Karthik M , gave me a link to Technical Support.  I
    guess he could not help me, but he said he understood the issue.   With
    the link "Help, Adobe Installation problems",   I will follow the
    instructions  to clean ps cc2014 with CCleaner and reinstall the app.  
    It looks quite complicated  but I will give it a try and hopefully succeed.
    You have to understand when reading my previous messages, the issue is
    no longer "Retreiving Photoshop CC" but reinstalling Phoshop 2014 to try
    to repair Bridge.
    Thanks for caring,
    Suzanne Lanthier
    Le 2014-08-13 15:50, John T Smith a écrit :
    >
          This is a second try to get help. I need help to uninstall and
          reinstall Photoshop cc 2014
    created by John T Smith <https://forums.adobe.com/people/JohnTSmith>
    in /Adobe Creative Cloud/ - View the full discussion
    <https://forums.adobe.com/message/6637788#6637788>

  • Need Help in Inserting first ever record

    I need help in inserting my first ever record from an OAF page.
    I've created an AM 'MasterAM', added 'MasterVO' to it. Created a Page CreatePG which has a submit button, id = Apply
    Below is processRequest of CreateCo
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (!pageContext.isFormSubmission()) {
    am.invokeMethod("createRecord", null);
    and below is processFormRequest
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Apply") != null)
    OAViewObject vo = (OAViewObject)am.findViewObject("MasterVO1");
    am.invokeMethod("apply");
    pageContext.forwardImmediately("OA.jsp?page=/abcd/oracle/apps/per/selfservice/xxdemo/webui/CreatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    Below are 'createRecord' and 'apply' in MasterAMImpl
    public void createRecord(){
    OAViewObject vo = (OAViewObject)getMasterVO1();
    if (!vo.isPreparedForExecution()) {
    vo.executeQuery();
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void apply() {
    getTransaction().commit();
    When I run the page, it opens and I try to enter some data and press Apply. it does not insert into the table.
    Could anyone help me out.
    My jdeveloper version is 10.1.3.3.0.3

    I am facing the same issue.
    rows get inserted into the tbale, but only whol columns have the data.
    all the attributes are correctly mapped to view instance and view attribute.
    My VO has 1 EO and , i have joined another table to get desctriptions of the field.
    could that be the problem ?
    ex :
    select item , desc
    from t , master
    where t.cola=master.colb
    table t is the custom table I want the data to go in. but only who columns appear after commiting.
    any clues ?

  • I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    What file format did you export it to?

  • Now that the photo gallery in MobileMe is ending, is there another photo sharing site to which existing iPhoto albums can be transferred as is, with photos in the same order and with titles, and with minimal problems?

    Now that the photo gallery in MobileMe is ending, is there another photo sharing site to which existing iPhoto albums can be transferred as is, with photos in the same order and with titles, and with minimal problems?

    No. If you don't have the album you originally used to create the galleries you can do so by dragging the photos from each gallery to a new, empty album. Then when you find the photo sharing site/option you have decided on  you can easily upload each album to the site.
    Another option is to obtain a hosting service and create iWeb photo pages for each album and future albums similar to this photo page in one of my demo sites: iPhoto Book as an iWeb Slideshow.  Or you can use the iWeb album page and have an album for each  iPhoto album on it like on this demo page: Page-7 .
    OT

Maybe you are looking for

  • After doing a disk clean-up & defrag firefox crashes when trying to load

    I've gone through the troubleshooting for "crashes when loading" and trying to get firefox to load in safe mode & I've been unsuccessful. I've also made sure all my plug-in's are up to date. I've also un-installed Firefox & re-installed it. I even wa

  • Time Capsule iCloud

    Bonjour, Est-il possible d'accéder à une Time Capsule à partir de iCloud en dehors de son réseau domicile? Merci

  • Current keyboard focus?

    Hypothetical question:  is it possible to programmatically obtain the current keyboard focus point (NOT mouse pointer focus point) & application containing it then invoke that application's context menu at that location? I thought I saw something in

  • Start menu

    Hi All I am starting to get a message saying my start menu is full and cannot process what ever i am doing where do i find the start menu and i presume that if i delete from there whatever is slowing it down then eg photo's they will still be in ipho

  • 2 layers reveal hide using the mouse

    Hi there, Im thinking about making my first thing in Flash. The problem is I have no clue what so ever how to do the following: I have 2 pictures or 2 movies I want to play on top of each other. I want to drag the top movie to right or left to hide o