Sequence number current session

hi sir,
wanna ask,
i use select seq_name.currval from dual is not working it ask to define in current session if i use .nextval then use currval then it works,,,even this is not first time increment,,,,so is there anyway to use currval without use nextval.?
thanks in advance

can u use like this?
select last_number-increment_by
from user_sequences
where sequence_name = 'UR_SEQ';
Message was edited by:
        jeneesh                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Get Current session number in J2ee

    Hi
    we developed a new application using J2EE with JDeveloper 10.1.3 , the
    application deployed to Oracle Application server 10.1.3 , How can i get the
    current number of JDBC connection and the number of session in my
    application , i want to make a check in the application ( login page ) to the
    number of the connection so that i can display a message to the client (
    like come back later , ) which is better to check the http session number or
    the database connection (JDBC) , any suggestion????????????
    Thank's in advance

    Hi,
    the session is instance specific and wont give you any information about the number of parallel sessions. Same for the connection. What you can do is to write a bean that you put in application scope and that you use as a counter. All application instances will have access to it. So each new launched application will add +1 to the counter. However, you will need to sort out how to detect when a client disconnects to clean up the counter with a -1
    Frank

  • Doubt about CURRENT LOG SEQUENCE NUMBER

    I just want to know that why the "current log sequence number" is added to the header of each data file ? why oracle needs to do that ? as it is also added to the control file and whenever it needs to know the current log sequence number , it can get it from control file , then why to add this in the header of data files ?

    For Recovery.
    When you are doing a Recovery of a database where the datafiles have been restored from backups but the controlfile has been recreated (thus, the controlfile has no information about log sequence numbers and checkpoint scns), the Recovery must read this information from the datafile headers.
    Say you have 5 datafiles and they have been backed up 6 months ago using ALTER TABLESPACE BEGIN BACKUP commands and, therefore, have different checkpoint SCNs. The checkpoint SCNs could be 1021, 1059, 1085, 1745, 2045.
    How would Oracle know which Log Sequence Numbers are needed ? It knows that a Recovery must start with SCN 1021. But if the information about Log Sequence Numbers is not available in the controlfile (either because it is as of today and the controlfile doesn't store information about 6 months of redo logs OR because the controlfile has been recreated), what is the Log Sequence Number corresponding to that SCN 1021 ?
    That information is available in the datafile header. You will NOT see it in V$DATAFILE or V$DATAFILE_HEADER. You will not see it in a level 1 dump of datafile headers.
    You will see an example here :
    http://web.singnet.com.sg/~hkchital/Incomplete_Recovery_with_BackupControlfile.doc
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Current log sequence number

    i have a small doubt :
    when there is log switch , the current log sequence number is stored in the control file . Is the same current log sequence number stored in the headers of the datafiles??????
    waiting for your answers eargerly.....
    kumaresan.M

    nops i don think so.
    there is no need for doing this, only controlfile needs to know about the current sequence number
    Regards

  • HOw to find number of bind variables declared in current session

    Hi All,
    I want know a query to find out the number variables declared in current session.

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated [SQL And PL/SQL|https://forums.oracle.com/forums/forum.jspa?forumID=75] forum (you've posted there before).
    Regards,
    K.

  • 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.

  • Possible to check number of current sessions ASR is handling?

    Hi all,
    Can i know if there is a command that i can run on my ASR1004 to check how many sessions from external is accessing or trying to access my network?
    TIA!

    Hi Karan,
    Thk you for prompt response. I know i can configure netflow and use GUI to see the source and destination.
    But what i like to know is if there is a command there allow me to see the number of sessions in and out of my router? Thk you!

  • Possible to get SID of current session when not logged on as SYS

    I would like to get teh SID of my current session, but access to V$MYSTAT is restricted:
    conn user/******@DB
    SQL> desc v$mystat
    ERROR:
    ORA-04043: object "SYS"."V_$MYSTAT" does not exist
    SQL> conn sys/******@DB  as sysdba
    Connected.
    SQL> desc v$mystat
    Name                                      Null?    Type
    SID                                                NUMBER
    STATISTIC#                                         NUMBER
    VALUE                                              NUMBERThanks

    Can you use [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions165.htm#i1038176]SYS_CONTEXT for getting DB_NAME, INSTANCE_NAME, SID etc?

  • Limit the number of session per user in the Wired dot1x environment with ISE 1.2

    Hello,
    I need to check if there is any configuration/workaround to limit the number of sessions/access per user in the Wired dot1x configuration.
    I need to check if this feature is available or not to solve the following scenario:
    I have 2 SW ports configured to use dot1x authentication with ISE 1.2 server.
    If user A connects to the 1st port and authenticated then he will placed on a VLAN based on the authorization profile.
    The case, that I need to deny the same user to connect on a different machine with the same credentials.
    The ISE itself does not have this feature currently,  the only feature available is to limit the number of sessions for the guest user.
    Is there any workaround on the Cisco switches to solve this? Cisco WLC has this feature and for the VPN we can limit the number of sessions also from the ASA itself.
    Thanks.

    limit number of session per user using wired dot1x is not available in 1.3

  • 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

  • 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.

  • A sequence number error in a form

    I am currently creating a form with a sequence number in forms 10g
    <pre>
    table name: emp
    table desc: emp_id number,emp_name varchar2(20),emp_no number
    </pre>
    i have to generate the emp_id automatically.
    <pre>
    create sequence emp_seq
    minvalue 1
    start with 1
    increment by 1
    cache 20
    </pre>
    I use pre_insert trigger in block
    <pre>
    begin
    select emp_seq.nextval into :emp.emp_id from dual
    end
    </pre>
    problem;
    I can not insert a record because of sequence number in :emp.emp_id
    no compilation error but there is no automatic sequence number appeared in :emp.emp_id after run a form.
    It used to work before(fine with automatic sequence number in :emp.emp_id).
    it happens after I changed layout format and someone add more columns in emp table.
    eventhough i did not use sequence number in emp.emp_id
    in pre-insert-trigger
    <pre>
    begin
    select nvl(max(emp_id),0)+1
    into :emp.emp_id
    from emp;
    </pre>
    still can not show up any number in :emp.emp_id
    please help me out

    Thank you . It works now.
    would you mind explain to me; what I can not use automatic sequence number in emp.empid text field in pre-insert-trigger in my case
    is it trigger confliction in my forms?

  • Table Sequence number

    Hi All,
    I have a scenario which goes like this:
    We have a common table(Table1) in our DB which maintains the sequence numbers(we are not using oracle supplied db sequence).
    For every transaction we are using the current sequence number from the table Table1 and put in Table2, while saving
    we increment that number by 1 in Table1 for next transactions use. For every transaction the sequence number should be unique.
    At any point of time a record with same sequence number should not be inserted in Table2.
    In Table2 this sequnce number is not a unique column.
    To achieve this, we are checking using view object whether current sequence num already exists in Table2 before saving.
    If exists we refresh with new number from Table1. In normal scenario this works fine.
    But if concurrent users are accessing, there are cases where same sequence number getting inserted in the Table2
    with a time difference of 2 seconds or so(very short span, hence programmatic check fails).
    We are unable handle this case using programmatic check of records in table.
    Cany any one suggest the best solution possible to tackle this scenario.
    Thanks,
    Sanjaykar

    sanjaykar,
    Unless you use locking on the "sequence number generator" table, you WILL at some time get duplicates when two people try to insert at nearly the same time. Sounds like you are going for the infamous "gap-free sequence." My honest and not sarcastic nor facetious suggestion would be to go with a sequence number and abandon your approach.
    However, if you insist, you can do this by locking the row in the sequence generator table. You can do this in Oracle by using the FOR UPDATE clause of the SELECT statement like this:
    select current_value
    from my_sequence_table
    where sequence_name = 'foobar'
    FOR UPDATEThat will lock the row. You can then increment the number, specify it as your key value, update the current_value in your sequence table and commit. If another user jumps in around the same time, the SELECT FOR UPDATE will block, as the row is already locked. However, I cannot stress enough that if you are looking for a high-performance application, one that lets more than one person work at the same time, this is a horrible idea. Just pop over to http://asktom.oracle.com and search for gap-free sequences to read plenty of long discussions why.
    Best,
    John

  • How to identify current session id (SID)?

    How can a user identify their current session id if auditing is not enabled and account has connect role only? select * from v$mystat where rownum = 1; Fails (ora-942).

    I think this is going to be difficult. I've included a completely convoluted idea I thought of using just CONNECT accessible objects (looking on a 9.2 database). You can't make this a stored procedure though (no direct privileges). I'll be interested to see if someone can come up with something easier.
    declare
      rindex binary_integer := dbms_application_info.set_session_longops_nohint;
      slno binary_integer;
      usid varchar2(24) := dbms_session.unique_session_id;
      mysid number;
    begin
      dbms_application_info.set_session_longops(rindex, slno, 'get_sid:' || usid);
      select sid
      into mysid
      from v$session_longops
      where opname = 'get_sid:' || usid
        and rownum = 1;
      dbms_output.put_line(mysid);
    end;Richard

  • Updating the sequence number on import?

    OK, this is probably and oldie, and obvious to the informed observer, but I looked out on the web and in here, and apparently I"m not asking the right question 'cause I didn't find the answer:
    When doing an import into Lightroom, I can rename the files.  As part of the rename I'm incorporating
    a sequence number.  I can set the Start Number, BUT once I"ve imported the files, how do I get the
    Starst Number AUTOMATICALLY updated so on the next import it starts at the new value?
    AND, have it retained betwen sessions?  I don't want to have to run around finding the Start Number the
    next time I start Lightroom...

    Ok, I think I have found out what is going on and have answered my own question.
    The 'Import #' and 'Image #' use the entries from catalog settings ONLY if you are importing pictures.
    It does NOT work if you are using 'File / Rename Photo'.
    In that case, they always seem to start at 1.
    It doesn't sound like the logical way to function, but at least I think I have a handle on it now.
    Gary

Maybe you are looking for

  • No maintenance plan has been confirmed for Order 000004024181; Follow-up ca

    Hi I try to close a list of preventive order (initiated by maintenance plan) from the transaction IW38 but the system displays the following error message "No maintenance plan has been confirmed for Order 000004024181; Follow-up call exists Message n

  • HT1296 How can I transfer all my photos from my Ipad Mini to my new MacBook Pro

    How can I transfer all my photos from my Ipad Mini to my new MacBook Pro I am facing problem while I connect to my iPad mini with MacBook Pro , it only sync photo from its taken by and from it camera roll only. It doesn't sync all the images... Like

  • Why do i have a blank itunes store page?

    Ever since I updated to 10.5 I now get a blank screen on the itunes store page. How do I fix this? I have already uninstalled and re installed itunes but it didn't work. Help! thanks

  • Unresponsive mouse

    I have tried 3 different mice and have the same problem:  the mouse moves around the screen appropriately but doesn't respond to any clicks. The same thing occurs when I try using the Trackpad.  It will sometimes move an icon around the screen but wo

  • Code not doing what its supposed to

    I am working on a project. Everthing was working fine... except I started to realise that things were doing things it is not supposed e.g. If I add a button (a simple button). During run time it does not appear. I then started deleting code to create