Sequencing and Trigger on Oracle 9i lite database

We created a schema (TESTSCHEMA) on Oracle 8.1.7 Enterprise edition and have a created a trigger which will use the sequence object to generate primary key for the table (TEST_TABLE)
Sequence creation:
CREATE SEQUENCE TESTSCHEMA.TEST_TABLE_SEQUENCE START WITH 6000 INCREMENT BY 1 MINVALUE 6000 MAXVALUE 6999 NOCACHE NOCYCLE NOORDER ;
Trigger creation:
CREATE OR REPLACE TRIGGER TEST_TABLE INSERT BEFORE INSERT ON TEST_TABLE FOR EACH ROW
DECLARE
pkValue NUMBER;
BEGIN
pkValue := 0;
Select TEST_TABLE_SEQUENCE.NextVal into pkValue from dual;
:NEW.TEST_KEY := pkValue;
END TEST_TABLE_INSERT;
We have created a snapshot of the schema on mobile server, synchronized the data with the client (Win32 for testing purpose).
The trigger works fine on the server, but when I run the same query on the lite database with msql it gives me an error:
[POL-3221] null key in primary index
I was wondering if Sequence generation and Triggers are supported on Oracle 9i lite database ? Or am I missing out something ??
Any information/ help is appreaciated
Thanks
Neeraj

You can't use SAVEPOINT / ROLLBACK TO SAVEPOINT statements in the database trigger:
ORA-04092: cannot SET SAVEPOINT in a trigger
ORA-04092: cannot ROLLBACK in a trigger
I am not sure what you need exactly, but you can try this:
Simulating ROLLBACK TO SAVEPOINT Behavior in a Database Trigger
http://www.quest-pipelines.com/pipelines/plsql/tips02.htm#JUNE
Regards,
Zlatko Sirotic

Similar Messages

  • Creation of sequence and trigger for each table!!!!!!!1

    Hi
    I am new to trigger and Sequence field. In one of my database we have many tables with fields for specifing ID numbers. Iam planning to insert the ID field with help of a Sequence and trigger...that trigger fires by adding the sequence value from the dual table. Now the point is here we r having around *60* table with ID field. And i am planning use the above process for each table by creating sequences and trigger for each table.
    Will this affects the performance of database.
    Is there any other option other than the above process, I mean other than creating sequences and trigger for each table.
    PLzz help to resolve this issuee......
    Shiyas
    Edited by: user13170361 on Jun 7, 2010 12:37 AM

    Tiger, I didn't mind about your comment, but the point is try to use
    select NVL(max(a) + 1,1) into i from p1_temp;This line in your trigger code and see what is happening. The problem is with your trigger. You are using group by function and you will not get no_data_found !
    For more help, this is some modification of your code.
    SQL> create table p1_temp (a number(10) primary key, b number(10));
    Table created.
    SQL> create or replace trigger trg_p1_temp
      2  before insert on p1_temp for each row
      3  declare
      4  i number(10);
      5  begin
      6  begin
      7  select NVL(max(a) + 1,1) into i from p1_temp;
      8  exception
      9  when no_data_found then
    10  i := 1;
    11  end;
    12  :new.a := i;
    13  end;
    14  /
    Trigger created.
    SQL> insert into p1_temp(b) values (1);
    1 row created.
    SQL> insert into p1_temp(b) values (2);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from p1_temp;
             A          B
             1          1
             2          2
    SQL> Edited by: Saubhik on Jun 7, 2010 2:30 AM

  • Oracle 10g Lite Database User Creation

    Hi,
    I am using Oracle 10g Lite Database Release 3, I Like to Know How to Create a user in Oracle 10g Lite Database through Command ,Any Advice
    Thanks U
    SHAN

    Shan,
    In the same way you create user in any other oracle database. I recommned to check following Oracle Lite Sql reference document for creating user from command line.
    http://download.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm#sthref487
    or
    sql> CREATE USER liteuser IDENTIFIED BY "litepassword"; -- And add required privs to the user.
    Regards

  • Suppress auto sequence and trigger DDL for surrogate keys?

    Is there a way to suppress trigger and sequence creation for surrogate keys when export to DDL file?
    I know most of the time the automatic sequence and trigger creation is welcome and very handy.
    However I'm migrating from an old Designer model and there only the needed sequences are created.
    They have a different name and trigger logic is custom (and  generated outside designer).
    There is a lot of package code depending on this. So I prefer to create and use different sequences.
    Is there a way to achieve this? Any tips are welcome.Create

    Hi,
    Note that generating the DDL for Oracle 12c means that it will attempt to use your Oracle 12c Physical model.  So if you normally use Oracle 10g or 11g, you will find that any details from your Oracle 10g or 11g Physical Model will not be included.  So this approach may have other implications for you.
    If you are not using Oracle 12c, there are some relevant properties on the Auto Increment tab of the Relational Model properties dialog for the Column which may help:
    Sequence Name - allows you to specify the name of the Sequence (which can be the name of a Sequence defined in the relevant Physical Model).
    Trigger Name - allows you to specify the name of a Trigger (which can be the name of a Trigger that is defined for the Table in the Physical Model).
    Generate Trigger - unsetting this will stop the Trigger being generated.
    David

  • Oracle 10g Lite database - Replacement

    Hi,
    Can u mention some database similar to oracle 10g Lite database features which supports forms10gr2?]
    Note: Thin Database required.
    Regards
    Sreenivas

    Shan,
    In the same way you create user in any other oracle database. I recommned to check following Oracle Lite Sql reference document for creating user from command line.
    http://download.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm#sthref487
    or
    sql> CREATE USER liteuser IDENTIFIED BY "litepassword"; -- And add required privs to the user.
    Regards

  • Installing Oracle 9i Lite Database standalone

    We are interested in installing the Oracle 9i Lite Database standalone for Windows 2000. Can you send me the instructions that you mentioned below in a previous response? In addition, I need to know the size of the database footprint.
    Thanks,
    Sarah
    [email protected]

    We are interested too, we have Satellite Forms and having many problems for connect to Oracle Lite Database on Palm Device. If you have any other information
    for to do it, i will appreciate eternaly.
    Jorge
    [email protected]
    We are interested in installing the Oracle 9i Lite Database standalone for Windows 2000. Can you send me the instructions that you mentioned below in a previous response? In addition, I need to know the size of the database footprint.
    Thanks,
    Sarah
    [email protected]

  • Oracle jdbc creating a table, sequence and trigger

    I'm trying to create a table with a sequence and with a trigger for that sequence. When I do this within Oracle Express edition I have the following SQL statements. Which DO run correctly inside Oracle Express using the same user I log in with JDBC.
    CREATE table "TEST" (
    "ID" NUMBER(10) NOT NULL,
    "NAME" VARCHAR2(20),
    constraint "TEST_PK" primary key ("ID")
    CREATE sequence "TEST_SEQ"
    CREATE trigger "BI_TEST"
    before insert on "TEST"
    for each row
    begin
    if :NEW."ID" is null then
    select "TEST_SEQ".nextval into :NEW."ID" from dual;
    end if;
    end;
    So now what I do is put each of these into a List of Strings and execute 1 by one like this:
    List<String> commands = new ArrayList<String>(4);
    commands.add("Create table ...");
    commands.add("Create sequence ...");
    commands.add("Create trigger...");
    st = con.createStatement();
    for (String command : commands) {
    st.execute(command);
    etc...
    But I get an error with the trigger statement. "Error with Oracle command: ORA-00942: table or view does not exist"
    It seems to me that Oracle has not yet seen the new table at this point. or maybe my user can create tables but not triggers? If that's the case why did it work in the express application itself?
    TIA

    SproketBoy wrote:
    But I get an error with the trigger statement. "Error with Oracle command: ORA-00942: table or view does not exist"Keep in mind: Oracle is not lying to you.
    >
    It seems to me that Oracle has not yet seen the new table at this point. or maybe my user can create tables but not triggers? If that's the case why did it work in the express application itself?No, DDL commands cause an explicit commit. As soon as you invoke them, the change is permanent. If it was a rights problem, you'd get a different ORA error stating that, it won't silently fail.
    Lets not assume it is anything difficult, perhaps there is simply a typo in a name somewhere?

  • Oracle 9i Lite database size growing

    The database size on Oracle 9i Lite is increased.
    If I extract data and recreate database with them, volume can be reduced at 5-10 of time.
    Whether there are any other ways of reduction of the size? Some tools, or may be internal Java classes.

    Can i create the database without using the sync or the create db. Or programatically how do i create the database Check out the client side APIs, examples can be found in the documentation, see WINCE (PocketPC) Developer's Guide.
    RP.

  • Is it possible to use Oracle Forms 10g with Oracle 10g Lite Database?

    Hi All,
    We are in process of migrating our forms from 6i to 10g environment.
    We have two kinds of applications, one set run on general Oracle 11g database and the other set of forms run at the client machine using Oracle lite database.
    We dont have any problem with Forms 6i to connect to Lite database as it allows to connect through ODBC:DSN names. When we try to connect to a lite database (10gR3) from Forms 10g through ODBC/DSN, it's not allowing and throwing the below error.
    ORA-03121 : no interface driver connected - function not performed
    Can someone tell me if there is something wrong in our approach? Also advise how to use Oracle Lite database with Forms 10G.
    Sincerely,
    Praveen Manthena

    Hi,
    I have experience with 6i with lite database 10g. There are two version of lite database one is multi language support and other one in english. There lang problem in connectivity with multi language 10g lite database. I done connectivity with single language connectivity of 6i with 10g lite database. You should try this one with forms 10g.
    Regards,
    Naveed Ali

  • How do I install JAVA JVM, JServer and XDK in Oracle Express Ed database

    IF I query with SELECT COUNT(*) FROM all_objects WHERE object_type LIKE 'JAVA%'; I get a count of 0.
    I see no DBMS_JAVA package.
    How can I install JAVA JVM, JServer and XDK in the Oracle Express Edition database?
    I see no initjvm.sql, initxml.sql and xmlja.sql scripts. There are catjava.sql and catexf.sql scripts in the rdbms/admin folder.

    cssifah,
    Looks like you want this Web page:
    http://www.oracle.com/technology/products/database/xe/forum.html
    Good Luck,
    Avi.

  • Sequence and trigger

    Hello,
    Ia have created a Sequence and a trigger
    The Sequence ïs:
    CREATE SEQUENCE "WABO"."WABO_VERG_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 ORDER NOCYCLE;
    The trigger is:
    create or replace
    TRIGGER WABO.WABO_VERGUNNING_TRIC
    BEFORE INSERT ON WABO.WABO_VERGUNNING FOR EACH ROW
    WHEN (new.WABO_ID IS NULL) BEGIN
    SELECT WABO_VERG_SEQ.NEXTVAL INTO :new.WABO_ID FROM dual;
    END;
    When I insert a row in the table the sequence counter is 21 and it's stay's 21 even when I insert a new row
    When I cal the DDL it's showes me this
    CREATE SEQUENCE "WABO"."WABO_VERG_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 ORDER NOCYCLE;
    What am I doning wrong.
    Thanks

    Solved

  • Connect Forms 6i application to Oracle 10g Lite database on notebook

    We are currently looking at mobilising one of our legacy systems. This application uses forms 6i. I have build the Olite Mobile Server and installed the olite database on a notebook. We have sucessfully synchonised from a 9i database to the Olite database on the notebook and have been able to validate the snapshot using msql
    when we try to connect to the olite database on the notebook using developer we get the following
    POL-5150 Access violation - Program attempted to access a database system table
    has anyone sucessfully connected forms 6i to an olite 10g database or know of someone who has.
    Thanks
    Sean

    I believe Oracle Lite is a non-SQLNET database and Forms can only connect via SQL*Net. If I am wrong and Oracle Lite can use SQL*Net I suggest you call Oracle Support and ask them to analyze your situation.

  • Auto number by sequence and trigger - issue

    Hi,
    i need to insert auto number in one of the column of my table, and i tried like the following way..
    CREATE TABLE STOP_TRACKING
      ID                    NUMBER                           primary key,
      MSISDN                NUMBER                  NOT NULL,
      TIME_STAMP            DATE                    DEFAULT SYSDATE,
      STOP_TRACKING_RESULT  NUMBER,
      REQUEST_ID            VARCHAR2(60 BYTE)
    TABLESPACE SYSTEM
    PCTUSED    40
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                FREELISTS        1
                FREELIST GROUPS  1
                BUFFER_POOL      DEFAULT
    LOGGING
    NOCACHE
    NOPARALLEL;
    COMMENT ON COLUMN STOP_TRACKING.STOP_TRACKING_RESULT IS 'IF RESULT ID "0" - OK AND IF RESULT ID "1" - NOT OK';
    create sequence seq_autonumber;
    CREATE OR REPLACE TRIGGER trg_autonumber
    BEFORE INSERT ON STOP_TRACKING
    FOR EACH ROW
    WHEN (new.id IS NULL)
    BEGIN
      SELECT seq_autonumber.NEXTVAL
      INTO   :new.id
      FROM   STOP_TRACKING;
    END;
    /when i execute the create trigger sql in toad sql editor am getting a pop up saying
    >
    variable name:NEW
    Type: drop down list ...here i tried almost relevant data types, int,long,....
    Value:...here i entered 1
    and clicked ok...and got the error as
    ORA-01036: illegal variable name/number
    >
    what could be issue?
    Edited by: Aemunathan on Nov 22, 2009 2:55 PM

    I just copy pasted your code.
    Works just fine.
    I believe you issue is realed to TOAD rather than pl/sql.
    Would have loved to help you but i use pl/sql developer.
    However if possible send a screen shot.
    Cheers!!!
    Bhushan

  • Oracle 9i lite database creation

    Can i create the database without using the sync or the create db. Or programatically how do i create the database

    Can i create the database without using the sync or the create db. Or programatically how do i create the database Check out the client side APIs, examples can be found in the documentation, see WINCE (PocketPC) Developer's Guide.
    RP.

  • Oracle 8i Lite - OO4O and other Questions

    1.) Can OO4O (Oracle Objects for OLE) be used with the Oracle 8i Lite database ?
    2.) Does Oracle 8i Lite operate as a "client/server" database ?
    3.) Is it possible to have multi-user access to Oracle 8i Lite ?
    4.) Is there documentation somewhere that lists all of the limitations with 8i Lite as compared to 8i ?
    We are in the planning stages of a partial mobile system, and want to know how much difference in development efforts for the 2 platforms (Oracle 8i on Win 2000 server and Oracle 8i Lite on NT/98/95 Laptops).
    Any information on Oracle 8i Lite would be appreciated. -- Especially need an answer to question 1 right now.
    Thanks,
    Paula

    Hi,
    I am qouting below from the oracle 8i Lite documentation which says it supports triggers . Please clarify.
    Oracle Lite DBMS
    Oracle Lite DBMS is a lightweight (50KB - 750KB), Java enabled database designed from the ground up for laptops, handheld computers, PDAs and smartphones. It supports industry standard ODBC, JDBC, SQLJ, and Java Stored Procedures and Triggers. It provides a streaming fast "C" interface, OKAPI, to its object kernel. It also supports Java Access Classes, JAC, a fast and easy way to make Java Objects persistent. Oracle Lite DBMS now supports all popular mobile platforms, including Palm OS, EPOC, and Windows CE, letting you deploy enterprise applications on virtually any mobile device.
    Regards
    null

Maybe you are looking for

  • How to Transfer Purchased Songs from iPod back to iTunes.

    I lost some purchased songs in iTunes that are on my iPod. How do I do this? I see the place in iTunes to click to make this transfer but I'm not sure how to keep the iPod from syncing from the computer first and then it will match the computer and t

  • Finding lost songs in my iTunes library

    I have an external hard drive that I share between work and home PCs; however, I store all my music files on such drive and synch my iPod on the home computer. After upgrading my iTunes library on the work computer, I experienced some technical issue

  • How To Performance Optimize GRC Access Control 5.3

    Hi Everyone, GRC RIG published in BPX the following How-To-Guide: How To Performance Optimize GRC Access Control 5.3 https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90aa3190-8386-2b10-c4ba-ced67322ea6d We appreciate any feedback a

  • Exporting an uncompressed movie out of AE

    I just upgraded to Mtn Lion from Snow Leopard.  One difference is I used to be able to export a QT movie out of AE that was uncompressed.  Now that option is gone, have to compress it with one of the many options. I have a sound added so I can't expo

  • What color space is it?

    I soft proofed in sRGB in LR4 to be printed in SRGB, mistakenly exported in RGB, sent files over the web (which I assume get converted to sRGB over the internet) to where they are to be printed in sRGB.  Do I need to go back to step 2 and export out