Home     |     Java    |     Php General    |     Oracle Database    |     Oracle Server  

MS Dynamics CRM 3.0

  •  Setting up and Configuring Microsoft Dynamics CRM 3.0
  •  Managing Security and Information Access
  •  Entity Customization: Concepts and Attributes
  •  Entity Customization: Forms and Views
  •  Entity Customization: Relationships, Custom Entities, and Site Map
  •  Reporting and Analysis
  •  Workflow
  •  Server-Side SDK
  •  Client-Side SDK
  •  Integration with External Applications
  • Cervo Technologies
    The Right Source to Outsource

    Sharepoint Portal Server KB

    Microsoft CRM Info

    WPF Interview Questions

    SilverLight Interview Qs

    Asp.Net 2.0 Interview Qs

    Asp.NET 1.1 FAQs

    Oracle Interview Questions

    SAP Interview Questions

    Oracle Database

    2 scripts in one, possible???


    Hi

    update table1 r   set
    (c1, c2, c3, c4,
                c5, c6, c7)=
     ( SELECT c1, c2, c3, c4,
                c5, c6, c7
     from table2 i
     where i.c8 =c8)

    Im doing an insert first to load the pk (c8) into table1 (that is the
    pk for table1).
    table2 has not pk so there are many c8.
    I was wondering if is possible to do both scripts in one go?

    Thanks in advance ...

    A

    "valigula" <valig@gmail.com> a crit dans le message de news: 1178548090.183737.13@e51g2000hsg.googlegroups.com...
    Hi

    update table1 r   set
    (c1, c2, c3, c4,
                c5, c6, c7)=
     ( SELECT c1, c2, c3, c4,
                c5, c6, c7
     from table2 i
     where i.c8 =c8)

    Im doing an insert first to load the pk (c8) into table1 (that is the
    pk for table1).
    table2 has not pk so there are many c8.
    I was wondering if is possible to do both scripts in one go?

    Thanks in advance ...

    A

    ------------------------------

    Use MERGE.

    Regards
    Michel Cadot

    -----------------------------------------------Reply-----------------------------------------------

    No version and no idea what you are actually doing but look at
    the MERGE command.

    www.psoug.org
    click on Morgan's Library
    Scroll down to MERGE
    --
    Daniel A. Morgan
    University of Washington
    damor@x.washington.edu
    (replace x with u to respond)
    Puget Sound Oracle Users Group
    www.psoug.org

    -----------------------------------------------Reply-----------------------------------------------

    On 7 Mai, 16:28, valigula <valig@gmail.com> wrote:

    > Hi

    > update table1 r   set
    > (c1, c2, c3, c4,
    >             c5, c6, c7)=
    >  ( SELECT c1, c2, c3, c4,
    >             c5, c6, c7
    >  from table2 i
    >  where i.c8 =c8)

    > Im doing an insert first to load the pk (c8) into table1 (that is the
    > pk for table1).
    > table2 has not pk so there are many c8.
    > I was wondering if is possible to do both scripts in one go?

    I don't understand what you are trying to do and I daresay others fail
    to understand as well. Just in case your actual question hasn't been
    answered yet, please elaborate: What is the relation between tabele1
    and table2? Why does table2 have no pk? Why, if there are many records
    of table2 matching one record of table1, is there no aggregation in
    your select (say max, min, sum or whatever)?
    Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc