Generated a partition by a fixed counter

I have de result below and a need to return other column which generate a count by the fixed number 8 for instance.
How can I produce this kind of result ?
SELECT 'A' LETTER FROM DUAL UNION ALL
SELECT 'B' LETTER FROM DUAL UNION ALL
SELECT 'C' LETTER FROM DUAL UNION ALL
SELECT 'D' LETTER FROM DUAL UNION ALL
SELECT 'E' LETTER FROM DUAL UNION ALL
SELECT 'F' LETTER FROM DUAL UNION ALL
SELECT 'G' LETTER FROM DUAL UNION ALL
SELECT 'H' LETTER FROM DUAL UNION ALL
SELECT 'I' LETTER FROM DUAL UNION ALL
SELECT 'J' LETTER FROM DUAL UNION ALL
SELECT 'K' LETTER FROM DUAL UNION ALL
SELECT 'L' LETTER FROM DUAL UNION ALL
SELECT 'M' LETTER FROM DUAL UNION ALL
SELECT 'N' LETTER FROM DUAL UNION ALL
SELECT 'O' LETTER FROM DUAL UNION ALL
SELECT 'P' LETTER FROM DUAL UNION ALL
SELECT 'Q' LETTER FROM DUAL UNION ALL
SELECT 'R' LETTER FROM DUAL UNION ALL
SELECT 'S' LETTER FROM DUAL UNION ALL
SELECT 'T' LETTER FROM DUAL UNION ALL
SELECT 'U' LETTER FROM DUAL UNION ALL
SELECT 'V' LETTER FROM DUAL UNION ALL
SELECT 'X' LETTER FROM DUAL UNION ALL
SELECT 'Y' LETTER FROM DUAL UNION ALL
SELECT 'Z' LETTER FROM DUALThe hipothetic result in this case is:
1,A
1,B
1,C
1,D
1,E
1,F
1,G
1,H
2,I
2,J
2,K
2,L
2,M
2,N
2,O
2,P
3,Q
3,R
3,S
3,T
3,U
3,V
3,X
3,Y
4,Z

with t as
SELECT 'A' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'B' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'C' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'D' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'E' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'F' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'G' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'H' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'I' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'J' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'K' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'L' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'M' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'N' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'O' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'P' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'Q' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'R' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'S' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'T' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'U' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'V' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'X' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'Y' LETTER FROM sysibm.sysdummy1 UNION ALL
SELECT 'Z' LETTER FROM sysibm.sysdummy1
select t.*, (row_number()over(order by letter)-1)/8 +1
from t

Similar Messages

  • Wrong generated queries w/ inherited entities&fixed ConcurrencyMode fields

    We have issues with the sql query generated by oracle odp.net provider in the following scenario.
    Our model consists in just two entities BASE and DERIVED. BASE entity is a base class for the derived entity DERIVED.
    Moreover, to track and prevent concurrent modifications, we have an int field located in the BASE class, which concurrencymode is set to fixed.
    Whenever we change just a property in the derived class, entity framework generate and send to oracle server two distinct queries:
    one query is an update for the DERIVED table to update changed properties, the other one seems a dummy query just to bump up concurrency version field.
    Failing query is pasted here.
    timestamp: 01/02/2012 9.29.57
    declare :p int
    update "TESTDB"."BASE"
    set :p = 0
    where (("ID" = : p0) and ("CheckVersion" = :p1))
    Error occurred: [6550] (ORA-06550: riga 1, colonna 9:
    PLS-00103: Trovato il simbolo "" anziché uno dei seguenti:
    begin
       function pragma procedure subtype type <un identificativo>
       <un identificativo delimitato da virgolette> current cursor
       delete exists prior
    )if we change properties on both derived and base class everything works fine, because a a classic and correct update query is issued.
    At first sight it seems the dummy update query uses microsoft sql server syntax. I guess with oracle syntax, the query should be:
    declare :p int;
    begin
    update "TESTDB"."BASE"
    set :p = 0
    where (("ID" = :p0) and ("CheckVersion" = :p1));
    end;Upon request we can provide full project,db schema along with unit tests (which pass on microsoft sql server)
    Edited by: 911531 on 1-feb-2012 0.39

    Yes, the syntax should be like what you said.
    Would you please provide a test case to alex.keh (at) oracle.com?
    Please mention the test case is for OTN
    Wrong generated queries w/ inherited entities&fixed ConcurrencyMode fields
    I have filed bug 13652493 on your behalf.
    Edited by: shsu on Feb 1, 2012 2:18 PM

  • Scanning in both HP Officejet 7210 and Samsung printer - the document scans but no file is generated - any ideas how to fix this?  (It worked fine before installing Mavericks)

    Scanning in both HP Officejet 7210 and Samsung printer - the document scans but no file is generated - any ideas how to fix this?  (It worked fine before installing Mavericks)

    PS: forgot to mention: if your printer is on your wifi network, you'll have to enter your wifi password on the printer to connect it to the network before Printers & Scanners will see it.
    Sometimes a reset of the wifi system is needed too. A full set of directions would be:
    Try:
    uninstall all printer manufacturer apps and "utilities"
    go to System Preferences > Printers & Scanners > Print
    control-click on your printer in the column on the left
    select "Reset Printing System..." and "reset" in the dialog that follows
    do a factory reset on your printer. You'll have to consult the printer manual for how.
    power down everything: modem, router, computer, and printer
    power up each item in turn in the same order: modem, router, computer, and printer. Let each power up completely before moving on to the next
    enter your wifi password in your printer so it can connect to the network
    go back to printers & scanners and it should see your printer and download a driver for it from Apple
    resist the temptation to install any printer manufacturer apps in the future.

  • Generate a pulse train using a count from a quadrature encoder as the clock

    I am trying to generate a pulse train with the same frequency as my quadrature encoder.  Every time the encoder counts, I want the pulse to go high until the next count and then go low and so on.  I am using a 6602 PCI card and a BNC 2121 accessory.

    Maybe I'm not understanding your app, but I *think* you and I are approaching it from two very different directions.
    As I understand it, you'd like to emit a pulse with each quad state change.  Then that pulse would act as a counter Source signal.  The counter will then increment on each pulse, to keep track of accumulated position.  Further, you'd use your device-under-test (DUT) as a counter Gate signal, which would buffer the position count each time there's a rising edge on your DUT.  The end result is a buffer of position values, captured at each rising edge of your DUT.
    I'm talking about a different approach to produce the same data.  You'd use 2 tasks on a M-series board.  One of them is a hardware-timed digital input task based on "change detection."  Each time one of the specified bits has a transition, your whole set of digital input bits can be captured and an internal "change detect pulse" is generated on the board.  This task should be sensitive to the DUT edges.
    The other task would be a buffered position measurement.  It would receive the reference encoder inputs and internally do quad decode and keep a running count.  The sampling clock for this task would be specified as the other task's "change detect pulse."
    Net result: on each specified edge of your DUT, you'll buffer a reference encoder position value and a digital state of your DUT.  You can choose to be sensitive to rising edges, falling edges, or (!!!!) both at once. You can also choose to be sensitive to many bits simultaneously.  These are better capabilities than you get with the 6602 alone.
    I *think* the 6220 should be ok, based on a quick overview of specs.  I assume your 3.6 MHz is the rate of ref encoder quad state changes, right?  In the approach I'm suggesting, you only need concern yourself with the rate of DUT edges which appear to be in the 10's of kHz or less.
    Gotta go for now.  Post back if any further questions.
    -Kevin P.

  • Generate two alternating PWMs with one counter of 6025E

    I am using LabView 6.0.2 with a PCI-6025E card. My requirement are to put out a pwm signal with 250Hz. The problem is, that for example, first a PWM with exact 100 pulses of duty cycle 1% is needed, after that exact 5 pulses of 10% duty cycle. These two PWMs are repetetive without any big pauses between. I tried this with Pulse Train Generation with "Changing Pulse Specs.llb" from the ni libraries, but the PC based on windows is not able, to do the PWM changes in these exact time slots. Note: The second timer of the card is used for another item.

    Unfortunately, you won't be able to do exactly what you want with a single counter. You'll need to use additional hardware. Here are some possibilities:
    1. Analog Output:
    A 1% duty cycle at 250 Hz requires a minimum of 25 kHz update rate, but your 6025E only goes up to 10 kHz. Your board is also limited by having only 1 DMA channel for Data acq buffered operations, and it may already by used by your other counter's operation.
    If you had an analog board with faster output, you could try to create a buffer with 0 V and 5 V values representing the desired finite pulse train. However, if the device you're controlling with PWM requires TTL edges, the rise and fall times of your DAC output may still not be fast enough to fool it.
    2.
    PCI-6601/6602 Counter/Timer:
    You could use two counters from a 6601 to generate the finite pulse trains you describe, but there would need to be a pause between the the two duty cycles. The pause is where your software detects the end of one finite pulse train and reprograms the counters to generate the other one. The pause might likely vary from 10 to 100 or more msec.
    If that variable dead time between pause trains is acceptable, the 6601 is the cheapest solution I know of for today's application. If you need reuse for future apps, you might want to consider the 6602 for double the price, but a bit more than double the capability.
    3. PCI-6533/6534:
    NI's timed digital boards would allow you to define the pulse trains as a one-bit digital pattern that you could generate continuously. I suspect the 6533 would suffice for the app you describe.
    Please double-check these hw suggestions with your local rep before ordering. (S)he'll know more than me about
    your present-day app and potential future needs. Good luck!
    -Kevin P.

  • Screwed up MBR and boot partition, can't fix it [SOLVED]

    Hi,
    I have been defeated. Been trying to fix my computer the whole day and know I'm lost.
    It's a long story, but my whole system got screwed when I tried installing windows on top of arch (I didn't get it to install, but I don't care anymore).
    I was able to install GRUB2, I tried configuring it with grub.cfg , but when trying to boot it says it's missing kernel, boot partition has linux2.6, and I was using linux 3, I'm not really sure how to get the kernel I was using, should it be in my root partition? .
    I'd like to get my system as it was before, I have root , var and home partitions and not sure how.
    Thanks
    Last edited by exuberant (2011-12-31 10:27:47)

    Thanks for your reply.
    I was using Arch, I last updated a few days ago.
    The kernel that's on the boot partition is from a debian live cd I had laying around.
    It is not possible I have more than one boot partition. I have 1 hard drive, but plenty of free space.
    Windows wanted to use the start of my disk, so I used gparted to move 20 gb free space at the beginning. Creating a partition in the beginning also caused all partitions numbers to move up (sda2->sda3), when I gave up on windows, I tried moving everything forward like it was before, but it didn't work. Then I remembered that when installing grub, installers check for other mount points, but that didn't work, and instead overwrote my boot partition. So know I've got a temporary debian system installed(sda9) and a boot partition that won't boot Arch.
    This is my fdisk output: sda5 is arch sd6 var and sd7 home
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000080
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          12       96358+  83  Linux
    /dev/sda2              13         401     3124642+  82  Linux swap / Solaris
    /dev/sda4            2744       14648    95619073    5  Extended
    /dev/sda5            2744        4203    11719680   83  Linux
    /dev/sda6            4239        5212     7815168   83  Linux
    /dev/sda7            5227       10326    40957952   83  Linux
    /dev/sda8           10393       13432    24411136   83  Linux
    /dev/sda9           13432       14648     9764864   83  Linux

  • Lost recovery partition, can be fixed?

    Hi guys! i just buy a new P845-S4200 notebook and i try to create a new partition from 750GB with Acronis Disk Doctor and unfortunetly all my hdd crash, and all partition disapear.. i try to recover but not working..
    the only solution was to delete all partitions and create new ones with a win7 dvd .. but i want to have my partitions with windows 7 x64 licence and all the drivers..
    can anyone help me with and hdd image partions or other solution?
    i also have big problme with wifi, only driver that work is Intel Wireless LAN Driver(v15.0.1.1; 02-13-2012; 8.49M)
    and wifi apear Intel centrino N200 but the association with my AP not working, also with another AP..same problem..
    with win7 that laptops arrive it works..
    Thank you!

    Satellite P845-S4200
    If you failed to create recovery discs, order them from Toshiba.
       Order Toshiba Recovery Media
    For an explanation of all this, see the section Recovering the Internal Storage Drive, which begins on p. 54 of the User's Guide. See p. 68 for how to restore from the recovery media.
       Satellite/Satellite Pro P800 Series User’s Guide
    Restoring the hard disk to its original out-of-the-box contents using Toshiba recovery media will replace the partition with the image of the hard disk and should fix the WiFi.
    -Jerry

  • Resized partitions how to fix file system to new size.

    So I had to resize my /boot partition which required me to resize my root partition. How do I fix the file system to match the new size of the partition?

    I do not understand why this was moved? This is not a new install, I was tuning my hooks to use systemd replaceing udev, autodetect and base.
    running
    mkinitcpio -p Linux
    resulted in an error that said there was not enough space. and that the image was probably not correctly made.
    I based my decision on the placement of the post by the following post which seemed to be in the same category.
    https://bbs.archlinux.org/viewtopic.php?id=173359
    Is there a place that provides a more narrow definition of topics that are acceptable for fourm categories?

  • Can 6014E generate an interupt when the terminal count is reached in the counter

    I need to recieve an interupt when a counter reaches the TC and this acts as a base to change the values of the analog output and counter value.

    Greetings,
    Unfortunately, I don't believe that it is possible to generate an interrupt when TC is reached. However, you can program your counter to output a pulse when TC is reached. You could use this signal as the update clock for your analog output operation. You also mentioned updating a counter's value. Maybe you could expand upon this aspect of your application. I don't think I have a clear understanding of it.
    Spencer S.

  • How to generate a circle of a fixed size

    I want to generate a circle of a specific size.
    What is the best way to do that?
    Also is there a good way to locate the center of an image?
    Thanks for any help!

    What do you mean by specific size?  Pixels?  Dimensions?
    Making a circle is easy, just go to the ellipse shape tool (default is rectangle I believe - you can change the type either on the tool toolbar by click and hold, or just select the tool and adjust on the toolbar at the top).  Depending on which version of PS you have the details will be a little different.  On the toolbar at the top there should be a little arrow to the right of the shapes that allows you to select options.  If you want dimensions you can just put that in, otherwise click circle and drag it to the size you want using rulers or guides to help set size.  If you click on "center" in the options it'll start the circle from the center.  If you use guides then it'll help you locate where it is after.

  • How to generate blank spaces at end of the record in a flat file with fixed

    Hi,
    I am generating a flat file with fixed length.
    In my ABAP program, i am able to see the spaces at the end of the recors in debug but when download to applicaiton server i am not able to see those spaces.
    How can i generate blank spaces at the end of the record in a flat file?
    Please update
    Thank you

    How are you downloading the file?  And, How are you looking at the file on the application server?
    Can you provide snippets of your code?
    Cheers
    John

  • How to generate a delayed retriggerable pulse using only one counter with PXI 6070E card

    Hi
    I have a problem in generating a retriggerable delayed pulse with a single counter(triggered through a signal at gate) using PXI 6070E card. VI was developed in NI LabVIEW traditional DAQ Ver.7.1. I have used the "delayed pulse generator config" VI and a "Start counter" & "Stop counter" VIs for the purpose. But there is no output seen at the out terminal of counter. So I introduced a "wait" VI and set it to 1 sec. Now the pulse output appears but some pulses are missing mometarily after every 1 sec interval. (any solution for this)
    I have gone through a few similar requests in the forum but they suggest either to use two counters or to generate a finite pulse train which does'nt fit my application. Moreover PXI 6070E has only 2 counter timers. I am already using one counter to measure the frequency of a pulse train(signal 1). The application requires to generate a delayed retriggerable pulse for every pulse in signal 1. So I have only one counter left.
    Can I measure the frequency of signal 1 by analog means.? so that I can use two counters for pulse generation. (Signal 1 is a TTL signal).
    Request some help.
    Thanks in Advance
    Regards

    A finite pulse train (N_Pulses >= 2) does require the use of 2 counters on most of our older hardware including your 6070E.  If you're just talking about generating a single retriggerable pulse, you would only need one counter.
    Here's an example in Traditional DAQ that shows you how to set a retriggerable pulse generation (it also allows you to adjust the characteristics of the pulse on-the-fly).
    If you're writing a new program, you might consider switching to DAQmx as it supports NI's latest hardware and recent OSes should you ever need to upgrade.  Traditional NI DAQ is no longer in active development.  Here's an example of how to implement a retriggerable pulse generation in DAQmx.  You should take note that you can't use the two drivers to simultaneously talk to the same piece of hardware, although you should be able to go back and forth by resetting the Traditional DAQ driver before switching to DAQmx.
    Best Regards,
    John Passiak

  • Problem using counter to generate gate signal

    Hello,
    Is there a way to have a counter output a logical high for n input pulses and a low for the rest of the time? I am running into problems implementing this simple task due to idle-state behavior of CreatePulseChannelTicks and CreateCountEdgesChannel.
    The output of the counter is used to gate the device that generates the pulses that are being count. As long as the gate is 'low', no pulses are generated. I run in the following problem:
     When I configure a counter with CreateCountEdgesChannel and use ExportSignals.ExportHardwareSignal to export the 'CounterOutputEvent', the initial state of the output is low. However, I need it to be high to start pulse generation.
     When I configure a counter as a one-shot pulse generator, I have to configure an idle state, delay-, high- and low-count. I tried two combinations:
    idle state low, delay 0, in high the pulse count I want, and low-count very high. However, despite the 'delay=0', the initial output state is low. Thus, my device does not start generating pulses.
    ide state high, delay set to the number of pulses I want, and low- and high-count very high. This does generate the desired gate signal. However, when I stop the counter task, the gate is set 'high' and my device again starts generating pulses. This is undesirable.
    Is there a way to set the IdleState when using CreateCountEdgesChannel? Is there a way to have daqmx to ignore the initial delay and immediately start with the counter output in the inverted IdleState?
    Thanks,
    Maarten van Kampen

    Short update:
    I found the method to set the IdleState when using CreateCountEdgesChannel: .ExportSignals.CounterOutputEventIdleState = CounterOutputEventIdleState.High.
    Howerver, now I run into the same problem with CreateCountEdgesChannel as with CreatePulseChannelTicks: when stopping the task, the output of the counter is always set high. And I want it to remain low when stopping the counter.
    Regards,
    Maarten van Kampen

  • Generate an Event based on Counter Trigger

    Hello,
    I have the following part that is already working: a counter (used for period measurement) which is triggered by a digital input. After that I'm reading the data and I'm puting them in a Queue. Here I get an error. The Enqueue Element Vi is providing an error. (Error 1, something with a @  character that is illegal). I've notice that if I disable the trigger for the counter I don't get the error. I'm thinking that this is cause by the delay between the moment in which the Enqueue Block tries to enqueue and the moment in which the counter provides something to its ouptut.
    What I want to do is to Generate an Event based on the Counter Trigger Signal and to put all the reading and Enqueue part in an Event Structure. I've tried to do that using an Export Signal - Property Node, but I didn't manage to make it work.
    If you have any solution for this (with or without events -  I just want to get rid of that error) please let me know.
    PS: I have Labview 8.5.1 and the USB-6210.
    Thanks,
    LostInHelp

    Hello Mike,
    Thanks for your replay.
    I've attached two vi files. In one you can find how I've tried to generate an event based on the counter trigger (test.vi).
    The second one (test1.vi) is the vi where I get the queue error. I've deleted from the second vi the part where the data are dequeue and handled.
    Thanks
    LostInHelp
    Attachments:
    test41.vi ‏50 KB
    test110.vi ‏35 KB

  • Snmp_ro.ora not generated error -- need fix

    I ran 'agentctl start' after my successful Oracle 9.2.0 installation (though I did get an error saying my NLS_LANG was set wrong, but I fixed this in my .profile after the intall). I received the error: "required config file 'snmp_ro.ora' was not generated." How can I fix this?
    Michael

    You need to leave those two files alone.
    They are NOT involved in defining MIBs.
    There is a file called ora_mibs 'somewhere' which should be read by the snmp peer agent, and everything should work.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • New Dialog Instance Installation PXA_NO_SHARED_MEMORY Error

    Hi friends, I am  running SAP ECC 6.0 on HP_UX 11iv2 and oracle10g. Central instance and database installed on different servers. I have two other dialog instances running but I have installed another dialog instance as restore from other existing di

  • FM for creating Move-in

    experts, Can i know any FM /BAPI to create Move in ,i have Installation & Contract Account available with me. Tried using ISU_S_MOVE_IN_CREATE & BAPI_ISUMOVEIN_CREATEFROMDATA , but dont know what parameters to be passed. Please help me out in this. T

  • Error message 131:4

    Hello, I started up PS CS5.1 and got this error message that mentioned a configuration problem.  Does anybody know what this is?

  • Trying to print targets to profile in CS4...

    I wanted to revisit an issue I had been having several months ago in the hopes that a fix may exist, or that more people may now be aware of it... I'm trying to print Bill Atkinson's RGB targets running CS4 in 10.5.8.  I'm familiar with the necessary

  • Can't open a PC-generated review

    I contacted support about this over chat and whoo-boy...they were stumped. We do all of our graphics approvals through the "review" feature of Acrobat. Within the last month, we suddenly can no longer open a review file that was generated on a PC on