MERGE question

Can you specify more than one condition in the ON clause? In all the examples I've seen there is only an inner join (a.col1=b.col1)? Just curious.
Matt

The another thing to watch - you are not allowed to change columns referenced in the ON clause .That reminded me on the old bug, which seems to be not corrected still - Oracle does allow such updates by merging into the view, the behaviour was broken somewhere after 9.2.0.6.
-- Setup
SQL> create table t1 (n number,text varchar2(10));
SQL> create table t2 (m number,new_text varchar2(10));
SQL> create view v1 as
  2  select * from t1;
SQL> insert into t1 values (1,'a');
SQL> insert into t1 values (2,'b');
SQL> insert into t1 values (3,'c');
SQL> insert into t2 values (1,'d');
SQL> insert into t2 values (2,'e');
SQL> insert into t2 values (3,'f');
SQL> insert into t2 values (101,'g');
SQL> insert into t2 values (102,'h');
SQL> insert into t2 values (103,'i');
-- 9.2.0.8 (on the 9.2.0.6 merge into view raise an ORA-00904
SQL> merge into t1 a
  2  using t2 b on (n=m)
  3  when matched then update
  4  set n = n + 100,text=new_text
  5  when not matched then
  6  insert values(b.m,b.new_text);
using t2 b on (n=m)
ERROR at line 2:
ORA-00904: "N": invalid identifier
SQL>
SQL> merge into v1 a
  2  using t2 b on (n=m)
  3  when matched then update
  4  set n = n + 100,text=new_text
  5  when not matched then
  6  insert values(b.m,b.new_text);
6 rows merged.
-- On 10.2.0.4 and 11.1.0.6.0
SQL> merge into t1 a
  2  using t2 b on (n=m)
  3  when matched then update
  4  set n = n + 100,text=new_text
  5  when not matched then
  6  insert values(b.m,b.new_text);
using t2 b on (n=m)
ERROR at line 2:
ORA-38104: Columns referenced in the ON Clause cannot be updated: "N"
SQL>
SQL> merge into v1 a
  2  using t2 b on (n=m)
  3  when matched then update
  4  set n = n + 100,text=new_text
  5  when not matched then
  6  insert values(b.m,b.new_text);
6 rows merged.Interestingly, Metalink claims that bug (5891015) to be fixed in 11.0 Base Release.
Best regards
Maxim

Similar Messages

  • [CS5.5/6] - XML / Data Merge questions & Best practice.

    Fellow Countrymen (and women),
    I work as a graphic designer for a large outlet chain retailer which is constantly growing our base of centers.  This growth has brought a workload that used to be manageable with but two people to a never ending sprint with five.  Much of what we do is print, which is not my forte, but is also generally a disorganized, ad-hoc affair into which I am wading to try to help reduce overall strain.
    Upon picking up InDesign I noted the power of the simple Data Merge function and have added it to our repetoire in mass merging data sources.  There are some critical failures I see in this as a tool going forward for our purposes, however:
    1) Data Merge cannot handle information stored and categorized in a singular column well.  As an example we have centers in many cities, and each center has its own list of specific stores.  Data merge cannot handle a single column, or even multiple column list of these stores very easily and has forced us into some manual operations to concatenate the data into one cell and then, using delimiter characters, find and replace hard returns to seperate them.
    2) Data Merge offers no method of alternate alignment of data, or selection by ranges.  That is to say:  I cannot tell Data merge to start at Cell1 in one column, and in another column select say... Cell 42 as the starting point.
    3) Data merge only accepts data organized in a very specific, and generally inflexible pattern.
    These are just a few limitations.
    ON TO MY ACTUAL DILEMMA aka Convert to XML or not?
    Recently my coworker has suggested we move toward using XML as a repository / delivery system that helps us quickly get data from our SQL database into a usable form in InDesign. 
    I've watched some tutorials on Lynda.com and havent yet seen a clear answer to a very simple question:
    "Can XML help to 'merge' large, dynamic, data sets like a list of 200 stores per center over 40 centers based off of a single template file?"
    What I've seen is that I would need to manually duplicate pages, linking the correct XML entry as I go rather than the program generating a set of merged pages like that from Data Merge with very little effort on my part.  Perhaps setting up a master page would allow for easy drag and drop fields for my XML data?
    I'm not an idiot, I'm simply green with this -- and it's kind of scary because I genuinely want us to proceed forward with the most flexible, reliable, trainable and sustainable solution.  A tall order, I know.  Correct me if I'm wrong, but XML is that beast, no?
    Formatting the XML
    Currently I'm afraid our XML feed for our centers isnt formatted correctly with the current format looking as such:
    <BRANDS>
         <BRAND>
              • BrandID = xxxx
              [Brand Name]
              [Description]
              [WebMoniker]
              <CATEGORIES>
                   <CATEGORY>
                        • xmlns = URL
                        • WebMoniker = category_type
              <STORES>
                   <STORE>
                        • StoreID = ID#
                        • CenterID = ID#
    I dont think this is currently usable because if I wanted to create a list of stores from a particular center, that information is stored as an attribute of the <Store> tag, buried deep within the data, making it impossible to 'drag-n-drop'. 
    Not to mention much of the important data is held in attributes rather than text fields which are children of the tag.
    Im thinking of proposing the following organizational layout:
    <CENTERS>
         <CENTER>
         [Center_name]
         [Center_location]
              <CATEGORIES>
                   <CATEGORY>
                        [Category_Type]
                        <BRANDS>
                             <BRAND>
                                  [Brand_name]
    My thought is that if I have the <CENTER> tag then I can simply drag that into a frame and it will auto populate all of the brands by Category (as organized in the XML) for that center into the frame.
    Why is this important?
    This is used on multiple documents in different layout styles, and since our store list is ever changes as leases end or begin, over 40 centers this becomes a big hairy monster.  We want this to be as automated as possible, but I'd settle for a significant amount of dragging and dropping as long as it is simple and straightforward.  I have a high tollerance for druding through code and creating work arounds but my co-workers do not.  This needs to be a system that is repeatable and understandable and needs to be able to function whether I'm here or not -- Mainly because I would like to step away from the responsibility of setting it up every time
    I'd love to hear your raw, unadulterated thoughts on the subject of Data merge and XML usage to accomplish these sorts of tasks.  What are your best practices and how would you / do you accomplish these operations?
    Regards-
    Robert

    From what I've gleaned through watching Lynda tutorials on the subject is that what I'm hoping to do is indeed possible.
    Peter, I dont disagree with you that there is a steep learning curve for me as the instigator / designer of this method for our team, but in terms of my teammates and end-users that will be softened considerably.  Even so I'm used to steep learning curves and the associated frustrations -- but I cope well with new learning and am self taught in many tools and programs.
    Flow based XML structures:
    It seems as though as long as the initial page is set up correctly using imported XML, individual data records that cascade in a logical fashion can be flowed automatically into new pages.  Basically what you do is to create an XML based layout with the dynamic portion you wish to flow in a single frame, apply paragraph styles to the different tags appropriately and then after deleting unused records, reimport the XML with some specific boxes checked (depending on how you wish to proceed).
    From there simply dragging the data root into the frame will cause overset text as it imports all the XML information into the frame.  Assuming that everything is cascaded correctly using auto-flow will cause new pages to be automatically generated with the tags correctly placed in a similar fashion to datamerge -- but far more powerful and flexible. 
    The issue then again comes down to data organization in the XML file.  In order to use this method the data must be organized in the same order in which it will be displayed.  For example if I had a Lastname field, and a Firstname field in that order, I could not call the Firstname first without faulting the document using the flow method.  I could, however, still drag and drop content from each tag into the frame and it would populate correctly regardless of the order of appearance in the XML.
    Honestly either method would be fantastic for our current set of projects, however the flow method may be particularly useful in jobs that would require more than 40 spreads or simple layouts with huge amounts of data to be merged.

  • Data Merge questions

    We are using MS Mail Merge to populate existing forms. We have 250+ different MS Word .docx forms that have different information in different places. We are serving the mail merge data from a database throught a VB.Net program and it's working well. As most probably know, the process is to map mail merge fields onto the form using Word and then populate them through the application based on the form and information the end user needs.
    We want to do the same thing with PDF documents. I've been poking around this site and the internet and am confused about what is available to do this. Data Merge seems to kind of do the same thing, but through files instead of a database. I see some functions in this and other Adobe SDK's, but I'm not clear on which would be the one I'd need. And it would need to be programmable with VB.net.
    Or do I need an aftermarket SDK to do this (hope it's okay to ask that question here)?

    You might want to look into some of the third party catalogue plugins for ID.

  • InDesign Data Merge Question....

    I have a calendar created using the data merge feature within InDesign.  The only question I have thus far is on each day of the week, we currently have a text frame linking to a .txt file that our customers add events to.  How do I link the specific .txt files to the frame?  I cant use the image function in my excel file as it does not reconize it as that.  Is there another way to script/put this in my source file to link and place the text in the .txt files (individual txt files for each day of the year).??  Any help would be appreciated.  Thanks!

    I don't think I really undertand the structure of the data file you have. My sense, though is that this may not really be a data merge project.
    At its heart, Data Merge is is very primitive. It's great for mailing labels, but can get defeated by more complex projects. For the merge to work, all of the data must be structured the same for each record in terms of the number of fields, and the text you want to include needs to be in the fields (as far as I know, you cannot use a pointer to an external text file in a field the same way that you can use a pointer to an image). You have a choice when setting up the merge template, though, of putting the plceholders on the document page or on the master page.
    If you put the placeholders on the master page, the data can be updated AFTER the merge, at least in theory (doesn't seem to work well with images), but it doesn't really sound to me like that's what you need, but it is a possibility if you have a basic documenet and the clients add text later.
    In any case, if you are letting the client add text, you need to add that text directly into your data file, either in Excel and re-export the entire data set, or set up some sort of find/change routine to replace tags in the text file with the text supplied by the client.

  • Library merge question

    I want to export a portion of my library to work on it on a second computer. I want to delete projects, split projects, create new projects, delete pictures, move pictures from one project to another, etc.
    However, when merging this back into the library of the first computer, I read this in the Aperture help:
    "Aperture imports the modified library from the second computer, merging the changes made to the projects and albums on the second computer into the same projects and albums on the first computer. "
    "Into the same projects" is what bothers me. This implies that the second library has to have the same project structure as the first. Is this the case? What if I delete, split, merge projects, move pictures from one to another, etc? Can I only work within the project structure that was exported?

    If you make changes to your exported library you will have the option whether you want to merge or add the library when re-importing it. You can also say which library you want to use to resolve conflicts if any occur when merging.

  • Data Merge Question

    I have to create 130 separate pages that pull all their data from one spreadsheet. They are arranged by colums of data and then have a row identified by the district. I know I could separate the data for each row onto a indiv. sheet but that would take forever, is there a way I can use the column and row identifier to tell it to merge to a new document?

    Like Peter, I'm not sure I'm clear on your objectives, but the last part of your post, accounting for the context that precedes it, makes it sound like you want to merge each record (row) to a new, single-page document.
    You can't do that, but you can merge one record per page, then export the resulting 130-page merged InDesign document to PDF, and use Acrobat's Extract Pages feature to bust it up into 130 single-page PDF's.

  • Mail merge question

    I'm putting together a church directory in Pages. The info (including pictures) is stored in Address Book. Here are my issues:
    1. Can I merge the pictures? I don't immediately see a way to do it, but I'm not as experienced as some.
    2. How can I make the merged document be sorted alphabetically by last name instead of first name? In Address Book, I have everything sorted by last name. Why it's doing this, I don't understand. But it creates a nightmare on for putting the final document together.
    Any help is great. It would make directory maintenance so much easier!

    pharmd wrote:
    I'm putting together a church directory in Pages. The info (including pictures) is stored in Address Book. Here are my issues:
    1. Can I merge the pictures? I don't immediately see a way to do it, but I'm not as experienced as some.
    Not those used in Address Book.
    2. How can I make the merged document be sorted alphabetically by last name instead of first name? In Address Book, I have everything sorted by last name. Why it's doing this, I don't understand. But it creates a nightmare on for putting the final document together.
    You can actually print directly from Address Book.
    +Menu > Print > Layout > Address Book > Style:/Layout etc+
    and you will find you have a great deal of control over what gets out put, including the images from the Address Book VCard or alternative graphics from the Finder.
    Peter

  • Photo merge question

    when i try to do a photo merge i get the following error
    Error 48: File or folder does not exist.
    Line: 46
    ->  $.evalFile(g_StackScriptFolderPath + "StackSupport.jsx");
    I am on a macbook pro retina, with cs6 via creative cloud.

    this is why ....i dont get this ....when i look for those files this is what i see!

  • Type, create outlines and merging questions

    Hi,
    I have type which I then I created outlines. Then I have this shape (a rectangle frame), I want to merge the two so I can bring an image into the combined shape. I cannot figure out how to merge the outlines text with this frame - is this even possible to do in ID? I know how to do it in Illustrator using the pathfinder but I'd really like to get this done in ID.
    Hope I explained this OK?
    Thanks!
    Kim

    Check out the InDesign Secrets Blog. A post (below) discusses some of this.
    Also, Branislav posted a link to his transparency effects PDF that may assist you in the comments for this blog.
    http://indesignsecrets.com/turn-any-object-into-a-transparency-mask.php
    HTH
    -mt
    PS: While this doesn't cover the use of the pathfinder to make a complex image frame, per your initial post, this may in fact be an easier route to accomplish your task.

  • Data Merge questions within CS 5.5...Please help

    Basically, we utilize this now with our calendar designs for schools which includes school events on certain days via the data merge along with building each calendar design from a 2 page spread with data merge. Now, the issue we are running into is....we send the school a proof of their calendar before we send it to print. At this time, they have an opportunity to add/delete/edit any events they want on our online portal for them in which we pull the info into our database to create the updated CSV file. Is there a way that once the first CSV file is merged to have it as a link or something similar? By this, I mean...it would be nice that when we re-generate the CSV file at proof time with the updated events that those will simply be updated in our indesign file by updating the link or something similar? We want to avoid re-building the calendar from scratch (2 page spread) at this point. Although for 70%+ rebuilding is not an issue, the other 30% are custom calendar that we have several edits to the 2 page template to start with. We dont want to have to do this custom work again or possible miss those custom changes when it is recreated. Any suggestions or help would be appreciated. Thanks!

    The good news is that you won't need to re-build anything. That said, I see 2 ways to update your file.
    Save the original as a template (before it's merged) and run the merge again once the CSV has been finalised. That way you always have the template of the first and each time you run the merge you get a new indd file.
    The other is based on the assumption that you added your merge fields into the document and not the master of the original file. If so, you can copy the document page content into the master pages, add the merge fields to the master and use this as a template. When you merge the document this time the CSV becomes a linked file in the resultant file.
    The differences between 1 and 2 is that the link to the CSV file is kept in the merged file in 2. Either way, it's a very easy update for you but you will have to re-apply your custom changes. This should just involve a straight copy/paste though.

  • SQVI table merge question

    Hello,
    I am wondering if there is a table I can use to merge shipment and delivery tables in table merge SQVI (quick viewer).
    Thanks in advance
    Jacob
    P.S. I do not have authorization to run query so quick viewer is only option

    Dear,
    Please check and pick the suitable tables useful to solve your requirements.
    Sap Tables
    Re: Shipment's tables
    Regards,
    Syed Hussain.

  • Flatten and Merge question

    Dears all,
    i found Flatten and merge a great feature ( Comp and Take ).
    But : it's possible to go back to originary comp once Flatten and Merge command is executed ?
    Many thanks in advance.
    Anton

    Hey guys, i noticed that if you have flattened the performance (not sure about flatten and merge) you can slice the track (scissors) after say a performance you changed your mind on and you'll be able to then look at other takes (that little arrow will appear on the upper right side).
    obviously slice before the take so you don't replace everything leading up to it.......

  • Probably a basic data merge question...

    Hi,
    I am trying to create a multiple-record layout using data merge. The problem is that when I preview the document everything looks fine (first screenshot). When I actually create the merged docuement, however, the last two data entries from each page are moved off the edge of the page (second screenshot).
    If anyone has any suggustions or advice it would be greatly appreciated!
    Also let me know if you need any more information.
    Thanks in advance,
    Jack

    Your page number is being repeated with everything else. You'll need to do your merge without the numbers, and then add them to the merged document afterwards.

  • Another Data Merge question...

    Thanks, SRiegel, now that I’ve added the apostrophe in the title of the photo column, the Data Merge box DOES indicate photo. The problem is, when I do the Data Merge, it says the photos can’t be found. Here’s an example of how I have the photos listed:
    U:\MyPictures\employees3\smithjohn.psd
    Thank You

    Is that path correct? Can you place that image outside of data merge into another document, and doe it say that's the path?

  • Quick Data Merge question

    I've done this before but I only do it about once a year so I'll be damned if I can remember how to do it. However, I think I remember... does this sound about right?
    I'm doing 4 up postcards on an 8.5 x 11. I have one postcard in the upper left with text boxes in the address area.
    I linked up the excel document. Then I'm going to grab from the Data Merge panel "First Name" and drop it into one of the text boxes, then grab "Last Name" and drag into one of the text boxes, etc, etc. Then, I'm going to hit "Create Merged Document" and set it for "Multiple Record Layout"... but heres where I'm getting stuck. How do I tell it to do 4 up? When I hit the "preview multiple record layout" it just kind of shifts the one down and to the right a little but doesnt put it 4 up. Any thoughts?

    Yes, they will. But I think my "spacing" is goofed up.
    The layout is 8.5 x 11 horizontal so each one is 5.5" wide and 4.25" tall (4 up on a sheet). The one in the upper left should repeat to the right 5.5", down 4.25" and then to the right 5.5" and down 4.25" so its in the bottom right corner....
    I think I need help in the "Multiple Record Layout" section

Maybe you are looking for

  • Bex Report display issue

    Hi Experts, I have a requirment where I want to display the details of my Service Order In and Out date wise. Like Ser. Order No...............Ser. Ord Date..............................................Delivery No.................Delivery Date 1000..

  • Sales Order- Shedule lines

    Dear Experts, 1. user is created one sales order having different sheduleline dates. for current date they deliveried stocks to customer. Now the user wants to know what are all the orders are due for next shedule lines Please let us know how we can

  • Xine is green and slow

    Hello If I try to start a video with xine, the video has a green tone and is sloooooooooooooooooow. Same thing if I use codeine (which uses xine). Kaffeine (which AFAIK uses xine too) works without any problem... I found an old thread with a broken l

  • Solid Amber Light - Can't connect to TC...

    Hi, my TC has become unreachable after I added a workgroup name to the config. I've 3 Macs, none of which can discover the TC using the airport utility and I'm starting to suspect that the actual TC is now faulty. I have tried hard resetting the unit

  • Advice required on TSCM62-- Certification

    I'm doing Online Training on SD TSCM60 & 62. Regards to preparing for certification, can anyone advice whether I need to concentrate only on theory or do I need to concentrate on working & solving on the excercises which are given in the books. How i