Create Sequence which return only +1 and -1

Please Help me to create a sequence which return only two values
i.e. +1 and -1

How about this?
SQL> CREATE SEQUENCE test_sequence INCREMENT BY 2 START WITH -1 MINVALUE -1 MAXVALUE 1 CYCLE NOCACHE;
Sequence created.
SQL> SELECT test_sequence.nextval FROM DUAL;
   NEXTVAL
        -1
SQL> SELECT test_sequence.nextval FROM DUAL;
   NEXTVAL
         1
SQL> SELECT test_sequence.nextval FROM DUAL;
   NEXTVAL
        -1
SQL>Here is some further reading on sequences:
http://www.psoug.org/reference/sequences.html

Similar Messages

  • Create link which returns true or false

    i need something that allows the server to send a message to the client asking them if they wish to acept a file. Idealy i would like it to be a link similar to that of msn messenger. but i cant seem to find something similar.. any sugestions as to what i could use would be great

    ive looked intho this option and it seems u required the actionevent listener to perform this task. howeve because im calling another gui there wont be a action event. i need create the pannel without a action click is there a way to do this?
            Component source = (Component) actionEvent.getSource();
            JOptionPane optionPane = new JOptionPane("Accept file?",
                JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);
            JDialog dialog = optionPane.createDialog(source,
                "File Sent");
            dialog.show();
            int selection = OptionPaneUtils.getSelection(optionPane);
            System.out.println(selection);Message was edited by:
    helen_166
    Message was edited by:
    helen_166

  • Only 'EQ' and 'I' allowed for selection parameters

    Hi!
    We are generating the list of POs with open GR thru ME2M with selection parameters of WE101 and WE107, however, we encountered an error which states "Only 'EQ' and 'I' allowed for selection parameters."
    What shall we do?

    Hi,
    This error will have nothing to do with the selection parameter setting but the variant you are defining for your ME2M transaction.  Can you therefore provide detailed info on how you set it up in your system?
    Cheers,
    HT

  • SQL- Query that return only one record

    Hello,
    is it possible to execute a pure SQL-Query which returns only one row although multiple rows are found.
    It is no problem in PL/SQL, but I have no idea if the same is also possible in SQL.
    thanks in advance
    Michael

    Why not? There are 4 records in this table, but only selected one.
    SQL> with t
      2  as
      3  (
      4     select '#%$@#$@$@##$' Addr from dual
      5     union all
      6     select '18 Jalan Scott' from dual
      7     union all
      8     select '18 Lemana St' from dual
      9     union all
    10     select '32-penstation' from dual
    11     union all
    12     select '99999999999' from dual
    13  )
    14  select addr
    15    from t
    16   where rownum =1
    17  /
    ADDR
    #%$@#$@$@##$
    SQL>Cheers
    Sarma.

  • I create a new sequence, put the clips in the timeline, save sequence, click on another sequence, then return to the recently created sequence, and it's blank. ??

    I have created a new sequence, dragging my subclips in. All looks fine. I save. I return to another sequence, then go back to my recently created sequence, and it is blank.

    You really should keep your contacts in your Personal Address Book.
    You can drag and drop contacts between address books.
    When sending a message, and the recipient isn't in your address book yet, Thunderbird automatically adds the recipients email address to Collected Addresses. You can turn that off though.
    To create a mailing list:
    http://kb.mozillazine.org/Thunderbird_:_FAQs_:_Create_Mailing_List

  • Create sequence, function and view all at once -script or something similar

    Hi I would like to know in what way can I write a script or something like that which would define names for a sequence, function and a view in the beginning (for example TEST_SEQ, TEST_FJ, TEST_VIEW...) and after that create this sequence, function and view with definitions like
    CREATE SEQUENCE  TEST_SEQ
    MINVALUE 1 MAXVALUE 999999999999999999999999999
    INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE;
    create or replace FUNCTION TEST_FJ RETURN NUMBER AS
    tmp number;
    BEGIN
    select TEST_SEQ.NEXTVAL  into tmp from dual
    RETURN tmp;
    END TEST_FJ;
    and so on...
    In the end I would also like to grant some rights on these objects I just created:
    grant select on TEST_SEQ to public;
    grant execute on TEST_FJ to public;
    So my question is how to package all these things together so I can execute them from a single file in SQL Developer, and if i need to change the names of these tables I want do it in one place in the beginning of this script (or something like a script, I'm not sure what)...
    Thanks in advance!

    hi,
    hope help you...
    this is my basic generic solution...
    create or replace procedure createSequence( psequenceName in varchar2 ) is
    begin
    execute immediate 'create sequence ' || psequenceName ;
    execute immediate 'grant select on ' || psequenceName || ' to public ';
    end ;
    create or replace function getNextVal( psequenceName in varchar2 ) return number is
    queryText varchar2(100) := 'select <sequence_name>.nextval into :next_value from DUAL' ;
    next_value number ;
    begin
    queryText := replace(queryText,'<sequence_name>',psequenceName);
    execute immediate queryText into next_value ;
    return( next_value ) ;
    end ;
    Edited by: edogt on Nov 27, 2008 5:33 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM

  • How to configure to run SNP that creates only PReq and Stock Transfer only?

    Hi all,
    I am very new to SCM.
    Please help me on the scenario like this:
    -There are 3 Distribution Centers (DC): 2400, 2500, 3800 and a Vendor: 1003.
    -Each DC can take products from otherDC. But only DC 2400 can directly send purchase requisition to Vendor  1003 when no stock at all DCs.
    -There is a Forecast released from Demand Planning to SNP, that is 1000 products at Distribution Center 2400.
    -I will run SNP Heuristic (or Capabable to Match or Optimization) to cover this demand.
    -Usually, SNP can create: Purchase Requisition, Stock transfer Requistion, and Planned Order.
                         But I only want the SNP to create Purchase Requisition and Stock Stransfer only.
    The question are:
    1.In which situations (tock situation,u2026) the system can create Requisition and Stock Stransfer only ?
    2.I need create a new Supply Chain  Model (Model) and a new Planning Version from scratch. How can I configure the system (Transportation lanes, Product Master Data, Procurement type in product masteru2026) and make it run to satisfy this scenario?
    3.Do I need setting differently for each SNP method ( Heuristic, Capable to Match, Optimization)?
    Thanks very much for your support.
    XuanDuyen

    Dear Mr. Aparna,
    Thanks for your quick reply.
    Now I haved created a model like the scenario with product T-F204 and can run. ( I do not use vendor 1003. I created the Plant 1000 instead). But as you said, when I run with SNP Heuristic method (Network level), the system alert:
      u201C Error exist in Locationsu2019 processing sequence for product T-F204u201D
    However, I search internet and found a book about CTM. It also discuss about this and the solution as below:
    u201CRecursive Replenishment
    When using complex supply chains, with many locations and various directional
    supply routes, it can be easy to confuse a level-by-level planning tool. In certain
    situations, recursive planning can occur. Recursiveness, is when the planning
    algorithm is thrown into a loop (circular replenishment). Location 1000 can ship
    to location 2400, and location 2400 can ship to location 1000. Situations such as
    this can cause the CTM engine to terminate since it cannot find a starting point.
     The solution: Reduce to number of muximum consecutive transport order chains.
    Within the CTMProfile, Settingsu2192Master Data Settings tab, planners can control
    the sources of supply for External Procurement. With the parameter Maximum
    Number of Consecutive Stock Transfers, you determine how many consecutive
    stock transfers CTM planning can create. This value does not restrict the total
    number of stock transfers for a demand. If you enter a value here, you can prevent
    the system from transporting the receipts for a demand over several locations due
    to the procurement priority. Also, you must have modeled the master data in such
    a way that a direct stock transfer is possible if the system ignores the procurement
    priority. If a direct stock transfer is not possible, CTM cannot fulfill the demand.u201D
    Currently, our system runs only with Heuristic. It could not run CTM and Optimization so I could not check.
    My questions are:
    1.     Is the solution of the book can apply for my bi-direction transportation lanes requirement?
    2.     If it is true, with my scenario, what is the best u201CMaximum Number of Consecutive Stock Transfersu201D I can set?
    3.     How can I model u201Cthe master data in such a way that a direct stock transfer is possible if the system ignores the procurement priorityu201D?
    Please follow the link to download the book (and view page 107 of book (page 117 of Acrobat Reader) as bellow if you want:
    http://www.mediafire.com/?9clag9op3lm0iv9
    Thanks very much for your help!
    Xuanduyen

  • Help creating a formula which returns current date last year

    I need help creating a formula which returns the current date last year. I also need it to work during leap years.
    Any ideas?

    Hi Dagros,
    I'm lucky to be a universe designer, I have to do this only once
    The easiest way would probably be to use
    =RelativeDate(CurrentDate();-365)
    So subtractiing 365 to get the same date last year,
    but you would need some extra logic for the years with a feb 29 in those 365 days.
    =If FormatDate(RelativeDate(CurrentDate();-365);"dd") = FormatDate(CurrentDate();"dd")
    Then RelativeDate(CurrentDate();-365)
    Else RelativeDate(CurrentDate();-366)
    Another question to ask is if you really want the same date last year, or if you also want a really 'same day' so monday compared to monday etc. in this case you would just subtract 364 days and get the day 52 weeks back...
    Good luck,
    Marianne

  • How to create a transport request with query and only with its structure.

    HI guru,
                how to create a transport request with query and only with its structure.transport request should not  include any other query items like ( variables, conditions...etc)
    thanks in advance.
    venkata

    Hi,
    Goto RSA1 and then Transport Connection -> In SAP Transports select Object Types-> Query Elements -> Then select Query->Give Technical name of the query and then select for transfer. In the right side you can choose the components which you wanted to transport.
    Regards,
    anil

  • I can't export my video which contains only photos, sound tracks nor play it in fullscreen iMovie it shuts down. And now my whole file won't open at all it'll open with nothing inside ??

    I can't export my video which contains only photos, sound tracks nor play it in fullscreen iMovie it shuts down. And now my whole file won't open at all it'll open with nothing inside ??

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • HT1998 Why can't I uninstall AirPort 4.2 from my Windows 7 PC..  I downloading and reinstalling the 4.2 but during the installation process I get an error.  It reads...    "1608: Unable to Create InstallDriver instance Return Code -2147024894

    Why can't I uninstall AirPort 4.2 from my Windows 7 PC..  I tried downloading and reinstalling the 4.2 but during the installation process I get an error.  It reads...    "1608: Unable to Create InstallDriver instance Return Code -2147024894

    You should not install it again..
    Boot the computer into safe mode and try the uninstall again.
    No luck you will have to manually uninstall which is a pain. Delete the files and open regedit and delete the registry entries.. better still use the system restore to go back to a previous system where you had no 4.2 installed..
    Or just ignore it and install the latest 5.6.1 and if it gives trouble well do a clean install of windows.

  • Tables used when creating a sales return with and without refrence

    Hiya gurus,
                    I am developing a report to display sales order and sales return created from one partiular storage location and for one particular division. I need to get the tables used when creating the sales order and the sales return's.
                   For sale order I would be using VBAK and VBAP but for sale return with refrence and without refrence i am not sure which tables to look for.
                 kindly please let me know which tables i go for to get the sale return data.
                Thanking you very much, your efforts are deply appreciated
    Cheers,
    ZIa

    Hi,
    U can see VBFA tablefor CompleteDocu flow with differentconditions.
    Regards,

  • How to create a jframe which has only the close button

    hi
    i want to create a jframe which hold only the close button on the title bar. just like an JOptionPane.
    hussain52

    Well, if you are in a window's environment and using forte, you can go to sample forms, MDI, and then just highlight and delete what you don't want from the menubar.

  • Single timelline sequence which incorporates 50i and 24p HDV footage

    Hi.
    I have one scene in an upcoming short film shot on the sony HVR-Z1 camera (50 interlaced), and the rest of the film is shot on the JVC GY-HD100 camera (24 progressive). I need everything in one timeline, and eventually out in a single sequence full-resolution format. How do I integrate the two?
    Can I use the same custom 24p Apple Intermediate codec for all of the editing? I assume this is impossible as the sony material is interlaced? How can I get a satisfactory agreement between the 2 with as little image-quality compromise as possible?
    Will there be a great deal of difference in the look of the 2 formats? The aspect ratio? Any suggestions on how best to hide the differences? I'm pretty new at this, so apologies if I am asking silly questions?
    Thanks!

    Hi there. Thanks for your prompt reply. I am aware that as of yet I´m unable to capture directly to FCP with the JVC. I have bought some mediating software which allows me to do so, called Lumiere.
    What I have at the moment is compressed MP2 files and I am working with their xml counterpart files in FCP with the Apple Intermediate Codec. I am wondering however, how to get the material out into as fully a decompressed format as possile for color correction, sound synching etc?
    I have noticed that even in this recommended intermediate codec the material doesn´t play consistently in my viewer. There are lags and freezes, as well as unsynched stretches of audio. I have 2 choices for printing to tape. I can use either a sony HDV deck or the JVC camera itself. I haven´t a decklink card at present so I am wondering what my best option is (format wise) for succesful transfer via firewire to tape?
    What kind of size are we talking for a 4 to 5 minute decompressed HDV clip when rendered as a stand alone finished sequence?
    My intention is of course to have the best image res in the finished hard copy, and I am admittedly new with this sort of thing, having only rendered and edited in DV before. Any suggestions or help would be appreciated.
    Thanks,
    -Tom

  • Create Sequences on one computer and render out from another

    Essentially what i'm trying to acheive is to use Premiere Pro (CS6) on my Mac to create sequences themselves but use a PC on the network to do the rendering work overnight.
    I create a number sequences, anywhere from a few minutes each that can be combined into hour plus long final videos.
    Is there a way to "package" a project onto a network drive where the PC can then see the project itself with the relevant source media?. I can move the project file and the source media singularly but I then need to manually relocate the media each time.
    The workflow would then be
    All source media originally loaded onto Mac
    Sequences within project made on the Mac
    When ready for rendering transfer to PC
    PC does work with Media Encoder, freeing up Mac for other tasks.
    Any help or suggestions would be most welcome!
    Thanks guys

    You will first have to have a consistent folder naming setup for both computers, so PPro may find the files
    You will need to have the project and all files in one place on the server, and then copy everything to the appropriate computer for work... PPro does NOT work on a network, only on a local hard drive
    So... edit on Mac, copy all to server... copy all to PC... render on PC... copy all back to server
    Some reading about networks...
    Win Server is NOT supported http://forums.adobe.com/thread/851602
    Not in a Network environment http://forums.adobe.com/thread/771151
    -a work around, of sorts http://forums.adobe.com/thread/957523
    -and not on a "domain" http://forums.adobe.com/thread/858977

Maybe you are looking for

  • How to update timeout and interval of DSN in CF10 Admin API?

    Hi, We are trying to update an existing MSSQL DSN. Can we just overwrite the DSN to update it? Secondly, the timeout and interval values never update, and these are the values we want to change. Is this a bug Adobe? Do you have an example of a MSSQL

  • How to send FAX using JSP

    Hi All I have a requirement in my JSP application to send documents stored on a system by FAX to a fax machine, I had also the requirement to send mails but that was solved using JavaMail. But is there any method through which a FAX can be sent to a

  • How do you view lyrics on itouch with the new Jan. software update??

    How do you view lyrics on itouch with the new Jan. software update?? Thanks!!

  • VLAN Best Practice For IT Computers

    In an environment with basic VLANs (Servers, network infrastructure, workstations, IoT devices, wireless), is it commonly perceived as better to place IT workstations (around 6 or so) in their own VLAN? I suppose I am debating whether to create acces

  • Creating Timelines in CS3 Illustrator

    Does anyone know how to create timelines (needed for a trial board for a lawsuit) in CS3 Illustrator? I use Windows. I've been searching books and the internet, but haven't found anything. do I just use the simple shapes and pen tools or are their be