Why my system hanged when i execute this block

when i execute this query , why my oracle stop reponding
and after some time start an ifinite output...
declare
v_nextval varchar2(10);
cursor c6 is
(select seq_a.nextval from dual);
begin
open c6;
loop
fetch c6 into v_nextval ;
exit when v_nextval <= 10;
dbms_output.put_line(v_nextval);
end loop;
close c6;
end;
kinkly take a look on this
thanks

Maybe something like this.
>
suppose in my table col A
have last inserted value 258
i have migrated database from sql server 2005 to oracle 10g
where sequences currval is not initailized and last value is 1
now i m creating a new sequence but i do not want to mention Startwith 258
so how to do
>
SQL> select 'create sequence sequence_' || chr(level + 64)  || ' start with 1 ; ' from dual
  2  connect by level <= 2;
'CREATESEQUENCESEQUENCE_'||CHR(LEVEL+64)||'ST
create sequence sequence_A start with 1 ;
create sequence sequence_B start with 1 ;
SQL> create sequence sequence_A start with 1 ;
Sequence created.
SQL> create sequence sequence_B start with 1 ;
Sequence created.
SQL> create table table_A
  2  (
  3   sno number
  4  )
  5  /
Table created.
SQL>
SQL> insert into table_a
  2  select level from dual connect by level <= 10;
10 rows created.
SQL>
SQL> create table table_b
  2  (
  3   sno number
  4  )
  5  /
Table created.
SQL>
SQL>
SQL> insert into table_b
  2  select level from dual connect by level <= 20;
20 rows created.
SQL> with mapping_table
  2  as
  3  (
  4   select 'sequence_a' sequence_name, 'table_a' tname, 'sno' column_name from dual
  5   union all
  6   select 'sequence_b', 'table_b', 'sno' from dual
  7  ),
  8  max_value_table
  9  as
10  (
11   SELECT
12       sequence_name,
13       to_number(
14         extractvalue(
15           xmltype(
16    DBMS_XMLGEN.getxml('select max(' || column_name || ') c from '||tname))
17           ,'/ROWSET/ROW/C')) max_value
18  FROM mapping_table
19  )
20  select * from max_value_table;
SEQUENCE_N  MAX_VALUE
sequence_a         10
sequence_b         20
  1* select * from user_sequences where sequence_name in ('SEQUENCE_A','SEQUENCE_B')
SQL> /
SEQUENCE_NAME                   MIN_VALUE  MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
SEQUENCE_A                              1 1.0000E+27            1 N N         20           1
SEQUENCE_B                              1 1.0000E+27            1 N N         20           1
SQL> with mapping_table
  2  as
  3  (
  4   select 'sequence_a' sequence_name, 'table_a' tname, 'sno' column_name from dual
  5   union all
  6   select 'sequence_b', 'table_b', 'sno' from dual
  7  ),
  8  max_value_table
  9  as
10  (
11   SELECT
12       sequence_name,
13       to_number(
14         extractvalue(
15           xmltype(
16    DBMS_XMLGEN.getxml('select max(' || column_name || ') c from '||tname))
17           ,'/ROWSET/ROW/C')) max_value
18  FROM mapping_table
19  ) ,
20  sequence_collation
21  as
22  (
23   select us.sequence_name, us.increment_by, mvt.max_value from user_sequences us, max_value_Table mvt
24   where
25       us.sequence_name = upper(mvt.sequence_name)
26  ),
27  sequence_exec_order
28  as
29  (
30  select 1 execution_sequence, 'alter sequence ' || sequence_name || ' increment by ' || max_value || ';' text from sequence_collation
31  union all
32  select 2, 'select ' || sequence_name || '.nextval from dual ; ' from sequence_collation
33  union all
34  select 3, 'alter sequence ' || sequence_name || ' increment by ' || increment_by || ' ;' from sequence_collation
35  )
36  select text from sequence_exec_order order by execution_sequence
37  /
TEXT
alter sequence SEQUENCE_A increment by 10;
alter sequence SEQUENCE_B increment by 20;
select SEQUENCE_A.nextval from dual ;
select SEQUENCE_B.nextval from dual ;
alter sequence SEQUENCE_A increment by 1 ;
alter sequence SEQUENCE_B increment by 1 ;
6 rows selected.
SQL> alter sequence SEQUENCE_A increment by 10;
Sequence altered.
SQL> alter sequence SEQUENCE_B increment by 20;
Sequence altered.
SQL> select SEQUENCE_A.nextval from dual ;
   NEXTVAL
        10
SQL> select SEQUENCE_B.nextval from dual ;
   NEXTVAL
        20
SQL> alter sequence SEQUENCE_A increment by 1 ;
Sequence altered.
SQL> alter sequence SEQUENCE_B increment by 1 ;
Sequence altered.
SQL> select * from user_sequences where sequence_name in ('SEQUENCE_A','SEQUENCE_B')
  2  /
SEQUENCE_NAME                   MIN_VALUE  MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
SEQUENCE_A                              1 1.0000E+27            1 N N         20          11
SEQUENCE_B                              1 1.0000E+27            1 N N         20          21Regards
Raj
P.S : dbms_xmlgen query from the old posts in this forum.....

Similar Messages

  • When i executed this class file  i am getting runtime errors

    when i executed this class file i am getting runtime errors
    code is :
    import java.awt.event.*;
    import java.awt.*;
    public class Test extends Frame
    java.awt.Window w;
         TextField t;
         Test()
         t=new TextField(20);
         add(t);
         addWindowListener(new WindowAdapter()
                             public void windowDeactivated(WindowEvent ev)                               {                    
                                  w.toFront();          
                                  System.out.println("hai");
         setSize(300,300);
         setVisible(true);
    public static void main(String args[])
    Test t =new Test();
    after executing that class i am getting this errors
    Exception occurred during event dispatching:
    java.lang.NullPointerException:
    at WindowEventDemo.windowActivated(WindowEventDemo.java:76)
    at java.awt.Window.processWindowEvent(Window.java:612)
    at java.awt.Window.processEvent(Window.java:576)
    at java.awt.Component.dispatchEventImpl(Compiled Code)
    at java.awt.Container.dispatchEventImpl(Compiled Code)
    at java.awt.Window.dispatchEventImpl(Compiled Code)
    at java.awt.Component.dispatchEvent(Compiled Code)
    at java.awt.EventQueue.dispatchEvent(Compiled Code)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)
    if anybody know how to pls help me

    You are using w that you have not done anything with.
    Add following code to the begining of your cinstructor:
    w = this;
    Then it should work.
    //Anders ;-D

  • Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Why does captivate hang when it is closed in window 8.1 professional ? How is it solved?

    Hi,
    Do you see the issue every time you close captivate or is it only in some scenarios? Does it show any error messages? What captivate version are you using (64 bit or 32 bit)? Can you provide some more information or screenshots which can help us reproduce the issue.
    Tamish

  • Adware has access to system even when the site is blocked.

    ad.yeildmanager.com and all of its' buddies have free access to my system even when the sites are blocked. It only seems to occur when I am at Yahoo and spammers were using my account.
    Norton, McAfee, MS, and Pest Patrol find no bugs and show life is great.
    Every morning I show new program installed but no listing for it.
    I love the browser but

    This new 'feature' is controlled by these two prefs.
    *security.mixed_content.block_active_content
    *security.mixed_content.block_display_content
    *https://developer.mozilla.org/Security/MixedContent
    *https://addons.mozilla.org/firefox/addon/toggle-mixed-active-content/

  • System hanging when i try to display or change or create a function module?

    Hi Experts,
    My system is hanging when i try to display or change or create a FM using SE37 transaction. I am able to execute SE37 transaction but when i give a FM name which is already existing, the system is getting hanged up. If i give a FM which is not present in the system and try to display it, it gives an error "FM does not exists". I have unistalled the SAP logon and reinstalled it again and restarted my system but still this problem is encountered.
    Can any one please help me in this issue??
    Thanks a lot in Advance!
    Regards,
    Lakshman.

    Hi Prasad,
    Go to se38 transaction and look at  UTILITIES-> Settings-> ABAP editor-> Change front-end editor to old(if it is new) and check once. Hope this solves your problem becuase this is what i have done for my problem and let me know whether the problem has been solved.
    Regards,
    Lakshman.
    Edited by: lakshman reddy G on Mar 5, 2009 5:54 PM

  • System hangs when copying large quantity of files from external HD

    A little background:
    I was having some problems with the original OS (10.4.1), including periodic freezes. I bought the Mac Box Set '09 and installed Snow Leopard (10.6.5), but ran into some problems and in the process had to reformat my internal hard drive. I backed up all of my photos (~16GB), Documents (~1.5GB) and Music (~50GB) on a WD external hard drive (My Passport 750GB).
    *The problem*: After the 10.6.5 install, the computer works great (no random freezing when I click around in Finder), but I am having trouble copying files back to the internal HD from the external. I can copy up to about 1GB at a time without any problems, but any time I try to copy more than that, the system hangs (first the spinning disk cursor, then it totally freezes) and I have to do a hard reset. I have tried copying a number of different folders (pictures and music), and the same holds true: small folders with a few files copy without a hitch, but any time I try to copy a lot of files at once: freeze city. This problem occurs whether I am using Finder to copy the files or iPhoto/iTunes to import them.
    I have verified both disks using the Disk Utility AND restructured/verified them using DiskWarrior. I also had no problem copying all of my files from My Passport to a second external HD using this MacBook, so I assume the Passport is fine. Is this a physical problem with my internal HD? If so, why can't DiskWarrior or DiskUtility catch it? I just noticed that there is an internal HD recall for this model of macbook, although I have never gotten the question mark on startup that would qualify me for a replacement HD from Apple. Maybe it's a problem with Snow Leopard... I would love to know if anyone has had this problem before or has some advice.
    Thanks,
    Sam

    External USB/FW drives 'falling off' or drives spinning down (going to sleep) and I would assume since you have been running 10.4 that the Passport might be older model, perhaps not the latest firmware, maybe not compatible with Macs and with Snow Leopard.
    Obviously you want FW800 but for some, USB worked where FW fails.
    Hard Reset: do you have another hard drive to boot from to run Disk Warrior? is that updated to 4.2 or later? you never want to run DW from CD. Else, boot from OS X 10.6.5; or Single User and run FSCK. HFS+ doesn't take kindly to hard restarts even though a Safe Boot helps a little, that isn't as good as FSCK or one of the other options.
    Disk Warrior Rebuild is more thorough, but if you hold OPTION while clicking on REBUILD it brings up more choices. And you want to scan the full hard drive.
    Going back to Aug/Sept 2009, there were a lot of threads about external hard drive issues. Wish I could point to a good one.

  • System hanging when it runs out of memory

    Hello,
    my system has a finite amount of RAM and swap (it doesn't matter, to my purpose, if it's 16GB or 128MB, I'm not interested in increasing it anyway).
    Sometimes my apps completely use all the available memory. I would expect that in these cases the kernel kills some apps to keep working correctly. The OOM Killer exists just for this, doesn't it?
    What happens, instead, is that the system hangs. Even the mouse stops working. Sometimes it manages to get back to life in a few seconds/minutes, other times hours pass by and nothing changes.
    I don't want to add more memory, I just want that the kernel kills some application when it's running out of memory.
    Why isn't this happening?
    Right now I'm writing a bash script that will kill the most memory-hungry process when available memory gets below 10%, because I'm sick of freezing my machine.
    But why do I have to do this? Why do I need an user space tool polling memory usage and sentencing applications according to a cheap policy? What the hell is wrong with my OOM Killer, why isn't it doing is job?!

    Alright, you won, now quit pointing out my ignorance
    Your awkish oom killer is a lot cooler than mine, switching to it, thanks!
    I did some testing (initially just to test the oom killing script) and found out that if a program tries to allocate all the memory it can, it gets eventually killed by linux's oom killer. If instead it stops allocating new memory when there are less than 4MB of free memory (or similar values) the OOM won't do anything, and the system will get stuck, like if a forkbomb was running.
    That's it, this program with MINSIZE=1 will be killed, while with MINSIZE=4MB will force me to hard reboot:
    #include <string.h>
    #include <stdlib.h>
    #define MINSIZE (1024*1024*4) // 4MB
    int main( )
    int block = 1024*1024*1024; // 1GB
    void *p;
    while( 1 ) {
    p = malloc( block );
    if( p ) {
    memset( p, 85, block );
    else if( block > MINSIZE ) {
    block /= 2;
    return 0;
    Guess I'd need to go deeper to understand why Linux' oom killer works like that, but I won't (assuming the oom killing script will behave).

  • Why does firefox hang when opening and takes several minutes to come up?

    Why does Firefox hang for several minutes before coming up?

    I am also having this problem. When trying to reboot, I get an endless cycle of the BIOS screen, then "MACHINE ERROR", then back. Running the same dmesg command as snoxu results in a similar error message. I am forced to shutdown by holding the power button. Upon rebooting, I get an error message that all extensions have been turned off (using Gnome Shell). Then I have to logout and login.
    Shutting down and then restarting works fine.
    Additional info:
    System76 Gazelle Professional laptop
    syslinux, systemd, GDM, Gnome Shell

  • Why does sqlplus hang when run with -s?

    hi guys,
    when i run it with -s (on Unix), it often just hangs - has anyone experienced this before?
    thank you

    OracleGuy777 wrote:
    wow. you're right,
    i always thought the -s just meant silent, in that it would not print out that login stuff.
    thanksInstead of just "thinking" what it meant, why didn't you look it up in the SQL Plus reference manual? ESPECIALLY since you were having trouble with it ....

  • SAP system hang when start the addon.

    Dear Expert,
    I just upgrade one of the SAP B1 server from 2007A to SAP B1 8.8 PL15, everything going smooth both server and clients.
    Except one client (new laptop with Win 7 Pro x86), this laptop fail to start the addon.
    Others clients with same specs Win 7 Pro have no problem to start addon.
    Addon started manually.
    After click start button for that addon, the system hang. If without the addon system working fine.
    If anyone have ideas to check much appreciate and thanks in advance.
    Regards,
    Mat

    Hi Bala,
    I did try your steps, but no luck. System still hang when start the addon.
    But, I can start SAP addon , example i try Screen Painter, and can start successfully. Only our addon cannot start.
    I'm not suspect our addon because others client working smooth, even the server also working fine.
    I did re-install DIAPI, even re-install SAP client a few time, but still fail to start addon (delete SAP client folder before install).
    Any one face this problem?
    Regards,
    mat
    Edited by: Mat Mat on Apr 21, 2011 10:43 AM

  • [SOLVED] System hangs when maximizing Terminal (new kernel 2.6.38)

    I am using terminal [ 0.4.7-1 (xfce4)] and when i maximize the window, system hangs for about 4 sec. The output of dmesg for that issue is:
    NVRM: Xid (0000:01:00): 13, 0000 e0019700 00004097 00001808 00000000 00000010
    NVRM: os_schedule: Attempted to yield the CPU while in atomic or interrupt context
    I use the nvidia 270.41.03-1 drivers. Also, that is not happening with other terminals like xterm.
    Last edited by nasosnik (2011-08-21 20:29:58)

    My XFCE4 system doesn't hang.. but I have an NVIDIA card too, and when I resize TERMINAL it does this:
    First, the picture of the terminal before resizing.
    Next, this picture, which shows what the screen does after resizing Terminal:
    Last edited by Kilzool (2011-06-05 22:48:47)

  • [915 Series] System hang when installed CoreCenter

    After updated bios to version 1.7 and Core Center 2.0, my system hang after sometime running.
    When uninstalled CoreCenter, no problem now.
    If installed previous version Corecenter, it still hang.

    Many people here will tell you to dump CoreCenter. I don't use CoreCenter either. You'll find many here use Speedfan or MBM5 to monitor their temps and voltages. MBM5 is no longer developed and won't support your mobo. Speedfan is still updated and you also can control fans with this utility. Are soft OC'g with CC? Software OC'g is not recommended, but if you do soft OC, Clockgen is better program for doing so. I wouldn't. OC'g using the bios is considered the better method.
    Also, it's a good idea to read the stickies especially the one about posting.  As stated in the post I linked to, please include information about your system. See that post and my signature as an example.

  • System hang when ovrclocking

    hi every body
    i have aproblem
    each time i overclock my system it hangs when i'm trying to load agame or to use a CPU more than 20%
    i overclock with dinamic overclock 7 %
    i have thermaltake big water cooling system so its not a heat problem.
    and i will be glad if anyone can tell me how to overclock my system manually.
    thanks alot ppl.

    I think it has to do with your RAMs. Try increasing your RAMs voltage by 0.1v and relaxing their CAS Latencies and see if you'll get better results.

  • Why system hang when install GeforceFX 5200?

    i am using the Asus A7V8X mainboard, Processor is the AlthonXP 1700+. Ram is Kingston 256 DDR 400.
    before when i use the geforce 2mx is no problem and good at using in WinXP. But, nearly time i was buy the MSI - 128MB DDR GeforceFX 5200 8X Graphics Card and try install it. When i install the driver come with cd bundled, the system was hang even i try restart and try install again but the problem still exist. then, i was go to the MSI offical website to download the newest driver again and try install again oso cannot. I have already done all i can do is update the vga driver and install VIA 4in1 but the problem still exist here. izzit my mainboard cannot compatible with the GeforceFX graphics card ?
    So, i have hope technican here can tell me what the problem is and how can solve this problem...
    thx you .

    Go to http://www.driverheaven.net and download "Driver Cleaner" Utility. follow the instructions on removing drivers from previous installs.
    Do not use the MSI Drivers, go to nVidia's website directly for VGA Drivers.
    Make sure you have the drivers downloaded to a directory prior to running driver cleaner so you can immediately install them afterwards.

  • Why does Safari hang when launching?

    Using Safari 1.3 on 10.3.9 for a couple weeks now; everything has been running well, until today.
    Safari will launch from a Help command within an application (eg: any CS application), open it's own window, blue connection status gets halfway across the window bar, then it will hang with the spinning beach ball... until I force quit.
    Same thing happens when launched from the dock or directly from the applications folder. Explorer, Firefox all work fine. All other apps working fine.
    Tried trashing Safari prefs, no change. Deleted all Safari files and tried to install v1.2 instead (as a download from Apple), but now the Safari installer hangs as well. No problem with installing or re-installing other apps.
    Additionally, Sherlock will now no longer launch.
    Why is this happening? How can I fix it?
    John
    Message was edited by: iconophile

    re-installed Safari

Maybe you are looking for

  • Why would this happen?

    today i created an A/P invoice Eur2547.85 for our vendor which is using Euro currency, after I did the invoice, i create a credit note Eur1418.84 from that invoice directly, all using FC - Euro. however when i go to the vendor receipt ageing report,

  • Report Usage Counts

    Is there a table that shows a count of discoverer viewer reports viewed by users on a daily basis?? Or which table would I create a trigger to insert counts into a new table, then create a report that roles up by report name and date and lists a coun

  • Approval of order

    Hi all, Our client's requirement is that before release of maintenance order, it should be approved by two different authorities (i.e. one administrative approval and another is financial approval). Once the order has been approved by the two approve

  • Error when opening query.

    Hello All, In Bex Analyzer 7.10 when i open any query i get  pop-ups declaring that few Text-Elements are missing. This is the issue i'm facing. After clicking OK for each popup the report opens up. What could be the reason for these popups ? I'm on

  • Facing a strange issue

    I am calling jasper reports.. from a button.. But what i observe is after clickign the button the code which exist in a different page fires twice.. Previously itused to fire only once now twice..what can be the reason for it. . am i doing something