Select sequences number in a Query

I am facing problems while selecting the Sequence Number in a query.
create or replace view vfilemanifest as
(select abc.* , ts.* from (select filemanifestid.nextval from dual) abc ,
( select distinct batchid,custodianid from
tbatch tbat ,tcustodians tcstd, EXT_TAB_MASTERS ext_tab
where tbat.batchname = ext_tab.batchname
and tbat.batchpath = ext_tab.batchpath
and tcstd.custodianname = ext_tab.custodianname
and tcstd.custodianadd = ext_tab.custodianadd
)ts )
SQL> /
(select abc.* , ts.* from (select filemanifestid.nextval from dual) abc ,
ERROR at line 2:
ORA-02287: sequence number not allowed here
Please Advice
Regards
Sushant

I'm sorry but that doesn't make it any clearer to me. This
using External Tables , View , Collection , bulk collect and Forall Insert is an implementation, not a business requirement. You might find some enlightenment in want to create a pl/sql table type dynamically I answered.
Anyway, I think what you want to do is this: (warning, untested code ahead!)
DECLARE
   TYPE lrec IS RECORD (
       id NUMBER,
       batchid tbatc.batchid%TYPE,
       custodianid tcustodians.custodianid%TYPE);
   TYPE ltab IS TABLE OF lrec;
   llist ltab;
BEGIN
   SELECT abc.* , ts.* BULK COLLECT INTO llist
   FROM  (select filemanifestid.nextval from dual) abc
         , ( select distinct batchid,custodianid
             from   tbatch tbat ,tcustodians tcstd, EXT_TAB_MASTERS ext_tab
             where tbat.batchname = ext_tab.batchname
             and tbat.batchpath = ext_tab.batchpath
             and tcstd.custodianname = ext_tab.custodianname
             and tcstd.custodianadd = ext_tab.custodianadd
           )ts 
END;
/Cheers, APC

Similar Messages

  • Create Sequence Number with Select Query

    Hi All,
    I would like to create a sequence number in oracle but instead of hard coding the "start with" I want to select the max value of the primary key of a table and add 1 and use this instead:
    So what I want is:
    CREATE SEQUENCE crg_mrec_seq
    MINVALUE 1
    MAXVALUE 999999999999999999999999999
    START WITH select max(primarykey)+1 from table1
    INCREMENT BY 1
    CACHE 20;I'm guessing I need to pass this max value as a variable into the create sequence number but I'm not sure what syntax to use.
    Thanks,
    Ed

    spalato76 wrote:
    Hi All,
    I would like to create a sequence number in oracle but instead of hard coding the "start with" I want to select the max value of the primary key of a table and add 1 and use this instead:
    So what I want is:
    CREATE SEQUENCE crg_mrec_seq
    MINVALUE 1
    MAXVALUE 999999999999999999999999999
    START WITH select max(primarykey)+1 from table1
    INCREMENT BY 1
    CACHE 20;I'm guessing I need to pass this max value as a variable into the create sequence number but I'm not sure what syntax to use.
    Thanks,
    Edconstruct SQL statement & then EXECUTE IMMEDIATE

  • Wrong sequence in selection screen generated by ABAP Query

    Hi,
    I am developing a query to display the data in the view.
    My query has 8 selection fields totally.
    As part of my requirement I have added selection parameter in the
    selections tab of the infoset and maintained the sequence as 9.
    Inspite of maintaining the sequence number as 9 in the infoset, It is
    appearing first in the selection screen of the query.
    I tried putting different numbers in the sequence number, but even it
    is appearing first in the selection screen.
    Can you please let me know how to display the selections declared in
    the infoset as per the sequence required.
    Thanks,
    Madhuri.

    Actually what happen when you declare your own fields in ABAP query . you have to care about the sequence . As an example if you’re selecting lets say state name , you have two variables
    <b>1-state
    2- land</b>
    for state you have to select land first , if your state is first and land is 2nd it gave you the error of sequence .
    Because you have to get data in land first in order to get state specific to the land .
    it should be
    1-Land
    2-State
    Just see the your fields , I’m sure you’re missing that .
    <b>You can also see the NO ( field ) in Query ( Sq03 ) . where you can define the seqence on selection.</b>
    hope this’ll help you .
    Pl...Award the points .
    Thanks
    Saquib<b></b>
    Message was edited by: Saquib Khan

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

  • Sequence number different in DB than from assignSequenceNumber()

    I am using TopLink 10.1.3 DP4 (I think - inside JDev build 3565). I am attempting to use a sequence in a schema that I DO NOT OWN - I cannot make modifications tot he database sequence because there are other applications in place running against it.
    The database sequence is in a 10g database, with an interval of 1 and a cache of 20.
    My object uses the value of the sequence as the sole element of its primary key. I am creating a new object, registering it with a UnitOfWork using registerNewObject(obj). It seems that this does not make a clone, since the object returned by this method is the same identity as the object passed in.
    My project sequencing policy is set as follows:
    <project-sequencing-policy>
    <sequencing-policy>
    <preallocation-size>1</preallocation-size>
    <sequencing-type>Use native sequencing</sequencing-type>
    <name-field-handle>
    <field-handle/>
    </name-field-handle>
    <counter-field-handle>
    <field-handle/>
    </counter-field-handle>
    <sequencing-policy-table></sequencing-policy-table>
    </sequencing-policy>
    </project-sequencing-policy>
    Platform is 10g
    <platform-name>Oracle10g</platform-name>
    The sequence is accessed through a synonym (since JDev couldn't seem to reference a sequence in a different schema from a user's login).
    <sequence-number-name>EVENT_SEQ_SYN</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    When I commit my new object, I can see the insert statements in the log claiming a value of 'x' for the primary key. The row in the database actually has a primary key of 'y', where 'x = y - preallocation size' and 'y = sequence last number - preallocation size'. I think I would get the right number if I could set the preallocation size to 0 (performance problems understood) but TopLink chokes on this at run-time.
    Is this problem familiar to anyone?
    Failing using native sequencing, I tried to write custom SQL for the insert statement, but I couldn't find any decent examples anywere on how to do that. I found in a deep google search an example that showed you could use hash (#) to reference the value of a property, but what if the value that needs to be inserted in the database is held in an indirect referenced object? For example, if I was trying to write an insert sql for a Pet object with an indirect reference (valueHolder) to its owner, and I needed to put the owner id in the row - how would I write that insert statement in the 'custom sql' pane in workbench?
    Thanks for your help.
    Dave

    Very strange case.
    I tried to reproduce it using TopLink Employee example - and couldn't.
    Here's the code:
        //  to get debug info
        session.setLogLevel(SessionLog.ALL);
        session.login();
        UnitOfWork uow = session.acquireUnitOfWork();
        Employee emp = new Employee();
        emp.setFirstName("sequencingTest");
        uow.registerNewObject(emp);
        uow.assignSequenceNumber(emp);
        uow.commit();
        System.out.println("firstName = "+emp.getFirstName() +"; id="+ emp.getId());And here's the log:
    [TopLink Info]: 2006.01.26 04:49:05.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060116)
    [TopLink Config]: 2006.01.26 04:49:06.171--DatabaseSessionImpl(18)--Connection(19)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
         platform=>Oracle9Platform
         user name=> "test"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:orcl"
    [TopLink Config]: 2006.01.26 04:49:10.140--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:orcl
         User: TEST
         Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.1.0.4.0
    [TopLink Finest]: 2006.01.26 04:49:10.625--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence PROJ_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence ADDRESS_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence EMP_SEQ: preallocation size 1
    [TopLink Info]: 2006.01.26 04:49:11.453--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])-- login successful
    [TopLink Finer]: 2006.01.26 04:49:11.703--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--acquire unit of work: 48
    [TopLink Finest]: 2006.01.26 04:49:11.703--UnitOfWork(48)--Thread(Thread[main,5,main])--Register the new container bean Employee: sequencingTest
    [TopLink Finest]: 2006.01.26 04:49:11.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2006.01.26 04:49:11.750--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--SELECT EMP_SEQ.NEXTVAL FROM DUAL
    [TopLink Finest]: 2006.01.26 04:49:12.328--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing preallocation for EMP_SEQ: objects: 1 , first: 3,469, last: 3,469
    [TopLink Finest]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--assign sequence to the object (3,469 -> Employee: sequencingTest )
    [TopLink Finer]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.421--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2006.01.26 04:49:12.437--UnitOfWork(48)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(Employee: sequencingTest )
    [TopLink Finest]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Thread(Thread[main,5,main])--Assign return row DatabaseRecord(
         EMPLOYEE.VERSION => 1)
    [TopLink Fine]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, GENDER, END_DATE, START_DATE, MANAGER_ID, START_TIME, END_TIME, ADDR_ID, VERSION) VALUES (3469, NULL, 'sequencingTest', NULL, NULL, NULL, NULL, {t '09:00:00'}, {t '17:00:00'}, NULL, 1)
    [TopLink Fine]: 2006.01.26 04:49:12.640--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO SALARY (SALARY, EMP_ID) VALUES (0, 3469)
    [TopLink Finer]: 2006.01.26 04:49:12.781--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--release unit of work
    firstName = sequencingTest; id=3469
    If I understood correctly, the problem is x showing up in insert as a value to be assigned to PK and y actually inserted into the db. If that's the case could there be a BeforeInsert trigger on the table? To test try inserting through jdbc using concrete pk value.

  • Sequence Number does not allowed here

    Hi,
    I am inserting rows in a table called membership with seqence number membership_id.nextval. But i am getting error like
    "Sequence number not allowed here"
    Before i inserted about 3852 rows in that table
    Here is the statement i am using
    INSERT INTO MEMBERSHIP (membership_id,ACTIVIST_ID,G_N_ID,ROLE_ID,
    REGION_ID,START_dATE,END_DATE,STATUS,state_id)
    SELECT membership_id.nextval,a.activist_id,G.g_n_id,R.ROLE_ID,
    '',mwlgmemship.start_date,'','Active',''
    FROM activist a,
    role r,
    group_network g,
    final.mwlgmemship mwlgmemship,final.mwlgmem mwlgmem
    WHERE
    a.first_name=mwlgmem.fname and a.last_name=mwlgmem.lname and a.c_zip_code=mwlgmem.czip and
    a.c_country=mwlgmem.country and mwlgmem.person_id=mwlgmemship.person_id and
    to_char(mwlgmemship.grno)=g.g_n_reference and mwlgmemship.role_id=r.role_id order by r.role_id
    I could not understand the problem, please help me
    I am selecting the other fields from other tables.
    Thanks
    Srinivas

    Restrictions on Sequence Values You cannot use CURRVAL and NEXTVAL in the following constructs:
    A subquery in a DELETE, SELECT, or UPDATE statement
    A query of a view or of a materialized view
    A SELECT statement with the DISTINCT operator
    A SELECT statement with a GROUP BY clause or ORDER BY clause
    A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator
    The WHERE clause of a SELECT statement
    The DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement
    The condition of a CHECK constraintAbove text is from the sql reference manual.
    HTH
    Regards
    Raj

  • Enq: TX - row lock contention in forms 10g sequency number generation

    Iam Getting the Deadlock issue in oracle formdeveloper 10g database is 11g Acutually in our small Hospital organization using different forms generating entrying labrequest form finally save time
    one sequency number will generated i have give procedure below every save criteria form using below procedure some time iam getting lock iam using blocksession query i have find out some
    OSUSER
    MACHINE
    TERMINAL
    PROGRAM
    SQL_ID
    LOGON_TIME
    BLOCKING_SESSION_STATUS
    BLOCKING_SESSION
    EVENT
    user423
    UMCCDOM\LEVEL4-MICU
    LEVEL4-MICU
    PrjMcr.EXE
    0ccngw7dfkmgb
    23/09/2013 11:34:41 AM
    VALID
    277
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    23/09/2013 11:32:50 AM
    VALID
    186
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    22/09/2013 2:49:47 PM
    VALID
    277
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    23/09/2013 7:00:22 AM
    VALID
    186
    enq: TX - row lock contention
    user290
    UMCCDOM\LEVEL2-N
    LEVEL2-N
    PrjMcr.EXE
    0ccngw7dfkmgb
    23/09/2013 10:28:06 AM
    VALID
    277
    enq: TX - row lock contention
    lock are happen after open the code i have find out used FOR UPDATE in procedure please tell me any alternative for this every labrequest form saving time using this procedure for generating prefix sequence number multiple user using with different systems
    PROCEDURE   Gsp_GenSeqNum (I_SvPrefixCd IN VARCHAR2,I_SvUserName IN VARCHAR2,
                              O_SvSeqNum OUT VARCHAR2) IS
    --This Procedure generates the sequence number
    --by retrieving the prefix based on the code
    --supllied to the procedure.
      CURSOR  crSeqGenerator IS
             SELECT Gsn_prefix_last_num, Gsn_prefix_year
                FROM G_SEQUENCE_NUMBER
             WHERE Gsn_prefix_Cd = I_SvPrefixCd
                   AND Gsn_prefix_year = TO_CHAR(SYSDATE,'YYYY')
      FOR UPDATE OF Gsn_prefix_last_num;
      udSeqNum        G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
      udNextSeqNum    G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
      udYear          G_SEQUENCE_NUMBER.Gsn_Prefix_year%TYPE;
      udPrefix        G_SEQUENCE_PREFIX.Gsp_Prefix_Value%TYPE;
    BEGIN
      SELECT Gsp_Prefix_Value
      INTO udPrefix
      FROM G_SEQUENCE_PREFIX
      WHERE Gsp_Prefix_Cd = I_SvPrefixCd;
      OPEN crSeqGenerator;
      FETCH crSeqGenerator
       INTO udSeqNum,
            udYear;
      IF crSeqGenerator%FOUND THEN
         udNextSeqNum  :=udSeqNum + 1;
         O_SvSeqNum     := udPrefix||'/'||TO_CHAR(SYSDATE,'YY')
                                   ||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
      ELSE
    INSERT INTO G_SEQUENCE_NUMBER VALUES(I_SvPrefixCd,TO_CHAR(SYSDATE,'YYYY'),0,I_SvUserName,SYSDATE);
         udSeqNum      :=0;
         udNextSeqNum  :=udSeqNum + 1;
         O_SvSeqNum:=UdPrefix||'/'||TO_CHAR(SYSDATE,'YY')
                             ||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
      END IF;
      UPDATE G_SEQUENCE_NUMBER
         SET Gsn_Prefix_last_num=udNextSeqNum
       WHERE Gsn_Prefix_Cd = I_SvPrefixCd
         AND Gsn_Prefix_year=TO_CHAR(SYSDATE,'YYYY');
      CLOSE crSeqGenerator;
    END Gsp_GenSeqNum;
    Thanks
    subbu

    This application is inbuit with some modules VB (cath ,cardio)and oracle forms for required sequence number generation different time used this procedure whereever required the sequence Prefix generation.If i replace the procedure sequene to oracle standard sequency if the user cannot save the form unnessary sequency generated order is missing from sequence.

  • Generating Sequence Number

    Hi,
    I have created a Query form. I had displayed the sequence number of the record displayed by selecting rownum from the table.
    Now I have added a order by clause in the query. So the rownum is not displayed in the order.
    I have created a small procedure to generate the sequence number.
    I would like to know from which trigger I should call this procedure.
    procedure resequence is
    v_cursor_record number;
    v_position number;
    begin
    v_cursor_record := to_number(:system.cursor_record);
    v_position := v_cursor_record;
    loop
    :detail.item := v_position;
    v_position := v_position + 1;
    exit when :system.last_record = 'TRUE';
    Next_record;
    end loop;
    go_record(v_cursor_record);
    end;

    Thanks for your reply. I have tried this method.It assigns value only for the first record in the block. As the post query trigger is not passing the control to other items ,though more than 10 records are fetched the sequence is generated only for the first record.
    Any other method to achieve this?

  • Need SQL statement to generate a sequence number in the output rows

    Hi folks. I need to create an SQL statement that generates a sequence number column in the output rows (records) such that the first returned row has this column set to 1, second returned row has the column set to 2, etc.
    For example, consider the query:
    SELECT income from employees WHERE income != 20000 ORDER BY income;
    If employees.income contains 60,000, 20,000, 35,000, and 19,000 for respective rows, the output would be this:
    19,000
    35,000
    60,000
    I would like the SQL to also return a sequence number that is computed across the returned rows, resulting in two output columns:
    1 19,000
    2 35,000
    3 60,000
    Is there a simple SQL function that generates the sequence number, in order, and only for the returned rows? Or is there another way?
    I'm stumped. Any help is appreciated! Thanks!
    - Jack Cochrane

    Hi,
    Welcome to the forum!
    Use ROWNUM, like (example):
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> select rownum, first_name from (select e.first_name from employees e where e.first_name like 'J%' order by e.first_name);
        ROWNUM FIRST_NAME
             1 Jack
             2 James
             3 James
             4 Janette
             5 Jason
             6 Jean
             7 Jennifer
             8 Jennifer
             9 John
            10 John
            11 John
            12 Jonathon
            13 Jose Manuel
            14 Joshua
            15 Julia
            16 Julia
    16 rows selected
    SQL> But rememeber if you want to be sure of unique numbers in certain field is better to use sequences and use seq_name.nextval each time you need.
    Regards,

  • How to Create a Sequence Number from BI Publisher Layout editor?

    How to Create a Sequence Number (1,2,3,4,......,etc) from BI Publisher Layout editor

    Thank you for your replay, but <?position()?> we can used it in template builder only not from BI layout editor
    I found a solution in this case we can used the following query.
    SELECT
    ROW_NUMBER() OVER(order by item_status) as Row,

  • Insert Select sequence.nextval Problme

    Hi,
    I am trying to insert records in the table using query similar to
    insert into table1 (id, col1, col2)
    select
    sequence.nextval
    t1. col1, t1.col2
    from table t1;
    I am getting following error
    ORA-02287: sequence number not allowed here
    Will you please let me know how to resolve this?
    Regards
    ~Pravin

    Hmm...
    See here ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>
    satyaki>create table ff_gg
      2      (
      3        a_col   number(5),
      4        b_col   varchar2(30)
      5      );
    Table created.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>
    satyaki>create sequence dd_qq
      2     start with 1
      3     increment by 1;
    Sequence created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>insert into ff_gg
      2     select rn, ename
      3     from (
      4            select dd_qq.nextval, ename
      5            from emp
      6          );
              select dd_qq.nextval, ename
    ERROR at line 4:
    ORA-02287: sequence number not allowed here
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
      1  insert into ff_gg
      2     select dd_qq.nextval rn, ename
      3     from (
      4            select ename
      5            from emp
      6*         )
    satyaki>/
    12 rows created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from ff_gg;
         A_COL B_COL
             1 WARD
             2 MARTIN
             3 SCOTT
             4 KING
             5 TURNER
             6 ADAMS
             7 JAMES
             8 FORD
             9 MILLER
            10 Smith
            11 Glen
         A_COL B_COL
            12 boock
    12 rows selected.
    Elapsed: 00:00:00.00
    satyaki>Got me?
    Regards.
    Satyaki De.

  • Sequence number not allowed

    Sequence Pseudocolumns
    See restrictions on sequences. 
    Restrictions on Sequence Values You cannot use CURRVAL and NEXTVAL in the following constructs:
    A subquery in a DELETE, SELECT, or UPDATE statement
    A query of a view or of a materialized view
    A SELECT statement with the DISTINCT operator
    A SELECT statement with a GROUPBY clause or ORDERBY clause
    A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator
    The WHERE clause of a SELECT statement
    The DEFAULT value of a column in a CREATETABLE or ALTERTABLE statement
    The condition of a CHECK constraint
    Which rule am I breaking here, is there an implied GROUP BY as Im using the aggregate function even though its not specified?
    create table t10
    (col1  number,
    col2 number);
    insert into t10
    values (null,1);
    insert into t10
    values (null,2);
    create sequence s_test;
    select s_test.nextval from dual;
    1
    select nvl(sum(col1),999) from t10;
    NVL(SUM(COL1),999)
                   999
    select nvl(sum(col1), s_test.nextval) from t10
    ERROR at line 1:
    ORA-02287: sequence number not allowed here

    Docs can have bugs, yes. That wouldn't be the first time.
    It could be very tedious to give all and every cases where nextval should not work, I'm sure there're other cases.
    Well, unless you have plenty time to spend solving the docs problems, you may want to rewrite your code to make it work. Much easier, and mush faster than going through the support to know which is right between doc and Oracle code. I'd tend to think about the 2nd though, since we are talking about an aggregate.
    What about :
    select nvl(mysum, s_test.nextval) from (select sum(col1) mysum from t10);
    Nicolas.

  • How to pass the sequence number of current loop in a for loop in FPGA vi to the host

    PCI-7830R
    LV 8.2
    What I was trying to do is to use multiple DIO to generate pulse at different sequence. Mode one is to automatically sweep from DIO1 to DIO20; mode 2 is several DIOs generate pulse simoutaneously.  So I use a case structure to make the selection, in the mean time, I set up two for loop in each case so that I can use multiple pulse generations. For example, in scanning mode, if I set 2 exposures, it sweeps from 1 to 20 then do it again.  
    Then I need to get the loop sequence number, i of each scenario. So I put an indicator within the first loop, and create a local variable of it and put in the second one.  Running the FPGA vi alone, I can see the indicator change in each case from 0 to N-1, N being the for loop time.But in the host vi, I tried to add this indicator as an element in the read/write invoke method, in the debugging mode, I could only see it directly jump to N-1 without all the changes I saw in FPGA vi. 
    Is it possible to get this number passed correctly from FPGA vi to the host vi? Thanks

    Thanks for the reply Jared.
    Excuse me if it looks incorrect, but I'm new to FPGA programming, so I would have to look into the FIFO you referred to.  I used local variables because for one thing I have several different cases containing for loop in each of them, and I only want one indicator for the "i".  If I put the indicator out of any for loop, it's only gonna show the last number which is N-1.  For the other thing, it seems like property nodes are not allowed in FPGA vi.  And by doing this, I can see the i number changing from 0 to N-1 in each case, well, in FPGA vi's front panel.  But while I ran the host vi with everything, the indicator in host vi's front panel only showed the last number N-1. It may be the reason you said, it happened too fast before the indicator in host vi can catch it.
    What I want to realize is to group the data I collect in host vi, for example, when I choose multiple exposure in each mode, and the FPGA runs 1 through 20 then do it again, I want the data stored in two groups using the loop sequence number as the seperator in file name.  So it goes like 1-1, 2-1.......20-1; then 1-2, 2-2,.....20-2.

  • Error While Generating Sequence Number. Contact your system Administrator

    Hi All,
    I have developed a form to provide our client with 'an easy to fill' User Interface. This form will be used instead of the standard form present in Business Suite.
    Some columns of the table, on which form is based, are getting populated via generation of sequence numbers.
    Now the problem is, after deploying custom form developed by me in the instance, Standard form is showing this error
    " Error While Generating the Sequence Number. Please contact the System Administrator "
    I am unable to trace why this error had started appearing..
    Any suggestions would be of great help...
    Thanks in Advance,..

    Forms version 6i,
    Database version 9.2.0.6.0
    Sequences which I am using are used there in Standard form also..
    So evrytime i need to save the record, I am selecting NEXTVAL of it into
    the respective item of the datablock..

  • Batch rename with minimum numeber of digits in sequence number

    I'm pretty sure I remember this working how I wanted in previous versions of Bridge, but at least since cs4, it has not worked as I would like. I've tried searching for an answer or a setting that I'm missing, but have come back empty-handed.
    Here's my situation. Let's say I'm renaming 18 files. Each file has a sequence number. I want the sequence numeber for the first 9 to be one digit, and for the second nine to be 2 digits.
    i.e. image_1.jpg, image_2.jgp, image_3.jpg...image_10.jpg, image_11.jpg...
    The best way I've found that I can do this is to select all 18 images, and assign a 2-digit sequence number. Then, once that is complete, select the first 9 and repeat, but with a 1 digit number.
    In the past, I could select all 18 images, and choose a 1 digit number, and after 9, it would switch to 10, instead of going back to zero. Is there still a way to do that? I know it's only one extra step, but that one extra step is actually kind of two, because each time I have to reset tho starting number back to 1 or 10, and switch the setting from 2-digits to 1-digit and back again. And I usually have to rename multiple groups of files at once, so it does add up. Granted, much better than renaming one at a time, but not as convenient as I feel it could be, and as it once was.
    Am I missing something?
    Thanks,
    iLan

    While I certainly can understand the way in which computers work, I also understand that in a program as complex as any of the components in Adobe's Creative Suite, there is most certainly a way to override the computer's numerical logic so that it can remove the initial "0" from a 2-digit number. Granted, that may not be possible in the current version of Bridge, theoretically it is "Possible". And I'm quite sure it functioned that way in previous versions, although I really don't know which version I was using when it worked that way. Maybe cs2?
    As a developer, the whole reason for this question is to avoid having to create extra code in my applications to add an unnecessary "0" to digits 0-9 in any filenames of any files I want to load. Although it looks as though adobe changed the default behavior of the batch rename function, and removed (or in some peoples' minds improved) some functionality without an option to get it back.
    Unfortunately for me anyways...
    Thanks for the help,
    ilan

Maybe you are looking for

  • Error in Archive & Install and PB not booting now.

    I have a PB G4 with OSX Tiger 10.4.11. After doing an auto-update of QT, there was a "shared library error" that prevented me from opening word, excel....I decided to perform Archive & Install. The installation process was going well until a message

  • Exporting linked images with overlays

    Hi, I'm using InDesign CS5.5 on OS X Lion. I have linked images in my InDesign document that I want to export as JPG and maintain the original file naming scheme. That part is easy (export as HTML, look in the images folder; export as ePUB, look in t

  • Automatic 'return' after a paragraph

    It seems to me TLF automatically inserts a 'return' between two paragraphs. So if the first paragraph ends with a return, you get two empty lines between the paragraphs. Is this a correct assumption? I have been working around this by deleting the la

  • Burning Books iTunes for Windows (XP with SP3)

    Burning books takes quite a while. As I can not burn and use my PC for other things at the same time, is it possible to stop the multiple disk burning process (at the end of one of multiple disk burns), close iTunes and then pick up the burning proce

  • Plan driven procuremnt

    Hi, "Plan Driven Procurement" transfers Purchase requisitions created in the backend system(ERP) to SRM and subsequent processing takes place. Does the plan driven scenario also transfer Pur Req for services to the SRM system? The table V_T160EX allo