Bulk Fetch From an Oracle Sequence

I am trying to get a range of sequence values from an Oracle sequence.
I am using the option as show below using query
SELECT SEQUENCE_NAME.NEXTVAL FROM SYS.DUAL CONNECT BY LEVEL <= 10.
The above SQL gets 10 sequence value.
I just wanted to to check, if the implementation below is safe in a Multi User Environment?
Is the statement show below atomic. i.e. Multi parallel execution of the same function; Would it cause any inconsistencies?
EXECUTE IMMEDIATE 'SELECT SEQUENCE_NAME.NEXTVAL ' ||
  'FROM SYS.DUAL CONNECT BY LEVEL <= ' || TO_CHAR(i_quantity)
  BULK COLLECT INTO v_seq_list;
FUNCTION select_sequence_nextval_range(
   i_quantity      IN  INTEGER)
RETURN INTEGER IS
  o_nextval INTEGER;
  v_seq_list sequence_list;
BEGIN
  EXECUTE IMMEDIATE 'SELECT SEQUENCE_NAME.NEXTVAL ' ||
  'FROM SYS.DUAL CONNECT BY LEVEL <= ' || TO_CHAR(i_quantity)
  BULK COLLECT INTO v_seq_list;
  -- Get the first poid value.
  o_nextval := v_seq_list(1);
  RETURN o_nextval;
END select_sequence_nextval_range

Acquire Lock
You acquire a lock on a sequence? That's news to me - please post the code that does that. I certainly hope you don' t mean you are directly accessing the SYS.SEQ$ table to lock the row for that sequence - it isn't nice to mess with Oracle's tables!
For couple of JAVA/C applications the usage of sequence number is pretty big. Could be 100,000 for one single application processing.
How does that correlate with your previous statement that you get 10 at a time?
Sequences aren't designed for use cases that require gap-free sets of numbers or for use cases that require consecutive sets of numbers.
We wanted to implement the range get of sequence using a different mechanism.
For few other applications; we just need one sequence number for the application processing. So we use the select seq.nextval to get the value. So the same sequence number needs to serve the role of giving a single value as well as a consecutive range of values.
Then you may need to consider using your own table to track the chunks that need to be allocated. You would use a scheme similar to what Greg.Spall discussed except you would keep the 'chunk' data in your own table.
I'm not talking about using your own table to control actual one-by-one sequence number generation - that is a very bad idea. But if you need to work with large ranges that are allocated infrequently there is nothing wrong with using your own function and your own table to keep track of those allocations.
The 'one by one' number generation would be handled by an actual sequence. The generation of a 'start value' and an 'end value' would be handled by accessing your custom table. Each row in that table would have 'start_value' and 'available_numbers' colulmns.
Your function would take a parameter for how many numbers you need. For just one number the function would call the sequence.nextval and return that along with a count of '1'.
For a range the function would:
1. find a row in the table with an 'available_numbers' value large enough to satisfy the request,
2. lock the row for update
3. capture the 'start_value' for return to the user
4. adjust both the 'start_value' and 'available_numbers' values to account for the range being allocated
5. update the table and commit
6. return the 'start_value' and 'number_allocated' to the user (number_allocated might be LESS than requested perhaps)
The above is a viable solution ONLY if the frequency of allocation and the size of allocation avoids the serialization issues associated with trying to allocate your own sequence numbers.
Those issues can be somewhat mitigated by having the table store multiple rows with each row having a large chunk of values that can be allocated. Then your function query can get the first 'unlocked' row and avoid serializing just because one row is currently locked.

Similar Messages

  • Which method does the actual bulk fetch from database in ADF?

    Hi,
    I'm looking to instrument my ADF code to see where bottlenecks are. Does anyone know which method does the bulk fetch from the database so that I can override it?
    Thanks
    Kevin

    Hi,
    I think you need to be more specific. ADF is a meta
    data binding layer that delegates data queries to the
    business service
    FrankSorry - to be specific I probably mean BC4J - when a query runs in a view object.

  • Bulk Fetch from a Cursor

    Hi all,
         Can you please give your comments on the code below.
         we are facing an situation where the value of <cursor_name>%notfound is misleading. How we are overcoming the issue is moving the 'exit when cur_name%notfound' stmt just before the end loop.
    open l_my_cur;
    loop
    fetch l_my_cur bulk collect
    into l_details_array;
    --<< control_comes_here>>
    --<< l_details_array.count gives me the correct no of rows>>
    exit when l_inst_cur%NOTFOUND;
    --<< control never reaches here>>
    --<< %notfound is true>>
    --<< %notfound is false only when there are as many records fetched as the limit (if set)>>
    forall i in 1 .. l_count
    insert into my_table ....( .... ) values ( .... l_details_array(i) ...);
    --<< This is never executed :-( >>
    end loop;
    Thanks,
    Sunil.

    Read
    fetch l_my_cur bulk collect
    into l_details_array; as
    fetch l_my_cur bulk collect
    into l_details_array LIMIT 10000;
    I am trying to process 10,000 rows at a time from a possible 100,000 records.
    Sunil.
    Hi all,
         Can you please give your comments on the code below.
         we are facing an situation where the value of <cursor_name>%notfound is misleading. How we are overcoming the issue is moving the 'exit when cur_name%notfound' stmt just before the end loop.
    open l_my_cur;
    loop
    fetch l_my_cur bulk collect
    into l_details_array;
    --<< control_comes_here>>
    --<< l_details_array.count gives me the correct no of rows>>
    exit when l_inst_cur%NOTFOUND;
    --<< control never reaches here>>
    --<< %notfound is true>>
    --<< %notfound is false only when there are as many records fetched as the limit (if set)>>
    forall i in 1 .. l_count
    insert into my_table ....( .... ) values ( .... l_details_array(i) ...);
    --<< This is never executed :-( >>
    end loop;
    Thanks,
    Sunil.

  • Bulk Fetch stored procedure.

    I am new to the oracle world.
    Does any one have a very good, but simple example of a bulk fetch that show the creation of the container variable?

    SQL> declare
      2   /* Declare index-by table of records type */
      3   type emp_rec_tab is table of emp%rowtype index by binary_integer;
      4 
      5   /* Declare table variable*/
      6   emptab emp_rec_tab;
      7 
      8   /* Declare REF CURSOR variable using SYS_REFCURSOR declaration
      9   in 9i and above */
    10   rcur sys_refcursor;
    11 
    12   /* Declare ordinar cursor */
    13   cursor ocur is select * from emp;
    14 
    15  begin
    16 
    17   /* bulk fetch using implicit cursor */
    18   select * bulk collect into emptab from emp;
    19   dbms_output.put_line( SQL%ROWCOUNT || ' rows fetched at once from implicit cursor');
    20   dbms_output.put_line('---------------------------------------------');
    21 
    22   /* bulk fetch from Ordinar cursor */
    23   open ocur;
    24   fetch ocur bulk collect into emptab;
    25   dbms_output.put_line( ocur%ROWCOUNT || ' rows fetched at once from ordinar cursor');
    26   dbms_output.put_line('---------------------------------------------');
    27   close ocur;
    28 
    29   /* bulk fetch from Ordinar cursor using LIMIT clause */
    30   open ocur;
    31   loop
    32    fetch ocur bulk collect into emptab limit 4;
    33    dbms_output.put_line(
    34      emptab.count ||
    35      ' rows fetched at one iteration from ordinar cursor using limit');
    36    exit when ocur%notfound;
    37   end loop;
    38   close ocur;
    39   dbms_output.put_line('---------------------------------------------');
    40 
    41   /* bulk fetch from ref cursor */
    42   open rcur for select * from emp;
    43   fetch rcur bulk collect into emptab;
    44   dbms_output.put_line( rcur%ROWCOUNT || ' rows fetched at once from ref cursor');
    45   dbms_output.put_line('---------------------------------------------');
    46   close rcur;
    47 
    48   /* bulk fetch from ref cursor using LIMIT clause */
    49   open rcur for select * from emp;
    50   loop
    51    fetch rcur bulk collect into emptab limit 4;
    52    dbms_output.put_line( emptab.count ||
    53    ' rows fetched at one iteration from ref cursor using limit');
    54    exit when rcur%notfound;
    55   end loop;
    56   close rcur;
    57   dbms_output.put_line('---------------------------------------------');
    58 
    59   /* bulk fetch using execute immediate */
    60   execute immediate 'select * from emp' bulk collect into emptab;
    61   dbms_output.put_line( SQL%ROWCOUNT || ' rows fetched using execute immediate');
    62   dbms_output.put_line('---------------------------------------------');
    63 
    64  end;
    65  /
    14 rows fetched at once from implicit cursor
    14 rows fetched at once from ordinar cursor
    4 rows fetched at one iteration from ordinar cursor using limit
    4 rows fetched at one iteration from ordinar cursor using limit
    4 rows fetched at one iteration from ordinar cursor using limit
    2 rows fetched at one iteration from ordinar cursor using limit
    14 rows fetched at once from ref cursor
    4 rows fetched at one iteration from ref cursor using limit
    4 rows fetched at one iteration from ref cursor using limit
    4 rows fetched at one iteration from ref cursor using limit
    2 rows fetched at one iteration from ref cursor using limit
    14 rows fetched using execute immediate
    &nbsp
    PL/SQL procedure successfully completed.Rgds.

  • How to parse XML string fetched from the database

    i want to parse the XML string which is fetched from the oracle database.
    i have inserted the string in xml format in the database. The type of the field in which it is inserted is varchart2.
    I am successfully getting it using jdbc, storing it in a String.
    Now it is appended with xml version 1.0 and string is ready for parsing.
    Now i am making following programming.
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = Builder.parse(xmlString);
    Element root = doc.getDocumentElement();
    NodeList node = root.getElementsByTagName("product");
    But i am getting IOException at the statement
    Document doc = Builder.parse(xmlString);
    there fore i request u to kindly help me in solving this error.
    -regards
    pujan

    DocumentBuilder does not have a method parse with xml string as aparameter. The string should be a xml document uri.
    Convert xml string to StringReader.
    parse(new InputSource(new StringReader(xmlString)));

  • KM for Bulk loading from Sybase to Oracle

    Is there KM available for Bulk loading from Sybase to Oracle ?
    May be using Unix pipe, sybase fetch and Direct sqlloader.
    Anyone has some thoughts on this, appreciate your responses.

    Sample CTL generated by ODI.
    OPTIONS (
    ERRORS=0,
    DIRECT=TRUE
    LOAD DATA
    INFILE "/exp_imp/ODI_C_0ODI_TEST.bcp"
    BADFILE "/exp_imp/ODI_C_0ODI_TEST.bad"
    DISCARDFILE "/exp_imp/ODI_C_0ODI_TEST.dsc"
    DISCARDMAX 1
    INTO TABLE ODISYB_TEST.ODI_C_0ODI_TEST
    FIELDS TERMINATED BY 'M-,'
    C1_TEST_NO,
    C2_TEST_DESC,
    C3_TEST_TOKEN,
    C4_TEST_DATE
    Error on SQLLoader log file.
    Record 1: Rejected - Error on table ODISYB_TEST.ODI_C_0ODI_TEST, column C4_TEST_DATE.
    ORA-01858: a non-numeric character was found where a numeric was expected

  • SAVE EXCEPTIONS when fetching from cursors by BULK COLLECT possible?

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    Hello,
    I'm using an Cursor's FETCH by BULK COLLECT INTO mydata...
    Is it possible to SAVE EXCEPTIONS like with FORALL? Or is there any other possibility to handle exceptions during bulk-fetches?
    Regards,
    Martin

    The cursor's SELECT-statement uses TO_DATE(juldat,'J')-function (for converting an julian date value to DATE), but some rows contain an invalid juldat-value (leading to ORA-01854).
    I want to handle this "rows' exceptions" like in FORALL.
    But it could also be any other (non-Oracle/self-made) function within "any" BULK instruction raising (un)wanted exceptions... how can I handle these ones?
    Martin

  • Can data be fetched from Oracle Database to ApEx websheets?

    Hi,
    Oracle 11g R2
    ApEx 4.2.2
    We are in need of giving an MRU form for the customized data by the users. The number of columns will be defined dynamically by the end user. We thought of using apex's standard tabular forms, but they cannot have dynamic columns. We also thought of having manual tabular forms using apex collections, but there is a limitation that the collection can have maximum of 50 character datatypes, 5 numeric, 5 date and 1 each for clob and blob. The number of columns at runtime may exceed these numbers. so we ruled out this. We then thought of using apex websheets. We know that the data can be fetched from Oracle database to websheet reports, but the reports cannot be edited. We know that the data grid gives option to edit the data, but I couldnt find a way to fetch the data from database to it.  I understand that the data in the apex websheets can be queried from apex's meta tables apex$_ws_... views and somehow in a back door way of doing these can be updated to the business tables. But we also need to fetch the data  from Oracle database to the grid. I do not want to insert into the apex$_ws tables as Oracle does not support it. Is there any other possibility?
    Thanks in advance.
    Regards,
    Natarajan

    Nattu wrote:
    Thanks for your reply. Actually it is a data that is fully customized by the end user. These custom attributes are really stored as rows and a complex code returns them as columns at run time. So the number of columns is different user to user based on the number of rows they have.
    They'd never have got that far if I'd been around...
    They now want to edit them in a tabular form as well.
    Well once you've implemented one really bad idea, one more isn't going to make much difference.
    It rather sounds like you've got people who know nothing about relational databases or user interfaces responsible for the design of both. You need to be very, very, worried.

  • JPA: Oracle Sequence Generator not up to date

    Hi,
    I'm using the JPA Oracle Sequence Generator in one of my JPA classes:
    @Entity
    @Table(name = "DACC_COST_TYPE")
    public class JPACostType implements Serializable {
    @SequenceGenerator(name = "CostTypeGenerator", sequenceName = "DACC_COST_TYPE_SEQ")
        @Column(name = "ID_COST_TYPE")
        @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CostTypeGenerator")
        private Integer idCostType;
    In order to persist a new object I perform the following code:
    @PersistenceContext
    private EntityManager em;
    JPACostType myJPA = new JPACostType();
    myJPA.setIdCostType = null;
    em.merge(myJPA);
    em.flush();
    Normally this works fine. But after deploying the app there sometimes happens an error:
    Caused by: javax.persistence.PersistenceException: SQLException while inserting entity {com.karmann.dacc.ejb.busilog.jpa.JPACostType(idCostType=4)}.
    at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.flush(PersistenceContextImpl.java:278)
    at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.beforeCompletion(PersistenceContextImpl.java:565)
    at com.sap.engine.services.orpersistence.entitymanager.EntityManagerImpl.beforeCompletion(EntityManagerImpl.java:410)
    at com.sap.engine.services.orpersistence.environment.AppJTAEnvironmentManager.beforeCompletion(AppJTAEnvironmentManager.java:197)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:232)
    ... 52 more
    Caused by: java.sql.SQLException: ORA-00001: unique constraint (AEMA.DACC_COST_TYPE_PK) violated
    Obviously JPA does not fetch the new key by accessing the Oracle sequence. This documents "next value = 5". Does JPA fetch the new key from its cache? Is there any possibility to avoid this?
    Thanks for each hint,
    Christoph

    Hello Christoph Schäfer  ,
    I am stuck with a similar issue. I was able to save mutiple entries and there has not been much change to my JPA. I added new entities and new sequences.
    Now, I get the error Caused by: javax.persistence.PersistenceException: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.
    I have checked the name of sequence and sequence next val on the DB. It works on DB but when i execute it from ejb, it gives me thsi error. Now, it gives the error for all previously working JPA entities.
    I have also provided allocationSize = 1 for all entities.
    Please let me know, possible cause/solution to this issue.
    thank you.
    Regards,
    Sharath

  • Bulk fetch taking long time.

    I have created a procedure in which i am fetching data from remote db using database link.
    I have 1 million data to fetch and the row size is around 200 bytes ( The table is having 10 attribute sizing 20 bytes each )
    OPEN cur_noit;
    FETCH cur_noit BULK COLLECT INTO rec_get_cur_noit;
    CLOSE cur_noit;
    The problem is it is taking more than 4 hours just to fetch the data.I need to know the corresponding factor and check that factor and most importantly what can be done ...like:-
    1. If the DB link is slow ? how can i check the speed of DB link ?
    2. I am fetching large size so is my PGA full or not used in optimized way ? How can i check the size of PGA and also increase that ? and set the optimum value.
    My CPU usage seems fine.
    Please let me know what else could be the reasons also ?
    *I know i can use Limit clause in Bulk. Kindly let me know if it also could be the reason for my above problem                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Couple of more things:- I am using oracle 9i.
    1.I need to transform the data also(Multiplying column value with fixed integer or setting a variable with another string,local table has couple of more attribute for which i need to fetch values from another table), so it will not be the exact replication.
    2. I will not take all the rows from remote DB , i have a where clause by which i find the subset of what i want to copy.
    Do you think it is achievable by below methods ?
    Apologies, I am novice in this and just googled a bit about the method you suggested.So, Please ignore my noviceness
    Materialzed views:-
    -It is going to make a local copy of whole table there by taking space on my current DB.
    -If i make a materialezed view just before starting copying what difference i would make i.e i am again first copying it from remote db and then i will be fetching from this cursor (materialezed view). I am not sure aren''t we doing more processing now i.e Using network while making materialez view + fetching from this cursor there by taking same memory as previously.
    there is always a possibility of delay in refresh i.e when tuples are changed in remote DB and when i copy in my actual table from materialezed view.
    Merge:-
    I am using bulk collect and BULK Binding FORALL insert in my local table.Do you think this method would be faster and can solve the problem. I have explained above what i am intending to do..

  • Oracle sequence problem in CMP Entity EJB

    I have a problem with Oracle sequence when I am using from the CMP entity EJB in WebLogic
    6.1:
    The problem is when the WebLogic server starts it acquires the correct sequence number
    from Oracle, but during the runtime, when I open a new sqlplus window and increment
    the sequence number, the container is not picking up from the new incremented value
    instead it is still continuining by incrementing the old sequence number it has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xml are exactly
    same
    Any help would be greatly appreciated.

    Change the key-cache-size to 1 in weblogic-cmp-rdbms-jar.xml and then try
    your experiment again.
    -- Anand
    "Satya" <[email protected]> wrote in message
    news:3d06274c$[email protected]..
    >
    I have a problem with Oracle sequence when I am using from the CMP entityEJB in WebLogic
    6.1:
    The problem is when the WebLogic server starts it acquires the correctsequence number
    from Oracle, but during the runtime, when I open a new sqlplus window andincrement
    the sequence number, the container is not picking up from the newincremented value
    instead it is still continuining by incrementing the old sequence numberit has acquired
    when it fetched from Oracle last time.
    The sequence increment and key-cache-size in weblogic-cmp-rdbms-jar.xmlare exactly
    same
    Any help would be greatly appreciated.

  • Fetch from cursor variable

    Hello,
    I have a procedure, which specification is something like that:
    procedure proc1 (pcursor OUT SYS_REFCURSOR, parg1 IN NUMBER, parg2 IN NUMBER, ...);Inside the body of proc1 I have
    OPEN pcursor FOR
      SELECT column1,
                  column2,
                  CURSOR (SELECT column1, column2
                                    FROM table2
                                  WHERE <some clauses come here>) icursor1
          FROM table1
       WHERE <some clauses come here>;In a PL/SQL block I would like to execute proc1 and then to fetch from pcursor. This is what I am doing so far:
    DECLARE
      ldata SYS_REFCURSOR;
      larg1 NUMBER := 123;
      larg2 NUMBER := 456;
      outcolumn1 dbms_sql.Number_Table;
      outcolumn2 dbms_sql.Number_Table;
    BEGIN
      some_package_name.proc1 (ldata, larg1, larg2, ...);
      FETCH ldata BULK COLLECT INTO
        outcolumn1, outcolumn2,...,  *and here is my problem*;
    END;
    /How can I rewrite this in order to get the content of icursor1 ?
    Thanks a lot!

    Verdi wrote:
    How can I rewrite this in order to get the content of icursor1 ?
    Firstly ref cursors contain no data they are not result sets but pointers to compiled SQL statements.
    Re: OPEN cursor for large query
    PL/SQL 101 : Understanding Ref Cursors
    Ref cursors are not supposed to be used within PL/SQL or SQL for that matter, though people keep on insisting on doing this for some reason.
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/static.htm#CIHCJBJJ
    Purpose of Cursor Variables
    You use cursor variables to pass query result sets between PL/SQL stored subprograms and their clients. This is possible because PL/SQL and its clients share a pointer to the work area where the result set is stored.A ref cursor is supposed to be passed back to a procedural client language, such as Java or .Net.
    If you want to re-use a SQL statement in multiple other PL/SQL or SQL statements you would use a view.

  • [nQSError: 17012] Bulk fetch failed. (HY000)

    Hi All,
    Some times my report through's  the following error message:
    ORA-03135: Attached the query which results into an error after running for 31 minutes. Below is the error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 17001] Oracle Error code: 3135, message: ORA-03135: connection lost contact Process ID: 25523 Session ID: 774 Serial number: 19622 at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)
    Please give me the solution.
    Thanks&Regards,
    Nantha.

    I see the irony was lost as your reply remained unprecise and un-informative. "Server side everything ok" - what does that even mean? BI server? Database server? What about the network? What about firewall issues with the expire_time parameter in the sqlnet.ora? Are you working with virtual machines on either side (or both)?
    http://catb.org/~esr/faqs/smart-questions.html

  • Mixing sun-database-binding with Oracle sequences

    Hello,
    I wish to insert rows inside the database, for instance rows representing persons, and rows representing their addresses. Primary keys for both person and address are Oracle sequence based.
    My question is, if I insert a person, then one of her address, how can I retrieve the person ID for the address row to reference it.
    The insert statement for the person is (for the moment) as follow
    insert into Person (PERSON_ID, FIRST_NAME, LAST_NAME) values (PERSON_SEQ.nextval, ?, ?)The problem with this approach is that I never know the person ID, and am unable to make any references to it in the address row.
    I tried to add an operation in the NetBeans generated person table WSDL. This operation would execute this statement:
    select PERSON_SEQ.nextval from dualBut, for the moment, it's a failure.
    Could you provide me with some hints?

    Hi,
    First I would advise you to register and post on the [email protected] alias - you can find the details of how to do this on the OpenESB site..... you'll reach a larger audience this way.
    Second, you need a Stored Procedure in Oracle to do this, then use this from the DB BC, here's one I created which does something similar, i.e. returns a value I'm interested in after an "Update" statement....
    CREATE OR REPLACE PROCEDURE "NEXTAPPNUMFINDER" (nextAppNum OUT NUMBER)
    IS
    BEGIN
    UPDATE ACTIVE_APPLICATION_NUMBER
    SET APPLICATION_NUMBER_NEXT = APPLICATION_NUMBER_NEXT + 1
    RETURNING APPLICATION_NUMBER_NEXT
    INTO nextAppNum;
    END;
    Hope this helps
    Mark

  • Using oracle sequence in SQL Loader

    I'm using oracle sequence in control file of sql loader to load data from .csv file.
    Controlfile:
    LOAD DATA APPEND
    INTO TABLE PHONE_LIST
    FIELDS TERMINATED BY "," TRAILING NULLCOLS
    PHONE_LIST_ID "seqId.NEXTVAL",
    COUNTRY_CODE CHAR,
    CITY_CODE CHAR,
    BEGIN_RANGE CHAR,
    END_RANGE CHAR ,
    BLOCKED_FREE_FLAG CHAR
    Datafile:
    1516,8,9,9,B
    1517,1,1,2,B
    1518,8,9,9,B
    1519,8,9,9,B
    1520,8,9,9,B
    1521,8,9,9,B
    1) As first column uses oracle sequence, we have not defined that in datafile.
    This gives me error "Can not insert NULL value for last column"
    Is it mandatory to specify first column in datafile, even though we are using sequence?
    2) Another table is referencing PHONE_LIST_ID column (the one for which we using sequence) of this table as a foreign key.
    So is it possible to insert this column values in other table simultaneously? Sequence no. should be same as it is in first table...
    Kindly reply this on urgent basis....

    use BEFORE INSERT trigger
    with
    select your_seq.nextval into :new.id from dual;

Maybe you are looking for

  • Install modssl-2.8.22 on Solaris 9

    I am installing apache 1.3.33 on solaris 9, with modssl 2.8.22. configure, make comes back with following error. Can some one help me find what is going on here. Does this mean I dont have good compiler or ./configure \ --prefix=/usr/local/apache-1.3

  • Bad sound after installing Leopard

    After my Leopard install the iTunes sound is horrible. It sounds like AM radio ... When I play the same song over Frontrow it sounds fine.... What could be wrong? Ch

  • Strange white boxes behind text.  Help!

    I am in the middle of working on a very important document.  In one section, an autobiographical section, I added sidbars.  The background of text box is grey.  Everything looked great, including when I printed last.  Today when I was working on the

  • OS 10.5.6 and Palm Desktop

    Palm Desktop quits every time I try to drag or click/drag an event from one date into another.  Anyone else noticing this? Post relates to: Treo 680 (Cingular)

  • Supressing Dos window on executing system command

    Hey, is there any way to supress the dos window when I call a system dependent .exe or bat file? AND is there any way to run a .exe file as a background process so that no window of it pops up? I use the Runtime.exe() to execute the system command bu