Problem to summarize parts of a sequence

Hi together,
I'm new here and I only have some basic know how about Oracle PL SQL.
I'd like to create a confusing query in SQL Developer.
I tried to split a sequence into single numbers and multiplied this numbers with different values. By then everything worked fine.
This is the statement to split my sequence:
SELECT
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),1,1)*3),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),2,1)*1),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),3,1)*3),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),4,1)*1),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),5,1)*3),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),6,1)*1),
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),7,1)*3)
from dual;
But now i tried to summarize (sum) the output of the multiplication and get an error.
With this statement:
SELECT sum(
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),1,1)*3)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),2,1)*1)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),3,1)*3)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),4,1)*1)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),5,1)*3)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),6,1)*1)+
(substr(LPAD(CAST(SEQ_LOID.nextval AS number(8)), 7, '0'),7,1)*3))
from dual;
02287. 00000 -  "sequence number not allowed here"
*Cause:    The specified sequence number (CURRVAL or NEXTVAL) is inappropriate
           here in the statement.
*Action:   Remove the sequence number.
Thank's in advance for your help. I appreciate for any kind of hints.
I spent many hours and couldn't find a solution.

Hi,
There are pretty severe restrictions on where sequences can be used.  See the SQL language manual
http://docs.oracle.com/cd/E11882_01/server.112/e26088/pseudocolumns002.htm#sthref45
for details.  It specifially says that you can't use NEXTVAL in a query with a GROUP BY clause.  It doesn't say anything about a query that uses an aggregate function (such as SUM) but no GROUP BY clause, like your query.  Using aggregate functions without a GROUP BY clause produces the same results as "GROUP BY NULL"  (or any constant in place of NULL), so it's easy to imagine that the restriction applies to any query with aggregate functions, whether or not it uses GROUP BY.
What are you trying to do?  Do you really need a sequence to do it?  The analytic ROW_NUMBER function can generate unique, consecutive integers, very much like a sequence.  Could you use ROW_NUMBER fot whatever it is you need?
Assuming you really do need a sequence, you could create a table (perhaps a Global Temporary Table), populate it with values from the sequence, and then use those values any way you want in a query.  Or you could capture one sequence value in a substitution variable, then use that variable any way you want in a query, e.g., using ROW_NUMBER to generate consecutive integers starting with theat number.
If you cvan explain what you need to do, someone can help you find a good way to do it in Oracle.
See the forum FAQ: https://forums.oracle.com/message/9362002

Similar Messages

  • How do I solve General Error problem when rendering and/or playing part of a sequence?

    Hi!
    All of a suddenly when I was editing, the General Error message appears. Now there's part of a sequence I cannot render nor play.
    I've restarted the application and the computer but without result. I've also cleared my render folder.
    Is there a solution to this problem?
    Best,
    Christopher

    I appreciate your respons, though it did not work for me.
    I've narrowed to problem down to a 5 sec clip of sound I have on the timeline, even after reconnecting that clip to a copy of the file it doesn't work. This has me perplexed.
    Thanks again!
    Christopher

  • How do I make 1 video file play alone or as part of a sequence of videos

    how do I make 1 video file play alone or as part of a sequence of videos and only have it on the disc once.
    My problem is that I am short of space on my disc due to the amount of content, and all of the files appear separately on the menu to play invividualy, but i would like to have a play all function aswell without putting the files on the disc twicew. Am I being an idiot? Is this easy to solve?

    Take a look at "stories" in the manual.

  • Im trying to download itunes 10.5 but keep getting error message that says: There is a problem with this Windows Installer package. A problem run as part of the setup did not finish as expected. Contact your support personnel or package vendor.

    im trying to download itunes 10.5 but keep getting error message that says: There is a problem with this Windows Installer package. A problem run as part of the setup did not finish as expected. Contact your support personnel or package vendor. I am using windows XP 32 bit, all the other computers in my house downloaded just fine, no problems, however this is the computer my iphone is set up to, ive tried doing a virus scan, windows update, downloading other things, updating everything possible, everything works fine, its just itunes that wont download, anyone have any other ideas?

    Yes, I had found a similar solution also.  I'm running XP Pro, SP3.  I went Control Panels/ Add-Remove programmes/apple software update/ change/ repair.  Then run the 10.5 exe.
    While the programme updated from version 8 of iTunes, my new iTunes is now a mess.  Not all of my music was in the same folder previously but it all showed up on iTunes.  Now many albums have been left out, some have only a few tracks and some have two copies of some tracks as well as having other tracks missing.  I haven't begun to work on that.

  • Printing problem with Summarize Comments?

    Printing problem with Summarize Comments in Pro 10.1.6? When I print, I only get the number boxes on one page and the comments on the next page. The numbered boxes don't show up on the actual image itself.

    Um I dont know if im doing something daft but I tried this like you said
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if(printJob.printDialog()){
    try {
              PageFormat pageFormat = printJob.defaultPage();
              if (pageFormat.getOrientation() == PageFormat.PORTRAIT) {
              landscape = 0;} else {
                   landscape = 1;}
              System.out.println("THE ORIENTATION IS "+ landscape);
              printJob.print(); }
    catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
    and it doesnt seem to work as I tried it both as landscape and portrait in the print dialog but landscape is always 0.
    cheers
    pmiggy

  • Problem in Assigning  table to access sequence

    Dear All,
    i am facing problem in assigning table to access sequence for billing output type.
    I have created 1 table B902 with the combination of Sales org,plant ,Division,Billing doc type.
    but if i am going to assign with access sequence system is taking for Billing type & division & for other its showing red marks & errorr.Access sequence->Aceessess->Field.if i am clicking on field in I/O column for plant its displaying negative.
    bcause of this i am not able to make condtion record.
    Message is Select a document field for WERKS
    Regards
    ajit
    Edited by: SAP SD AJIT on Mar 1, 2010 3:18 PM

    Hi SAP SD AJIT ,
         Go to IMG --> Sales and Distribution --> Basic Functions --> Output control --> Output Determination --> Output Determination using condition technique --> Mantain  output  Determination for billing document --> Mantain condition table,  in the pop-up choose the option "Field catalog: Messages for billing documents", there you can add standard field into the catalog, so you can add WERKS and the other one "document structure" I don't know what field it is, but if it is and standard field you can add it. If you have a Z field you need ABAP help to add the Z field to the structure "KOMKBZ5" and then you can add it to the catalog.
    Regards,
    Mariano.

  • How to send only part of a sequence to Encore?

    Hi
    I'm new to CS5.5 and I've been trying to figure out how to send only part of a sequence to Encore from PPro. I see in the Help file that it says this can be done but it doesn't explain how to do this (or I haven't been able to find where it's explained). When I use "send to Encore" with dynamic link it sends the whole sequence even though I've tried marking in/out or marking the section I want with the work area bar. Is it not possible to do this using dynamic link?
    Thanks!
    Steve

    Playing around with this a bit I found another method in addition to the one you described. I found I can mark part of the sequence with the work area bar and then use Export. The Export screen has an option to send the entire sequence or only the part under the work bar. Then I imported it into Encore and since it was exported with final disc settings Encore didn't have to encode it.
    But I think I will send in a feature request. Hopefully a lot of other people will also ask for this.
    Thanks
    Steve

  • Problem of Missing parts during the Process Order release

    Hi
    For a Make to Order strategy, I have run MRP for a sales order which resulted in planned order for the material. But when I try to convert the Planned Order to Process Order, I am getting error Parts are missing during the availabilty check even though the components are available in the stock.
    But when I create a Process Order manually, I am not facing the problem of missing parts as stock for components are available in stock.
    Please advice why I am facing the problem with Planned Orders which are created via MRP.
    Regards
    Brijesh

    Dear all,
    If we set the Individual requirement (1) in MRP4 view of the material master for the component, the system will not consider the plant stock and it will give the message like Parts are missing during the Process Order process even though the plant stock is exists for the component.
    So I would like to where in customization you define this?
    --> To not consider the plant stock if individual req is set (1)
    --> To consider the plant stock if collective req is set (2)
    Kindly advice,
    Regards,
    Brijesh

  • Exporting a part of a sequence to Quicktime movie!

    Is there a way to export a part of a sequence to quicktime movie in FCP?
    I come from Premiere world. In premiere there is a work area bar in the timeline; During AVI export it can be set to export clips within work area. That kind of ability seems to be missing in FCP. When I try to export, its exporting entire sequence. Is there a way to limit export area within a sequence?
    Thanks for your help.

    Thanks henners, I just figured that out myself. Thanks for your help anyways.
    Another question, Is there a set-up that I can make so that the clips that are exported to quicktime movie, automatically imported into the project. I know I can manually import the clip. Again, Premiere had the ability to do this. I looked through the preference set-up, didn't find anything.
    Thanks.

  • How do I modify custom step type that is part of a sequence?

    I have an example sequence that has a custom step type called "LabView Reentrant Action". My interest is to modify this step type to my needs. Because this custom step type is part of the sequence there is no definition in global type palette. I was told that I could copy this step into global type palette. But, I don't think I could.
    I can copy the step from the sequence space but I do not have an option to paste it in the palette.
    In sequence space I have options to choose LabView Reentrant Dialog Steps under Insert Step pull-down menu. When I open Step Type Menu Editor in the palette space, all types are listed except LabView Reentrant Dialog Steps. I think these are not showing in the palette because they are custom types built into the sequence.
    How can I extract the custom step type into global palette so that I could modify to my needs?

    Hello,
    If you already have the customer step type "LabView Reentrant Action" then to modify it all you need is to go in "Type Palette" (Ctrl-T) and make modifications in the step type.
    In case you are not able to see the step type in type palette then you need to add the step type in a custom ini file. You can add that ini file by clicking on customize in "Palettes" drop down menu. The you can copy paste a step in the step type and make modifications to the step.
    I would recommend going through Tutorial: How Do I Make a Custom Step Type? for more reference.
    I hope it helps..
    Rajiv

  • Import part of the sequence from another project

    I'm working on about the fifth edit of a project and now want to move part of a sequence (about 40 clips) from one project to another. I understand I could import the entire sequence and then delete all but the portion I want, or delete all but the portion I want and then import it as the entire sequence - but this might take a while. Anyone know of a quicker way to import a portion of a sequence from one project to another. Many thanks

    Thanks guys,
    Would have reported back earlier but have been on other adventures. FYI, never get involved in filming medieval stuff, they're insane. But back to the project in topic, unfortunately the lasso / copy from one project to another certainly did not work in this instance. However thanks to Craig Howard @ # 1. This is probably the only method that will work in this example and even so I'll report on it's outcome later.
    Thanks guys!

  • Exporting only part of the Sequence

    I do not have any in and out points on my sequence, but when I export, only part of the sequence exports. I have chosen numerous encoding presets, tried placing in and out points at the beginning and end, but it still does not work.

    I've tried exporting through DV NTSC and DVCPRO720p60.
    Say if I had a 10 minute sequence, then it'd only export 3/4th of it.

  • I have purchased my i phone 5 one month back, unfortunately I have got some hardware problem like some part has been broken from inside, but the phone works without any issue, Did anybody face this issue?

    I have purchased my i phone 5 one month back, unfortunately I have got some hardware problem like some part has been broken from inside, but the phone works without any issue, Did anybody face this issue?

    If you believe there is a hardware problem, call AppleCare or make an appointment at an Apple Store if there is one nearby.

  • Problem with editing parts

    Hello everyone.
    I have problem with editing parts when I'm login as manager. when i click on edit icon on parts detail page portal is openning home page. (ver. 5.9 pl 7)
    thanks
    Greg.

    Hi
    I think that all rights are ok any other idea.
    I have the same problem on two implementations. Some times is better then i change in web.config  debug="false"
    Can you try to answer to my second post home page after login please.
    when i roll over etid icon i have following link
    http://89.234.5.207/admin/catalog/Part.aspx?partno=505620 +0&backpage=PartSearch.aspx
    part code is 5056 20 0
    maybe it will be helpful
    Greg.
    Edited by: Grzegorz Jachec on Jan 29, 2008 5:14 PM

  • Genérer un rapport de test sous DAIDEM à partir d'une sequence Teststand

    Bonjour,
    Je souhaite mettre au point une séquence de test sous Teststand, mais l'éditeur de rapport de test de Teststand ne me convient pas.
    Dans ma séquence je souhaite donc rajouter un custom step DIADEM qui me permettrais en fin de ma séquence de tests de paramétrer DIADEM pour creer un gabarit de rapport de test (logo, mise en page,...), d'exporter mes resultats acquient sous Teststand et de générer un rapport PDF via DIADEM.
    J'aimerais que ce rapport PDF soit générer automatiquement à partir de l'exécution de ma séquence DIADEM.
    Comment dois je faire?
    Je ne connait pas quelle est la compatibilité entre Testsand et DIADEM (format des données d'enregistrement Teststand, formats des données accepté par DIADEM?).
    Dois je transmettre mon rapport Teststand à un VI Labview qui parametra DIADEM et lui enverra sous format TDM?
    Merci pour vos renseignements

    Hi Alexandre,
    It's not a problem.
    Sorry it's not LabVIEW, I had another look to see if there was a TestStand / LabVIEW version unfortunately there was not.
    Not really fimilar with DAIDEM but will try to help.
    Not sure what the Demo.vbs is, I downloaded the example and could not find that in the example code. Looking in the SequenceFile I have found the Demo.vbs in the setup of the "Run Script" step. Looking at the ExecuteScript.c I would have expected a piece of code that executes some function when the Sequence  runs and invoke the "Run Script" but this just appears to launch a CVI panel and expecting some user input.
    It looks like this steptype doesn't link directly with DIADEM but maybe indirectly via some Visual Basic code. If this is the case then it is not a very good example as it is incomplete. There is no mention of visual basic required in the readme file or the website link that I initially supplied.
    I'll try out the example later to day to try to understand it better.
    Regards
    Ray Farmer
    Have you tried running the example DIAdem Example.seq?
    Regards
    Ray Farmer

Maybe you are looking for

  • Editing a word document and reading on a Mac

    Using Document to Go, I edited a word document and saved the document.  I then sent this edited document to a friend who has a Mac using the new Snow Leopard operating system - he could not open the edited document, but could open the unedited, origi

  • How to get the Material-Document-Number wie the delivery-Number+Position???

    Hi, we want to connect mseg and likp+lips. But therefore we need the Material-Document-number concerning this delivery and in likp+lips isn't a Material-Document-Number! Could anybody help me to connect likp+lips with mseg!

  • Using data rule on table level

    Hi We want to implement a data rule that compares the grand total in the target table with the grand total in the source table. In case of difference, we only want one record in the error table. That seems not possible out of the box. We could implem

  • Odd Active directory issue

    Some background. The company I work for is almost all PC, however, our graphic designers run mac, for obvious reasons. I'm the only I.S. tech with any mac experience at all, so it has fallen on me to get them all officially on the domain now. I'm usi

  • How do i parse a string

    Can somebody tell me the function used to parse a string and how it works? All I want to do is seperate the string 'AG-01' into another string 'AG-' and an int '01'. I have been through numerous resources and have found nothing at all on parsing func