Pb Trigger with :new

Hello
When I use this Trigger:
CREATE OR REPLACE TRIGGER TMM_EXPLOSE_T
AFTER INSERT ON TMM_EXPLOSE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE TTCNT INTEGER;
BEGIN
TTCNT:=0;
IF (:NEW.TMM_TYPE != 'SNBOM') THEN
TMM_EXPLOSE_P(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'',TTCNT);
ELSE
TMM_EXPLOSE_SN(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'');
END IF;
END;
I receive this error:
PLS-00553: character set name is not recognized
I think is for the :NEW
Could you explain me how i can do it work please
I use Orcale 9.2.0.1.0 on Unix server with
NLS_CHARACTERSET     WE8ISO8859P15
NLS_NCHAR_CHARACTERSET     AL16UTF16
NLS_LANGUAGE     AMERICAN
Thank you
Pierre Diaz

hi:
what version of Project Raptor are you using?
I created a tmm_explose table with just a column tmm_type;
I open a sql worksheet on Raptor 08.04 on linux, and when I run
CREATE OR REPLACE TRIGGER TMM_EXPLOSE_T
AFTER INSERT ON TMM_EXPLOSE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE TTCNT INTEGER;
BEGIN
TTCNT:=0;
IF (:NEW.TMM_TYPE != 'SNBOM') THEN
-- TMM_EXPLOSE_P(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'',TTCNT);
null;
ELSE
-- TMM_EXPLOSE_SN(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'');
null;
END IF;
END;
/the message is a popup window stating: "An error was encountered performing the requested operation: Missing IN or OUT parameter at index:: 1 Vendor code 17041"
The same works when I put :new in quotes:
CREATE OR REPLACE TRIGGER TMM_EXPLOSE_T
AFTER INSERT ON TMM_EXPLOSE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE TTCNT INTEGER;
BEGIN
TTCNT:=0;
IF (:"NEW".TMM_TYPE != 'SNBOM') THEN
-- TMM_EXPLOSE_P(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'',TTCNT);
null;
ELSE
-- TMM_EXPLOSE_SN(:NEW.TMM_TYPE,:NEW.USERNAME,:NEW.CAL,:NEW.POS,:NEW.DDATE,:NEW.LIV,:NEW.SLIV,:NEW.MQTY,:NEW.PARENT,:NEW.CHILD,'');
null;
END IF;
END;
/Please, note that I just commented the tmm_explose_p function (for lazyness... :-))

Similar Messages

  • Trigger with :new references

    i have a table with the following fields
    I_ID I_ID_PARENT      I_Description               ekey
    1 1      Pageimpressions
    2 1      Startpage
    3 1      news
    4 1      R_part
    5 4      Business
    6 4      Finance
    7 4      Computer
    8 4      carriere &
    9 4      Kids
    10 4      Shopping
    11 4      Travel
    i want a trigger which inserts a value into ekey automatically while inserting a new row into a table. the possible records for the table would be as stated abv. the value of ekey shud be some thing like parent||'0'||no.of child of that parent (ex.101,102,103,104,401...)
    can u help me out in this process... i have written a code which im sending u below but gives me error
    create or replace trigger DLEI_trig
    before insert on D_POSITION
    for each row when (new.I_ID > 0)
    Begin
    select to_char(base_key) into :new.EKEY from (
    select e1.:new.I_ID*100+ROW_NUMBER()
    OVER(
    PARTITION BY e1.:new.I_Description order by e1.:new.I_Description desc) base_key
    from D_POSITION e1,D_POSITION e2
    where e2.:new.I_ID_parent=e1.I_ID) ;
    end;
    /

    This is a solution but it is not transaction safe. It will work if you only ever have one user updating the table; so it might be viable for systems based on Personal Oracle :P
    Ponder the following sequence of events, in which two users update a table which has the trigger RAMUTR.
    Cheers, APC
    User 1 starts the following transaction:
    USR1> insert into t1 values (1, 325, 0, 'Does this work?');
    1 row created.
    USR1> select col1, col3, col4 from t1;
          COL1       COL3 COL4
             1        101 Does this work?
    USR1> commit;
    Commit complete.
    USR1> insert into t1 values (1, 326, 0, 'How about this?');
    1 row created.
    USR1> select col1, col3, col4 from t1;
          COL1       COL3 COL4
             1        101 Does this work?
             1        102 How about this?
    Unfortunately user 1 doesn't commit at this point. So when user 2 starts work this is what happens:
    USR2> select col1, col3, col4 from t1;
          COL1       COL3 COL4
             1        101 Does this work?
    USR2> insert into t1 values (1, 426, 0, 'Is this right?');
    1 row created.
    USR2> commit;
    Commit complete.
    USR2>
    Which means user 1 is now in for a bit of a surprise:
    USR1> insert into t1 values (1, 326, 0, 'What happened?');
    1 row created.
    USR1> select col1, col3, col4 from t1;
          COL1       COL3 COL4
             1        101 Does this work?
             1        102 How about this?
             1        102 Is this right?
             1        104 What happened?
    USR1>

  • After insert trigger with :NEW.ROWID

    Hi All,
    I am using a After insert trigger to generate history record as following:
    CREATE TABLE TB_TEST (classID number(3), classNm varchar2(12));
    CREATE TABLE TB_HIST_TEST (hist_dttm timestamp(6), classID number(3), classNm varchar2(12));
    CREATE or REPLACE TRIGGER air_test AFTER INSERT ON tb_test FOR EACH ROW
    BEGIN PK_SRVC.CRT_NewRec('TB_TEST', 'TB_HIST_TEST', :new.ROWID); END:
    In PK_SRVC package, I use the following statment to create new record in TB_HIST_TABLE:
         Insert into tb_hist_test (hist_dttm, classID, classNm)
         values (select systimestamp, classID, classNm from tb_test where rowid = ROWID )
    The trigger DOES fire when a new row is inserted into TB_TEST. However there is no record inserted into TB_HIST_TEST. Any suggestion?
    Thanks,

    The PK_SRVC.CRT_NewRec is a generic service package that can be shared by many tables. It uses dynamic SQL to get all the collumns for different tables based on USER_TAB_COLUMNS.  The following is the code of this package:
    PROCEDURE CRT_NewRec ( p_TableName IN VARCHAR2, p_AudTableName IN VARCHAR2, p_RowID)
    IS
           TYPE TabCol_RecTyp IS RECORD (COLUMN_NAME VARCHAR2(30), COLUMN_ID NUMBER);
           TYPE TabCol_CurTyp IS REF CURSOR;
            c_TabCol TabCol_CurTyp;
            rc_TabCol TabCol_RecTyp;
            v_Sql_TabCol VARCHAR2(1000);
            v_ColNames VARCHAR2(1000);
            v_Sql VARCHAR2(1000);
            PRAGMA AUTONOMOUSE_TRANSCATION;
    BEGIN
            v_SQL_TabCol := ' SELECT column_name, column_id FROM USER_TAB_COLUMNS'
                                      ||  ' WHERE table_name = ' || CHR(39) || p_TableName || CHR(39)
                                      || '  ORDER BY column_id';
            v_ColNames := NULL;
            OPEN c_TabCol FOR v_Sql_TabCol;
            Loop
                   FETCH c_TabCol INTO rc_TabCol; Exit WHEN c_TabCol%NOTFOUND:
                   v_ColNames := v_ColNames || ',' || rc_TabCol.COLUMN_NAME;
            End Loop;
            CLOSE c_TabCol;
            v_Sql := 'INSERT INTO ' || p_AudTableName || '(HIST_DTTM, ' || v_ColNames || ' )'  
                      || ' SELECT systimestamp, ' || v_ColNames || ' FROM ' || p_TableName
                      || ' WHEN ROWID = chartorowid(' || CHR(39) || p_RowId || CHR(39) || ')';
             EXECUTE IMMEDIATE v_Sql;
             COMMIT;
    END;    
    (charmingholidays-yyz)

  • Scope of global & pl/sql variable in open_form with new session

    Hi,
    What will be the scope of the Oracle forms global variable & variable declared in a pl/sql pckage, if the value in these variable is updated from the Oracle Form GUI, if the form is opend by using the open_form method with new session or Active session.
    My requirement is , I developed one application with custom user login name & password - not the Oracle username & password.
    But I need to track the user actions on the forms - Inser/Update/Delete action, for this i included user_name as one of the column in the base table, and from the form, initialise this field with login user name.
    I implemented this in the trigger of the base table. But for delete, I am not getting the user name who deleted, only getting the user who created this record, because :NEW is not in scope for after delete trigger. So for the delte, I created a variabe in a PL/SQL package, and created two procedure to set & get the user name to that variable, and from the Form, before delete by using the set method I assign the current login user name to the variable, and in the trigger by using the get() get the user name from the variable, So far this is working fine, my doubt is What will be the value in the variable, if two different user made delete action from at a same time, Whether first user name will be replace with second one, or this variable will be in different session, If I opened the forms by using SESSION parameter. Also can I use Oralce Forms global varaible instead of the PL/SQL varibale.
    Thank in advance.

    Thanks Andreas,
    I did the same way. But my doubt is All the user login will be in different session, I mean, Whether the vairable used to store the user name will be in different session to each Oracle Forms user, it wont overwrite one user name with the next login user name.
    -- Copied from you old message:
    <<On the forms-side after the login, call PK_USER.PR_SET_USER(THE_USER_TAKEN_FROM_SOMEWHERE);
    In your db-triggers where you actually use something like USER, use PK_USER.FK_GET_USER instead>>
    Thanks
    Rizly

  • KALC (recons) eliminated in ECC 6.0 with New GL?

    Hello all,
    In ECC 6.0, New GL functionality, is transaction KALC, where the reconciliation postings happen between CO-FI eliminated? So the allocations for that matter would not be a Month end activity? All types of allocations and therefore their reconciliations will happen real-time?
    Please help me with these questions.
    Thanks,
    Nysa
    Cross-post

    Hi
    Reco ledger is no longer required if you implement New GL.. As with New GL it happens on real time basis
    Allocations are still a month end activity.. But, unlike before, when you do allocations now in CO, it triggers a posting in FI as well due to which FI and CO are reconciled real time.... The reco variant you can set up to trigger postings in FI whenever a cross Bus area or cross PC allocation happens in CO... System would immediately trigger a posting in FI as well whenever cross allocation happens
    Hope it helps
    Ajay M

  • Stored Procedure that creates a trigger on new tables

    I am trying to create a stored procedure that creates a trigger on new tables whenever the table is created.  The procedure should receive the new project table's name, and then create a dml trigger on that procedure.  When the procedure
    is run, I get an error "Incorrect syntax near keyword 'TRIGGER.'"  This is how my Stored Procedure looks in SQL Management Studio.  Any suggestions?
    USE [RIDB_DynamicDesign]
    GO
    /****** Object: StoredProcedure [dbo].[sp_CreateTriggerMarkLatest] Script Date: 11/08/2014 16:43:20 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[sp_CreateTriggerMarkLatest] @ProjectTable nvarchar(128), @ItExists int OUTPUT
    AS
    DECLARE @SQL nvarchar(4000)
    DECLARE @MarkLatest nvarchar(30)
    DECLARE @LatTrue bit
    DECLARE @LatFalse bit
    SET @LatTrue = 'True'
    SET @LatFalse = 'False'
    SET @SQL = 'CREATE TRIGGER tr_MarkLatest ON ' + @ProjectTable + ' AFTER INSERT
    AS
    UPDATE ' + @ProjectTable + ' SET Latest = @LatFalse
    UPDATE ' + @ProjectTable + ' SET Latest = @LatTrue WHERE
    ID IN (SELECT ID FROM ' + @ProjectTable + ' p WHERE
    NOT EXISTS (SELECT 1 FROM ' + @ProjectTable + ' WHERE
    Name = p.Name AND Vers = p.Vers
    AND Date > p.Date))'
    EXEC sp_executesql @SQL, N'@ProjectTable nvarchar(128), @LatTrue bit, @LatFalse bit',
    @ProjectTable, @LatTrue, @LatFalse
    Gina

    First you have to debug the dynamic SQL string with a PRINT statement. I see some problems:
    CREATE PROCEDURE [dbo].[uspCreateTriggerMarkLatest] @ProjectTable nvarchar(128), @ItExists int OUTPUT
    AS BEGIN
    DECLARE @SQL nvarchar(4000)
    DECLARE @MarkLatest nvarchar(30)
    DECLARE @LatTrue bit
    DECLARE @LatFalse bit
    SET @LatTrue = 'True'
    SET @LatFalse = 'False'
    SET @SQL = 'CREATE TRIGGER tr_MarkLatest ON ' + @ProjectTable + ' AFTER INSERT
    AS
    UPDATE ' + @ProjectTable + ' SET Latest = @LatFalse
    UPDATE ' + @ProjectTable + ' SET Latest = @LatTrue WHERE
    ID IN (SELECT ID FROM ' + @ProjectTable + ' p WHERE
    NOT EXISTS (SELECT 1 FROM ' + @ProjectTable + ' WHERE
    Name = p.Name AND Vers = p.Vers
    AND Date > p.Date))'
    PRINT @SQL;
    -- EXEC sp_executesql @SQL, N'@ProjectTable nvarchar(128), @LatTrue bit, @LatFalse bit', @ProjectTable, @LatTrue, @LatFalse
    END
    GO
    DECLARE @ItExists int, @ProjectTable nvarchar(128) = N'TestTrigger';
    EXEC [dbo].[uspCreateTriggerMarkLatest] @ProjectTable, @ItExists OUTPUT
    CREATE TRIGGER tr_MarkLatest ON TestTrigger AFTER INSERT
    AS
    UPDATE TestTrigger SET Latest = @LatFalse
    UPDATE TestTrigger SET Latest = @LatTrue WHERE
    ID IN (SELECT ID FROM TestTrigger p WHERE
    NOT EXISTS (SELECT 1 FROM TestTrigger WHERE
    Name = p.Name AND Vers = p.Vers
    AND Date > p.Date))
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Dynamic references to trigger vars :new and :old

    Is there any way to dynamicly refer to the :old and :new bind
    variables available in triggers?
    I'm looking for a method to make a standard processing system
    that processes based on column-names. I want to avoid calling my
    handling system staticly for each field in the table.
    Ie. I want to refer to :old.data_column in a way where I can
    loop through all the fields of the table.
    Hints, tips and ideas would be greatly apprechiated.

    You can't have dynamic PL/SQL containing ":NEW" or ":OLD" in
    database triggers.
    But in some cases, if your table has primary key (PK)
    or unique key (UK), you can use AFTER STATEMENT triggers
    in following way
    (this is like well-known solution for mutating error problem):
    1. create database package with PL/SQL table
    (for storing PK values)
    2. clear PL/SQL table in BEFORE STATEMENT trigger
    3. populate PL/SQL table with PK value
    in BEFORE (or AFTER) ROW trigger
    4. read rows in AFTER STATEMENT trigger with dynamic PL/SQL,
    using PKs from PL/SQL table and using dynamically selected
    column names with statement
    SELECT column_name
    FROM user_tab_columns
    WHERE UPPER (table_name) = UPPER (p_table);"
    (you can read NEW values of columns and,
    with AUTONOMOUS_TRANSACTION, OLD values too)
    For example (scott.dept table):
    CREATE OR REPLACE TRIGGER bus_dept
    BEFORE UPDATE ON dept
    BEGIN
    plsql_table.clear;
    END;
    CREATE OR REPLACE TRIGGER bur_dept
    BEFORE UPDATE ON dept
    FOR EACH ROW
    BEGIN
    plsql_table.populate_with_id (:NEW.deptno);
    END;
    CREATE OR REPLACE TRIGGER aus_dept
    AFTER UPDATE ON dept
    DECLARE
    v_current_id dept.deptno%TYPE;
    BEGIN
    dynamic_new_old.set_table_name ('dept');
    dynamic_new_old.set_pk_name ('deptno');
    dynamic_new_old.create_column_names;
    WHILE plsql_table.id_exists LOOP
    v_current_id := plsql_table.current_id;
    DBMS_OUTPUT.PUT_LINE ('OLD VALUES:');
    dynamic_new_old.display_old_values (v_current_id);
    DBMS_OUTPUT.PUT_LINE ('NEW VALUES:');
    dynamic_new_old.display_new_values (v_current_id);
    DBMS_OUTPUT.PUT_LINE ('*****');
    END LOOP;
    END;
    CREATE OR REPLACE PACKAGE plsql_table IS
    PROCEDURE clear;
    PROCEDURE populate_with_id (p_id dept.deptno%TYPE);
    FUNCTION id_exists RETURN BOOLEAN;
    FUNCTION current_id RETURN dept.deptno%TYPE;
    END;
    CREATE OR REPLACE PACKAGE BODY plsql_table IS
    TYPE type_plsql_table IS TABLE OF dept.deptno%TYPE INDEX BY
    BINARY_INTEGER;
    m_plsql_table type_plsql_table;
    -- prefiks m_ is for module level variable (defined in package
    body)
    -- prefiks g_ is for global variable (defined in package
    specification)
    m_rec_number BINARY_INTEGER;
    PROCEDURE clear IS
    BEGIN
    m_rec_number := 0;
    END;
    PROCEDURE populate_with_id (p_id dept.deptno%TYPE) IS
    BEGIN
    m_rec_number := m_rec_number + 1;
    m_plsql_table (m_rec_number) := p_id;
    END;
    FUNCTION id_exists RETURN BOOLEAN IS
    BEGIN
    RETURN (m_rec_number > 0);
    END;
    FUNCTION current_id RETURN dept.deptno%TYPE IS
    v_id dept.deptno%TYPE;
    BEGIN
    v_id := m_plsql_table (m_rec_number);
    m_rec_number := m_rec_number - 1;
    RETURN v_id;
    END;
    END;
    CREATE OR REPLACE PACKAGE dynamic_new_old IS
    PROCEDURE set_table_name (p_table VARCHAR2);
    PROCEDURE set_pk_name (p_pk VARCHAR2);
    PROCEDURE create_column_names;
    PROCEDURE display_old_values (p_id dept.deptno%TYPE);
    PROCEDURE display_new_values (p_id dept.deptno%TYPE);
    END;
    CREATE OR REPLACE PACKAGE BODY dynamic_new_old IS
    m_table VARCHAR2 (30);
    m_pk VARCHAR2 (30);
    m_columns VARCHAR2 (1000);
    PROCEDURE set_table_name (p_table VARCHAR2) IS
    BEGIN
    m_table := p_table;
    END;
    PROCEDURE set_pk_name (p_pk VARCHAR2) IS
    BEGIN
    m_pk := p_pk;
    END;
    PROCEDURE create_column_names IS
    v_first_column BOOLEAN;
    BEGIN
    v_first_column := TRUE;
    FOR rec IN
    (SELECT column_name
    FROM user_tab_columns
    WHERE UPPER (table_name) = UPPER (m_table))
    LOOP
    IF v_first_column THEN
    v_first_column := FALSE;
    m_columns := 'v_record.' || rec.column_name;
    ELSE
    m_columns := m_columns ||
    '||' || '''--''' || '|| v_record.' || rec.column_name;
    END IF;
    END LOOP;
    END;
    PROCEDURE display_values (p_id dept.deptno%TYPE) IS
    v_cursor INTEGER;
    v_rows_processed INTEGER;
    v_statement VARCHAR2 (32000);
    BEGIN
    v_statement :=
    ' DECLARE ' ||
    ' v_record ' || m_table || '%ROWTYPE;' ||
    ' BEGIN' ||
    ' SELECT * INTO v_record' ||
    ' FROM ' || m_table ||
    ' WHERE ' || m_pk || ' = ' || p_id || ';' ||
    ' DBMS_OUTPUT.PUT_LINE (' || m_columns || ');' ||
    ' END;';
    v_cursor := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (v_cursor, v_statement, DBMS_SQL.V7);
    v_rows_processed := DBMS_SQL.EXECUTE (v_cursor);
    DBMS_SQL.CLOSE_CURSOR (v_cursor);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE (sqlerrm);
    IF DBMS_SQL.IS_OPEN (v_cursor) THEN
    DBMS_SQL.CLOSE_CURSOR (v_cursor);
    END IF;
    END;
    PROCEDURE display_old_values (p_id dept.deptno%TYPE) IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    display_values (p_id);
    END;
    PROCEDURE display_new_values (p_id dept.deptno%TYPE) IS
    BEGIN
    display_values (p_id);
    END;
    END;
    Note that this code is not generic, because uses
    "dept.deptno%TYPE". If all your PKs has the same declaration
    (for example NUMBER), then you can write generic solution.
    If you need only OLD values, you can write a simpler solution
    (without statement triggers and "plsql_table" package),
    using "dynamic_new_old" package and AUTONOMOUS_TRANSACTION
    in BEFORE (or AFTER) ROW trigger.
    Regards
    Zlatko Sirotic

  • Trigger with entire row

    Hi all!
    I've a before insert trigger.
    I want to call a procedure within this trigger, with a record input param.
    How can I pass the ":NEW" as a record type?
    Thanks!

    unfortunatly this is not possible.
    You have to pass all :NEW values separately. Or transfer then to a rowtype first like:
    declare
       v_new_row table%rowtype;
    begin
      v_new_row.col1 := :NEW.col1;
      v_new_row.col2 := :NEW.col2;
      v_new_row.col3 := :NEW.col3;
      v_new_row.col4 := :NEW.col4;
      v_new_row.col5 := :NEW.col5;
      v_new_row.col6 := :NEW.col6;
      do_something(v_new_row);

  • Trigger with progressive

    Hi,
    I've this table:
    CREATE TABLE MY_TAB (
    ID VARCHAR2 (24) NOT NULL,
    NAME_ID VARCHAR2 (32) DEFAULT NULL,
    PRIMARY KEY (ID ));
    I'd like to create one trigger that for each NAME_ID insert into ID column the value "NAME_ID-progressive of 3 digit"
    For example:
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..............NAME_ID
    999-001.........999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..............NAME_ID
    999-001.........999
    999-002.........999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('88888');
    ID..............NAME_ID
    999-001.........999
    999-002.........999
    88888-001.......88888
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('88888');
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999');
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    999-003.............999
    INSERT INTO MY_TAB ( NAME_ID) VALUES ('999')
    ID..................NAME_ID
    999-001.............999
    999-002.............999
    88888-001...........88888
    88888-002...........88888
    999-003.............999
    999-004.............999
    The trigger is like this:
    CREATE OR REPLACE TRIGGER TRG_MY_TAB
    BEFORE INSERT ON MY_TAB
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    WHEN (NEW.ID IS NULL)
    BEGIN
    SELECT (:NEW.NAME_ID ||('-here progressive'))
    INTO :NEW.ID
    FROM DUAL;
    END;
    How can I create this trigger with progressive
    Thank in advance!

    Create an auxiliary table:
    CREATE TABLE progressive
    (name_id VARCHAR2(32) NOT NULL PRIMARY KEY
    ,seq NUMBER NOT NULL
    /And then call this function in your trigger:
    CREATE OR REPLACE FUNCTION next_progressive (p_name_id IN progressive.name_id%TYPE)
                               RETURN NUMBER IS
      l_seq NUMBER;
    BEGIN
      LOOP
        BEGIN
          SELECT seq INTO l_seq
            FROM progressive
            WHERE name_id = p_name_id
            FOR UPDATE;
          UPDATE progressive
            SET seq = seq + 1
            WHERE name_id = p_name_id;
          RETURN l_seq;
        EXCEPTION
          WHEN no_data_found THEN
            BEGIN
              INSERT INTO progressive (name_id, seq)
                VALUES (p_name_id, 2);
              RETURN 1;
            EXCEPTION
              WHEN dup_val_on_index THEN
                null;
            END;
        END;
      END LOOP;
    END;
    /

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How to change the Existing alias with new alias name...MAXL SCRIPT

    HI Experts
    I need to change alias name of the existing member with new alias name.
    please send me maxl code to change the alias name .
    My thought is
    1) Old alias should be replaced with new alias name .
    2)There is one account that should be rolled out to another parent..these parents are already exsist
    3) I need a MAXL Script to change the new alias name .
    please suggest ASAP.
    Thanks
    USER

    John
    I heard that we can replace existing alias name with new alias thru MAXL
    i.e replace alias name XXXX member with YYYY ;
    please correct me if iam wrong ,might be Maxl command is wrong but this is the idea.
    Thanks
    USER

  • WiFi no longer working with new Time Capsule-can you help please?

    Hi all,
    Just received my new Time Capsule (TC). It was a little problematic setting up, but probably due to my now choosing to increase my security from WEP to WPA as the TC set-up assistant suggests. Since then, I have had numerous problems getting my other computers and now my iPhone to connect with WiFi.
    The problem is that despite entering all the new settings and WPA passwords for my connection with the TC, the iPhone will either momentarily recognize and go to wifi or simply stay on Edge.
    On the former, with wifi active, as soon as I go to iTunes, Safari or check email, it reverts to Edge. On the latter, despite resetting, entering password, or tapping Settings and selecting my wifi connection, it will NOT connect and stays on Edge.
    (Now, I'm on Edge! I'm bummed that with new hardware I have new problems that didn't exist before!)
    Can someone who had this same problem tell me how they resolved it.
    Here's the one clue I have, but would rather not resort to: When I first set up the TC, I had it on WEP with a WDS Network, and everything was working great and FAST! Now that I have increased the security—I will be backing up 3 computers to the TC—my iPhone and other computers seem to have intermittent or no wifi connection as a result.)

    Irving Gonzales,
    If your computers are 802.11N capable, you might want to try an advanced setup that might help your Time Machine speeds some. I have not personally tested it, so it is just a personal theory at this point.
    First, in a mixed environment the 802.11N clients all get slowed down.
    First, configure the TC for 802.11N only.
    Second, connect the Airport Express via ethernet to the Time Capsule
    Third, configure the Airport Express for bridged mode (doesn't give out IP addresses), and for its own wireless network with a different name than the Time Capsule.
    Have any 802.11b/g clients like the iPhone join the Airport Express' network.
    Thank you,
    Nathan C.

  • TS3899 Cannot send email with new iPad air.  Works fine with old iPad and iPhone.

    Cannot send email with new iPad air.  Works fine with old iPad and iPhone.  I have deleted account and reinstalled.

    Thanks.  I got the problem fixed.  Spent time with the Apple folks and was kicked up to a senior advisor.  It seems the problem was with my internet provider - Tmie Warner.  Remember I could use the old ipad and the iphone to send mail.  I checked all the specifics between the three units.  It seems that TW is changing over from the RR.com  to TWC.com.  Since the new ipad air was just set up, it fell under the new TWC mail specifics. 

  • Flash player does not work with new ICS Android 4.0.4 OS. Has this problem been addressed?

    Flash player does not work with new ICS Android 4.0.4 OS. Has this problem been addressed? I am using Firefox Beta for android and I also tried just Firefox.

    Please check the Play Store app for any Flash updates and install them if present.

  • Home sharing does not work with new mountain lion update.

    home sharing does not work with new mountain lion update. Does anyone else have the same issue. Updated all computers in my home, deauthorized and reauthorized each computer. turn off home sharing and turned it back on. don't know what else to do..please help...

    Our Apple TVs continue to lose connection ever since installing Mountain Lion on the host computer. The only thing that fixes them is to quit and relaunch iTunes, which only works unti the ATV goes to sleep. If a movie is paused for more than a few minutes and the ATV goes to sleep, pressing play again on the remote is greeted with "There are no movies on this computer" or "Turn on Home Sharing."
    If we stop a video on one ATV and attempt to resume it in another room, the error begins again. The other ATV can't connect until iTunes is relaunched.
    My guess is that it has something to do with the new [annoying] security settings. But I still haven't found a fix other than restarting iTunes everytime we want to watch something from our downloads. Fail.

Maybe you are looking for

  • Sleepy drives

    How can I stop external hard drives from going to 'sleep'. I have five USB Western Digital 1TB drives on a USB hub and they all go to sleep after a while. This is really annoying when using Final Cut as I am often having to wait for the drive to spin

  • Export problem

    Hi, I have a problem while exporting from excel to my oracle 8i table. I have a long field in the table. error saying invalid usage of lonf field. help arun

  • Synchronization beetween CUA x LDAP - Can it use paged queries?

    I’m using the synchronization process between LDAP (Microsoft Active Directory) and CUA (ECC 6.0). I’m having problems with a specific Microsoft best practice. This best practice allow only read 1000 objects in one query, in order to get the next 100

  • PPro CS6 hangs computer

    All of a sudden, PPro stops responding - correction, the WHOLE COMPUTER stops responding. Mouse won't move, alt-tab doesn't work, ctrl-alt-del doesn't work - I actually have to power cycle the machine. This is not a very complex project (the project

  • Re Adobe Flash I get"installation successful" but it is NOT. Help!

    I download Adobe Flash Player and gey a screen saying " InAfter stallation Successful" there is no icon on my desktop, no Flash Player in my programs, and I cannot receive any thing through Flash Player.