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 Server

    Oracle Triggers variable


    Hello, I'm writing this post to ask you about If can I get a variable
    of trigger to my code in asp.net 2.0?.

    I have this code in my trigger:

    create or replace TRIGGER CORRELATIVO_EXPEDIENTE  BEFORE INSERT  ON
    EXP  REFERENCING NEW AS New  FOR EACH ROW  DECLARE  contador NUMBER;
    BEGIN  contador:=0;  SELECT NVL(MAX(id_exp),0) +1 INTO contador  FROM
    EXP;  :NEW.id_exp:=contador;  END;

    I want to get "contador".

    Thanks for all.

    On May 8, 9:53 am, Kovu <kovut@gmail.com> wrote:

    > Hello, I'm writing this post to ask you about If can I get a variable
    > of trigger to my code in asp.net 2.0?.

    > I have this code in my trigger:

    > create or replace TRIGGER CORRELATIVO_EXPEDIENTE  BEFORE INSERT  ON
    > EXP  REFERENCING NEW AS New  FOR EACH ROW  DECLARE  contador NUMBER;
    > BEGIN  contador:=0;  SELECT NVL(MAX(id_exp),0) +1 INTO contador  FROM
    > EXP;  :NEW.id_exp:=contador;  END;

    > I want to get "contador".

    > Thanks for all.

    You would set up a package with a variable.
    In the package is 1 procedure to set the variable (which is to be
    called by the trigger)
    and one function to retrieve the variable.
    You do realize your current approach (select max(id) from <table on
    which is the trigger>) won't work, and what's more is unscalable? The
    full table scan on exp is going to take more an more time. Why don't
    you use a sequence?

    --
    Sybrand Bakker
    Senior Oracle DBA

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

    On 8 mayo, 09:26, sybrandb <sybra@gmail.com> wrote:

    Can I use a sequence on version 9i?

    Thanks.

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

    On May 8, 10:41 am, Kovu <kovut@gmail.com> wrote:

    sequences have been available since Oracle 6

    --
    Sybrand Bakker
    Senior Oracle DBA

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

    On 8 mayo, 09:55, sybrandb <sybra@gmail.com> wrote:

    Ok thanks for all, Im a new user of Oracle :s, Im lost a bit xD
    Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc