Tricking COTS Into Using Sequences

I am using a COTS software that does about 100-200 concurrent inserts into many tables at a time. This software uses a table to store the values of about 25 sequences. So for each insert, a process has to lock the row, select the value, insert the rows, increment the value and then release the lock. This is not scalable at all and as much as I try I can't get the COTS devlopers to use oracle sequences So I guess one of my questions is that I am looking for the best way to trick the app into using oracle sequences. I am in the process of trying the following, which is creating the oracle sequences, then creating a funtion for each sequence which returns its value. I then create a view that unions all the functions. I then create an instead of update trigger on this view, which does baiscally nothing. This process works pretty well, except for the fact that when the update is done, it queries the view which causes the sequences to increment. So for a single process, the sequence increments during the initial select and then again during the update. So I am not using every other number.
Current Process
create sequence seq_one nocycle noorder cache 10000 start with 1;
create sequence seq_two nocycle noorder cache 10000 start with 1;
create function func_one return number
as
cnt number;
begin
select seq_one.nextval into cnt from dual;
return cnt;
end;
create function func_two return number
as
cnt number;
begin
select seq_two.nextval into cnt from dual;
return cnt;
end;
create view sequences
as
select 'seq_one' Sequence_Name, func_one Sequence_Value from dual
union all
select 'seq_two' Sequence_Name, func_two Sequence_Value from dual;
create trigger trigger_sequences
instead of update on sequences
begin
dbms_output.put_line('');
end;
Thanks for any feedback!!

You are wasting your time doing what is roughly equivalent to trying to prove to someone that the sun comes up in the morning.
Your vendor knows it.
Your vendor doesn't care.
They don't care because companies like yours continue to by their trash so why should they put down their beers and write new
code and go through a testing cycle when it doesn't bring a single dollar to their bottom line? Because some guy is complaining
who's management won't back him up?
The table exists for one of two reasons. Either the vendor wants a single solution for Oracle and SQL Server and other anemic
databases or they are lazy and uneducated. Choose whichever one you wish.
Which takes you back to the choices in my original email. Either your company switches, your find something else to worry about,
or you get out of there and find a better job.

Similar Messages

  • Paypal tricked me into using a back account instead of my credit card

    I have always used my credit card when buying from ebay, and then suddenly paypal used my bank account without my permission. How do I get that back account out of paypal? It does not have enough money in it to make purchases, and I do not want a bank account linked AT ALL because of hacking possibilities. Because this occurred, and I will likely have overdraft charges, I am going to close the account that paypal accessed to prevent this from happening in the future.

    Hi there  This is a very annoying problem with PayPal for many users. The only workaround is to select a credit card as the payment source, during checkout. Since it's already been charged to your bank, there is nothing PayPal can do to help you anymore. Any overdrafts that might have occured, etc, that's your banks' problem, not PayPal's.  

  • Tricking iTunes into thinking an external hard drive is an iPod?  Possible?

    Hi
    There is a lot of info out there about using your iPod as a hard drive, but I am wanting to the opposite, namely use my external portable hard drive as an iPod (this says something of my contrary nature).
    The reason being that my iTunes library is made up of Apple Lossless files, and I would like to take advantage of the "convert higher bit rate songs to 128kbps" feature in iTunes, but by syncing to a portable external hard drive rather than an iPod.
    I am aware that there are various methods of converting all my Apple Lossless files for use on an external hard drive, but none of these (as far as I am aware) synchronize with iTunes (i.e. update tags/ratings in the converted files if changes are made in iTunes). Because I would need this feature, I am wondering if there is a way of tricking iTunes into thinking that my external hard drive is an iPod (here my devious nature comes to the fore), or some other method of achieving what I am looking for?
    Thanks for reading
    Nick

    I just need my 128kbps tracks to be updated if changes are made in iTunes, such as tag changes, rating changes, tracks being deleted, new tracks being added.
    When you play the ALAC songs or change ratings and such, you want to sync that info to the 128 songs on the external?
    And wen you add/remove anything from the internal, you want those to be converted/added to the external?
    Absolutely no idea how this could be accomplished.

  • I think I have the latest Firefox version, but keep getting messages about updating it. 1 says something is preventing Firefox from updating securely; another says something is trying to trick Firefox into accepting an unsecure update. What's going on?

    The 1st message goes on to say, "Please make sure that you have the latest version of Firefox from http://www.firefox.com." Assuming 4.0.1 is the latest version, it seems this is a bogus message and I haven't clicked on the link.
    The 2nd message goes on to say something like, "if this continues [the attempt to trick Firefox into accepting an unsecure update], contact your network administrator."
    I started getting the messages on all 4 of our PC's (2 desktops running Windows 7 Home Premium 64-bit, 1 running XP 32-bit, & a laptop running Vista Home Basic 64-bit) after updating to Firefox 4.0 on them. I manually updated to 4.0.1 on all thinking that would stop the messages, but it hasn't.
    I loaded & ran free versions of McAfee Stinger, Malwarebytes Anti-Malware, and Super Anti-Spyware programs on all our PCs; each program found & repaired some infected files on each computer, but the messages continue on all.
    Thanks for any help you can give.

    Apparently this occurs when Firefox has problems with security certificates. There have been a few questions about this. I will try to get advice about this.
    Apparently you are using Internet Explorer 9 (From your system details). Do you have Google Updater plugin installed on Firefox ?
    (That been implicated in this sort of problem by one poster, and some users with the problem do have Google Updater, but some do not)

  • USING SEQUENCE IN PACKAGE SPEC

    I Want to Use Sequence.NEXTVAL & Sequence.CURRVAL throughout the package. How can i declare the global sequence variable and make them available for all the stored procedures inside the package ?
    Any help highly appreciated..
    Thank you all in advance

    Data Boy wrote:
    No i know that but using directly SEQUENCE.CURRVAL inside the Insert statement is not a good practice.
    We need to declare inside the procedure a variable and then fetch the SEQUENCE.CURRVAL into that variable
    and use that variable inside the insert statement. But we that variable scope will be available only inside that procedure.
    if i want the same CURRVAL in another stored procedure. How can i get it ..that is my Question.What exactly are you trying to achieve?
    If it's a case of needing to know the value of the sequence number assigned to an inserted record you would typically use the RETURNING clause on the insert statement...
    SQL> create table temp (id number, val varchar2(20));
    Table created.
    SQL> create sequence temp_seq;
    Sequence created.
    SQL> ed
    Wrote file afiedt.buf
      1  create trigger trg_temp before insert on temp
      2  for each row
      3  begin
      4    select temp_seq.nextval into :new.id from dual;
      5* end;
    SQL> /
    Trigger created.
    SQL> set serverout on
    SQL> declare
      2    v_num number;
      3  begin
      4    insert into temp (val) values ('Fred') returning id into v_num;
      5    dbms_output.put_line('ID inserted was: '||to_char(v_num));
      6  end;
      7  /
    ID inserted was: 1
    PL/SQL procedure successfully completed.
    SQL> select * from temp;
            ID VAL
             1 Fred
    SQL>

  • Using sequence in sqlldr

    hi
    can we use already existing db sequence in sqlldr control file
    regards
    kedar
    attached is control file but i want to use nextkey_seq to populate client_id
    LOAD DATA
    INFILE 'COMM.csv'
    APPEND
    INTO TABLE COMMUNITY_REGISTER
    FIELDS TERMINATED BY '~' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (CLIENT_ID,
    SURNAME,
    DATE_OF_BIRTH DATE "YYYYMMDD" ,
    SEX,
    DATE_LAST_UPDATED DATE "YYYYMMDD" ,
    CURRENT_STATUS,
    DATE_OF_CURRENT_STATUS DATE "YYYYMMDD" ,
    INITIAL_STATUS,
    DATE_OF_INITIAL_STATUS DATE "YYYYMMDD" ,
    GP,
    GPTYPE,
    LEAD_HCP,
    STAFF_TYPE,
    NHS_NUMBER,
    COMMUNITY_ID,
    MOTHERS_ID,
    PREVIOUS_SURNAME,
    FORENAME,
    TITLE,
    ALIAS,
    STREET_NO,
    STREET,
    LOCALITY,
    TOWN,
    COUNTY,
    POSTCODE,
    HEALTH_AUTHORITY,
    PHONE_NUMBER,
    INITIAL_SECTOR,
    CURRENT_SECTOR,
    REG_DISTRICT,
    OPCS_BIRTH,
    OPCS_RESIDENCE,
    ETHNIC_ORIGIN,
    CHANGED_BY_ID,
    CHILD_HEALTH_EXISTS,
    DIAGNOSES_EXISTS,
    TEXT_EXISTS,
    SPECIAL_NEEDS_EXISTS,
    ADMISSION_EXISTS,
    CHILD_PROTECTION_EXISTS,
    NEXT_OF_KIN_ID,
    NOK_RELATIONSHIP,
    NHS_TRACE_RESULT,
    PAS_NUMBER,
    REGISTRATION_ORIGIN,
    NBH_STATUS,
    SECTOR,
    MOBILE_NO,
    AUDIT_TIMESTAMP DATE "YYYYMMDD" ,
    AUDIT_ID,
    AUDIT_ORIGIN,
    TRANSFER_CHECKED,
    LAST_ACTION,
    RECORD_STATUS,
    TRACE_RESULT_DATE DATE "YYYYMMDD"
    )

    Kedar,
    You sure can use sequence nextkey_seq.nextval in your control file (don't remember the exact syntax, but you can find it in Utilities manual for SQL*Loader

  • How to use sequence in MS sql server?

    In Oracle DB we use sequence like that:
    SequenceImpl s = new SequenceImpl("customer_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue()));
    But there is no sequence in sql server ,how can I do?
    Thank you~~

    MS SQLServer have a IDENTITY column property and UNIQUEIDENTIFIER data type that is somewhat similar to Oracle's sequence. I don't know whether your table contain either of these, or you just want to set sequential number to a column.
    Below is some info about IDENTITY and UNIQUEIDENTIFIER you may already know since they are in SQLServer Book.
    IDENTITY property: You can define IDENTITY property on a numeric column. You can set the seed and increment on this column property very much like Oracle's sequence. The only thing I think it does not have is the "nextval". You can use IDENT_CURRENT function or @@IDENTITY after an INSERT or SELECT INTO to get the last value generated. Of course you can use this value and add the increment to get the next
    value but it not the same as seqname.nextval which keep incrementing each time you call it. Getting the current identity value and adding the increment your self will not work for multiple sessions with pending
    insert. Another thing about column with IDENTITY property is that you cannot insert value into this column (i.e, omit it in your insert statement values) unless IDENTITY_INSERT is on, but only one table in a
    session can have IDENTITY_INSERT to be turned on.
    If you don't need to know the next seq value, then IDENTITY work similar to Oracle sequence. Execute select after postchanges or commit will have system generated values. If you need to get next value before insert, Sung suggest using SEQ_TABLE and managing the next value (write a database function to mimic Oracle'
    s nextval).
    UNIQUEIDENTIFIER datatype: UNIQUEIDENTIFIER is a 16-byte hexadecimal number indicating a globally unique identifier (GUID). The GUID is useful when a row must be unique among many other rows. You could use NEWID() to create a value of type uniqueidentifier or calling some API function that returns a GUID. The advantage of using uniqueidentifier is that the values generated by NEWID function or application GUID are guaranteed to be unique throughout the world. The disadvantage of using uniqueidetifier is that it is long and obscure, random, difficult for user to remember or type correctly. It is 16 byte, which is large compare to other datatype such as 4-byte integer.
    Thanks,
    Yvonne

  • How to Use Sequence in Oracle Views

    Hi ,
    I have created a view which gives the information about the access rights which a Resource has got. for ex -
    Res1 - GYM access - member
    Res1 - Swimingpool Access - member
    I need to identify a Primary Key for this data set. So i thought that i'll use a Sequence to generate an extra column in this view.
    But when i'm using the Sequence i'm getting the following error - "ORA-02287".

    you can use sequence within view it doesnot returned error;
    create sequence t1_seq MAXVALUE 150
    START WITH 39 INCREMENT BY 1;
    SQL> insert into t1_view values(t1_seq.nextval,'dd');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    4 rows selected.
    SQL> insert into t1_view values(t1_seq.nextval,'ee');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
    ID NA
    10 aa
    20 bb
    30 cc
    40 dd
    41 ee
    5 rows selected.

  • Want to use sequence object of oracle when loading data in sql loader

    Hi,
    I want to use sequence when loading data in sqll loader, but the problem is i could not use sequence object of oracle to load the data by sql loader, i can use sequence of sql loader.
    I want to use sequence object because in later entries this sequence object will be used.If i use sequence of sql loader how can i use oracle sequence object
    Is there any other option

    I have a simillar problem, I also want to use a sequence when loading data by the SQL Loader.
    My control file is:
    load data
    infile '0testdata.txt'
    into table robertl.tbltest
    fields terminated by X'09'
    trailing nullcols
    (redbrojunos,
    broj,
    dolazak,
    odlazak nullif odlazak=blanks,
    komentar nullif komentar=blanks)
    And the datafile is:
    robertl.brojilo.nextval     1368     17.06.2003 08:02:46     17.06.2003 16:17:18     
    robertl.brojilo.nextval     2363     17.06.2003 08:18:18     17.06.2003 16:21:52     
    robertl.brojilo.nextval     7821     17.06.2003 08:29:22     17.06.2003 16:21:59     
    robertl.brojilo.nextval     0408     17.06.2003 11:20:27     17.06.2003 18:33:00     ispit
    robertl.brojilo.nextval     1111     17.06.2003 11:30:58     17.06.2003 16:09:34     Odlazak na ispit
    robertl.brojilo.nextval     6129     17.06.2003 14:02:42     17.06.2003 16:23:23     seminar
    But all records were rejected by the Loader, for every record I get the error:
    Record 1: Rejected - Error on table ROBERTL.TBLTEST, column REDBROJUNOS.
    ORA-01722: invalid number

  • Generating value of column using sequence in Toplink

    Hi
    I have a toplink pojo table, say SamplePojo. I need to automatically generate a value for the primary key field, say id. Is it possible to insert only the name field into the table and let toplink generate a value for id field using sequence?
    I try the following code from my client class
    Project project = XMLProjectReader.read("META-INF/tlMap.xml", Thread.currentThread().getContextClassLoader());
    DatabaseSession session = project.createDatabaseSession();
    session.shouldLogMessages();
    session.login();
    String query = "insert into SAMPLE_POJO(NAME) values('SAMPLE NAME')";               
    session.executeSQL(query);
    session.logout();If i execute the above code i get a error like "Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("MYSCHEMA"."SAMPLE_POJO"."ID")"
    This is how my SamplePojo class looks like
    @Entity
    public class SamplePojo iimplements Serializablel {
        @Id
        @GeneratedValue(generator = "sampleSequence")
        @SequenceGenerator(name = "sampleSequence", sequenceName = "SAMP_SEQ", allocationSize = 1)
        private BigDecimal id;
        private String name;
        public SamplePojo(BigDecimal id, String name) {
            this.name = name;
            this.id = id;
    //getters and setters for class variables
    }

    Are you trying to use JPA, or the native TopLink API?
    Your annotations are JPA, but your code is the native API, using the XMLProjectReader.read("META-INF/tlMap.xml"), either use one or the other.
    With JPA, you will just have a persistence.xml, and optionally an orm.xml (you will not use the Mapping Workbench).
    To insert an object you just create an instance of the class and call persist(), no SQL.
    i.e.
    EntityManager em = factory.createEntityManager();
    em.getTransaction().begin();
    SamplePojo pojo = new SamplePojo();
    pojo.setName("SAMPLE NAME");
    em.persist(pojo);
    em.getTransaction().commit();
    James : http://www.eclipselink.org

  • How can i use "sequence"

    hi
    I have created a sequence as the following:
    create sequence id_seq start with 1 ,increment by 1;
    I create a table as the following code:
    create table xmltab(id number primary key,xml_content varchar2(4000));
    After this, In jdev9i,I try to use the id_seq by the following code:
    Connection con=getConnection();
    PreparedStatement pstmt =
    con.prepareStatement ("insert into xmltab (id, xml_content) values (?, ?)");
    pstmt.setInt(1,id_seq.NEXTVAL);
    pstmt.setString(2,tempBuffer.toString());
    pstmt.execute();
    con.commit();
    pstmt.close();
    con.close();
    It is obvious that a error is occured :Error(933,22): variable id_seq not found in class ***
    How can succeed in using sequence?

    hi langyun ,
    it should be
    PreparedStatement pstmt =
    con.prepareStatement ("insert into xmltab (id, xml_content) values (id_seq.nextval, ?)");
    pstmt.setString(1,tempBuffer.toString());
    Sequence is a database object and cannot be accessed as a java object.
    so it has to be execute as a sql command.
    Regards
    Elango.

  • Audio "sub-clips" won't play in source monitor, but will play when cut into a sequence.

    I'm cutting an "audio only" project in Premiere and I came across a strange problem while making sub-clips. The first 6 sub clips made from the same master audio clip were normal, but then something changed, and the rest of them won't play any sound while in the "Source" window, even though while in the window the sub-clip displays a waveform.
    Once edited into a sequence they play normally, but not being able to listen to the sub clips in the source monitor is annoying, and louses up my whole editing routine for this kind of project.
    Any ideas as to why this is happening, or what I might do to fix it?

    Number of issues here:
    1. Your system does not meet minimum requirements.
    2. Your CPU, disks, memory are not enough for anything other than DV.
    3. What video camera was used with what codec on what OS with which version of PR. etc.
    Some suggestions... and answer at least the 16 questions at the end of the Wiki article.

  • Using Sequence

    Hi Everyone,
    Is there any way that we can assign/attach a sequence to the column of a table, actually the requirement is that I have table, in which a third party will be inserting the data and they want me to attach a sequence to column where that sequence should generate a auto number upon inserting each record.
    As far as I knew that we can use sequence thru a form to insert auto numbers.
    Any help will be appreciated.
    Thanks in advance
    Ahon

    Is there a simple way to return the value generated to the form?
    Forms 6i, 9i database.
    I have a basic form that allows the user to insert a record into a table CALL_HISTORY. That table has a BEFORE INSERT trigger that gets a sequence value and uses it as the primary key, CALL_ID.
    Now on the form post-save I want the call_id display field populated with this new value. I can't query for it as none of the other data is unique. Surely Forms must have some function to do this?

  • I'm getting an error message from Firefox that says, "Something is trying to trick Firefox into accepting an insecure update. Please contact your network provider and seek help."

    I'm getting an error message from Firefox that says, "Something is trying to trick Firefox into accepting an insecure update. Please contact your network provider and seek help." Do you know what is going on here--what this problem could be? (I do have the latest Firefox version already installed. I have previously received Firefox error messages that say "Firefox Update Failed." However, I already had the latest Firefox version installed when I received those error messages.)

    Apparently this occurs when Firefox has problems with security certificates. There have been a few questions about this. I will try to get advice about this.
    Apparently you are using Internet Explorer 9 (From your system details). Do you have Google Updater plugin installed on Firefox ?
    (That been implicated in this sort of problem by one poster, and some users with the problem do have Google Updater, but some do not)

  • TIP - Trick Gmail into working as IMAP!!

    I searched around and found several methods of tricking Gmail into working as an IMAP server. This is not an ideal situation, but it works. This is the best one I found:
    http://www.macuser.com/internet/gettingyour_gmail_to_doimap.php
    I tried this using AOL Mail (free), because it also has 2GB of storage. Surprise, surprise: it worked and works quite well.
    Let me know if y'all try it and how it works out for you!

    Keeping Mail from constantly downloading and refreshing the All Mail folder (different from the Inbox as I am sure you know) might be a benefit, particularly if you are using many different connections when away from home.
    See:
    http://en.wikipedia.org/wiki/Push_technology
    where it says: Email is also a push system: the SMTP protocol on which it is based is a push protocol (see Push e-mail). However, the last step—from mail server to desktop computer—typically uses a pull protocol like POP3 or IMAP. Modern e-mail clients make this step seem instantaneous by repeatedly polling the mail server, frequently checking it for new mail. The IMAP protocol includes the IDLE command, which allows the server to tell the client when new messages arrive.
    I am not sure the Gmail server and Mail play nice with the IDLE command, and I have not selected it on my setup, but don't remember why as Gmail is not my principal email source? If you have selected to use the IDLE command, then you may want to experiment with deselecting it, and have Mail check for new messages every 5 or 10 minutes. I will further research Gmail with IDLE on Mail.
    Ernie

Maybe you are looking for