Help me in sequence number generation

hi
i had written a JSP which reads and displays the all the directories in that pertucular folder
when i click on a perticular folder it should read each and every file in that folder and it should rename it with a sequence number
i.e file0001,file0002,file0003 etc....
the sequence should be reset for each folder and if i add some new files in to diretory it should remember last sequence number and it should assign next number onwards to those files.
at any point of time i may move or deete any file
but each and every foler i should keep track of last sequence number assigned so that next onwards i can reame new files from that number
another constraint is i may delete the files in that directory
i am new to java
so PLZ help me how effeciantly i can write a program
if so PLZ provide me an example
thanks in advance

when i click on a perticular folder it should read
each and every file in that folder and it should
rename it with a sequence numberShould the files in the underlying file system be renamed or is this "renaming" just an abstraction layer you maintain yourself? In that case you can use JTree of Swing to maintain an own file structure on top of the OS. You just map "your" filenames to the real file names underneath.

Similar Messages

  • Help on counter (Sequence number generation)

    Hi all,
    Need to ask smething about the counter to generate the sequence numbers and pass it to the target field.
    If we use the Global containers, then say if the app server goes down, the current count will also vanish. Am I correct?
    So thats the case, then we should use the DB lookup for the same?
    Also, the INDEX function in the Statistics part in the GUI of Message Mapping, how much that is helpful?
    Respond back at the earliest possible.
    Thanks in advance.
    Neetesh

    Hi,
    just one point about your sentence: <i>If we use the Global containers, then say if the app server goes down, the current count will also vanish. Am I correct?</i>
    For me you are wrong, if your application server shut down during your mapping execution, then you will <b>NOT</b> have an inbound message for your target system, because your system is stopped. And you will have a red flag inside SXI_MONITOR.
    Mickael
    one question: what is the direction/sense of your flow? "XI -> ZZ" or "ZZ -> XI" ?
    Message was edited by: Mickael Huchet

  • Enq: TX - row lock contention in forms 10g sequency number generation

    Iam Getting the Deadlock issue in oracle formdeveloper 10g database is 11g Acutually in our small Hospital organization using different forms generating entrying labrequest form finally save time
    one sequency number will generated i have give procedure below every save criteria form using below procedure some time iam getting lock iam using blocksession query i have find out some
    OSUSER
    MACHINE
    TERMINAL
    PROGRAM
    SQL_ID
    LOGON_TIME
    BLOCKING_SESSION_STATUS
    BLOCKING_SESSION
    EVENT
    user423
    UMCCDOM\LEVEL4-MICU
    LEVEL4-MICU
    PrjMcr.EXE
    0ccngw7dfkmgb
    23/09/2013 11:34:41 AM
    VALID
    277
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    23/09/2013 11:32:50 AM
    VALID
    186
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    22/09/2013 2:49:47 PM
    VALID
    277
    enq: TX - row lock contention
    SYSTEM
    WORKGROUP\PRIAPPSVR
    PRIAPPSVR
    frmweb.exe
    0ccngw7dfkmgb
    23/09/2013 7:00:22 AM
    VALID
    186
    enq: TX - row lock contention
    user290
    UMCCDOM\LEVEL2-N
    LEVEL2-N
    PrjMcr.EXE
    0ccngw7dfkmgb
    23/09/2013 10:28:06 AM
    VALID
    277
    enq: TX - row lock contention
    lock are happen after open the code i have find out used FOR UPDATE in procedure please tell me any alternative for this every labrequest form saving time using this procedure for generating prefix sequence number multiple user using with different systems
    PROCEDURE   Gsp_GenSeqNum (I_SvPrefixCd IN VARCHAR2,I_SvUserName IN VARCHAR2,
                              O_SvSeqNum OUT VARCHAR2) IS
    --This Procedure generates the sequence number
    --by retrieving the prefix based on the code
    --supllied to the procedure.
      CURSOR  crSeqGenerator IS
             SELECT Gsn_prefix_last_num, Gsn_prefix_year
                FROM G_SEQUENCE_NUMBER
             WHERE Gsn_prefix_Cd = I_SvPrefixCd
                   AND Gsn_prefix_year = TO_CHAR(SYSDATE,'YYYY')
      FOR UPDATE OF Gsn_prefix_last_num;
      udSeqNum        G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
      udNextSeqNum    G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
      udYear          G_SEQUENCE_NUMBER.Gsn_Prefix_year%TYPE;
      udPrefix        G_SEQUENCE_PREFIX.Gsp_Prefix_Value%TYPE;
    BEGIN
      SELECT Gsp_Prefix_Value
      INTO udPrefix
      FROM G_SEQUENCE_PREFIX
      WHERE Gsp_Prefix_Cd = I_SvPrefixCd;
      OPEN crSeqGenerator;
      FETCH crSeqGenerator
       INTO udSeqNum,
            udYear;
      IF crSeqGenerator%FOUND THEN
         udNextSeqNum  :=udSeqNum + 1;
         O_SvSeqNum     := udPrefix||'/'||TO_CHAR(SYSDATE,'YY')
                                   ||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
      ELSE
    INSERT INTO G_SEQUENCE_NUMBER VALUES(I_SvPrefixCd,TO_CHAR(SYSDATE,'YYYY'),0,I_SvUserName,SYSDATE);
         udSeqNum      :=0;
         udNextSeqNum  :=udSeqNum + 1;
         O_SvSeqNum:=UdPrefix||'/'||TO_CHAR(SYSDATE,'YY')
                             ||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
      END IF;
      UPDATE G_SEQUENCE_NUMBER
         SET Gsn_Prefix_last_num=udNextSeqNum
       WHERE Gsn_Prefix_Cd = I_SvPrefixCd
         AND Gsn_Prefix_year=TO_CHAR(SYSDATE,'YYYY');
      CLOSE crSeqGenerator;
    END Gsp_GenSeqNum;
    Thanks
    subbu

    This application is inbuit with some modules VB (cath ,cardio)and oracle forms for required sequence number generation different time used this procedure whereever required the sequence Prefix generation.If i replace the procedure sequene to oracle standard sequency if the user cannot save the form unnessary sequency generated order is missing from sequence.

  • Sequence Number Generation in XML Form Buider??????

    Hi All,
    I want to generate some Sequence Number for each XML Form Generated by the XML Form Builder Application?
    Ex: my XML Form Builder Application is "MYAPP". Using this I filled data and Save, then an XML will be created, then it should have some unique Number(say 1234), then if I fill the differennt Data and Save, then another XML will be created. For this the Number should be 1235, next 1236, ........
    I can use the XML Form ID, but that is not User friendly format. Becaz I need to display this Number to the End User.
    (Example: 10b2ae7b-e269-2b10-d88e-ddade2e62015.xml)
    If anybody have idea on this, Please guide me...
    Thanks&Regards||
    Ashok M.
    Edited by: Ashok Kumar Munugoti on Oct 16, 2008 8:04 AM

    closing this Thread.

  • Sequence Number Generation

    Hi,
    I want to generate sequence number to Particular Column whenever a new record is created .i.e when i create SR the column value should be 1,2, 3....
    how to achieve autogeneration of number while creating records

    The reason why you can't do this is because, system referes the Row id while creating the SR number. which comes from the database table. you can not control that. As venky suggested, you can achieve this by using webservices to call the external system which will generate the SR number in series and assign it to your CRM SR.
    All the best.
    Nisman

  • Sequence Number Generation with Global Container

    Hi ALL,
    Can any plz send me the steps of using global container for generation seqence number's
    And also if possible send me the code.
    Thanks & Regards
    Rupash

    Hi Rupesh,
    chack this code:
    public String seqNumber(Container container)
          int i;
          GlobalContainer global=container.getGlobalContainer();
          String getnum=(String)global.getParameter("a");
          if(getnum==null){
                     global.setParameter("a","1");  i=1;
          else{
                i=Integer.parseInt(getnum); i++;
                global.setParameter("a",String.valueOf(i));
          return String.valueOf(i);
    **Reward points if helpful
    --Sankar Choudhury

  • Problem with "Number Generation Program'

    Can someone please help me with my Number Generation Program. I am new to java and I am at a sticking point. I want to develop a program that will do the following:
    1. Accept a set of numbers (6 numbers per set).
    2. Remove duplicate numbers.
    3. Generate unique set of numbers (6 numbers per set) using only the numbers that were originally entered.
    example: -> numbers entered: 12 33 45 51 7 10
    5 34 33 8 11 21
    5 6 13 9 10 51
    duplicate numbers removed: -> unique numbers
    12 33 45 51 7 10
    5 34 8 11 21 6
    13 9
    Final result: -> generate unique set of numbers only using the above unique 14 numbers
    5 6 7 8 9 10
    5 6 7 8 9 11
    5 6 7 8 9 12
    5 6 7 8 9 13

    I am having a problem with the following:
    1. accepting the numbers
    2. removing duplicate numbers
    3. generating the number sequence sets
    As I mentioned earlier, I am new to java. I just completed my first java class and I wanted to develop this program.

  • Sequnce Number generation in Message Mapping..

    Hello All,
    I am using this thread as a reference for declaring a Counter for unique sequence number generation...
    Sequence Number in XI Mapping
    -> define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
    enter the following in the GlobalVariables Section
    Integer counter =0;
    -> define a user defined function (SeqGen let's say)
    write the following code in it.
    Integer seq = 0;
    GlobalContainer globalContainer = container.getGlobalContainer();
    a = globalContainer.getParameter("counter");
    seq = globalContainer.getParameter("counter");
    seq = seq + 1;
    globalContainer.setParameter("counter",seq);
    return a;
    now use this user defined function (SeqGen)in all ur mappings to the sequence no of ur line items.
    If u could just elaborate on creation of UDF.. on what are we goin to pass in the variable 'a'...  while creating the UDF. ??
    Harpreet..!!

    Hi harpeet,
    A UDF can be of two types a  Simple UDF and Adavnced UDF.
    This is a case of a simple UDF,
    A simple UDF returns only 1 element  as  an output. 
    here 'a' is such an generated output.   you can assign this to any numeric filed of ur target stucture
    This UDf does not require any input Field from the message. 
    These functions are known as generating functions.
    Hope this explains.
    Reward points if useful.
    Regards,
    Abhishek

  • Next Sequence number - Urgent help

    I have to pass in a sequence number in my method.
    The sequence number is the order an attribute should appear in relative to other attributes in this Address object.
    Can anyone help in how i am to do this.....i am confused!!
    Ta
    Sammy

    Sorry if i confused you.
    I have an object which contains attributes that are dislayed. On the UI the user can add an attribute to that object.
    Eg: Address object, it has attributes, line1, line2, town, postcode. The user can add an attribute called county to the object.
    My address object contains a parmeter called sequecene. So when the attribte is added, it should be added to the next sequence- so for teh example above it would be sequence no 5. So i think i need to work out the maximum sequence number of the contained attributes in the object.......but not sure how to do this.
    Any help would be appreicated.
    Thanks
    Sammy

  • File name generation with sequence number

    Hi All,
    My scenario is, File to File.  I need to generate the filenames at the target side like File1.xml, File2.xml..File9999.xml for each file triggered from source system. The interface tiggesrs multiple times in a day.
    For example, for the first time, 5 files triggered, need to generate File1.xml,File2.xml..File5.xml. After some time the interface might trigger with 10 files, then need to generate files as File6.xml,File7.xml....File15.xml . Once the file count reaches 9999 then need to generate the files from  1 (File1.xml)again.
    Could you please suggest me the possible solutions. For this any Lookups required?
    Regards,
    Praveen Kumar

    Hi Praveen,
    Case 1: If a field in source data carries the information regarding the sequence.
                 You can map this value ( Directly .. or using some transformation ) in some temporary field in the target and then use a Variable substitution at the receiver communication channel.
    Case 2. If the source file name carries the sequence information. then you can enable the Adapter specific settings in the Sender communication channel , and then get the information of the source file name using the Container object in the mapping. Then assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
    Case 3 : If Case 1 and Case 2 are not applicable ... then you have to use a  Ztable  to store the sequence number , a function module to fetch the number , and then use a UDF  in which you will implement the  RFC call logic.Then the same process ....      assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
    BR,
    Sushil.

  • Help with sequence number using Dual

    I am a beginner here, so I would really appreciate if you could give me some pointers to the following problem.
    I am using the Dual table to generate increasing sequence numbers, 1,2,3.... But the output numbers seems to jump from time to time, i.e. 1,2,3,11,12...
    First of all, I don't know if this is the best way of generating incremental sequence numbers. Second, I could not understand why the sequence number jumps, since there is only one instance calling the Dual table, why should it not be sequential? Or is it supposed to be sequential?
    I am running on Linux.
    Many thanks in advance.
    John

    The overhead you see will depend on how often you are selecting new numbers. If you are hand testing inserts, you probably won't notice. If you are creating lists of input data dynamically occaisionally, it may be acceptable. If you are doing rapid batch inserts in a production environment, it probably won't be acceptable. Another question is why do you care if all numbers are used so long as all entries are unique? Sometimes there is a user requirement for this, and all the programmer can do is set it up.

  • Error While Generating Sequence Number. Contact your system Administrator

    Hi All,
    I have developed a form to provide our client with 'an easy to fill' User Interface. This form will be used instead of the standard form present in Business Suite.
    Some columns of the table, on which form is based, are getting populated via generation of sequence numbers.
    Now the problem is, after deploying custom form developed by me in the instance, Standard form is showing this error
    " Error While Generating the Sequence Number. Please contact the System Administrator "
    I am unable to trace why this error had started appearing..
    Any suggestions would be of great help...
    Thanks in Advance,..

    Forms version 6i,
    Database version 9.2.0.6.0
    Sequences which I am using are used there in Standard form also..
    So evrytime i need to save the record, I am selecting NEXTVAL of it into
    the respective item of the datablock..

  • How to Create an Custom Employee Number Generation ...

    Dear Friends,
    We are Implementing HRMS Suite Version12i, for one of the Client in Middle east.
    One question about Custom Person Numbering.
    How to create custom employee numbering Based on the User Person Type?
    Example:
    Two person types
    o Permanent Employee
    o Probationary employees
    We Need to give two different numbering schemes for each person type.
    eg Permanent Employee will use a seq begin 100000 whereas Probationary employees (other user type) will use a sequence beginning 200000.. Can any pls let me know how to handle the Custom Employee Number Generation (with Setups)
    With regards
    Swpana

    Hi,
    Could you please help me to write/or send a sample of a Person Number Generation Formula.
    I don't see the noteid : 279458.1 on metalink,I get the following message:
    Article or Bug cannot be displayed. Possible reasons are:
    The article Id or bug number was entered incorrectly. Please check and try again.
    The article Id or bug number does not exist (was referenced incorrectly).
    The article or bug is not classified as publicly accessible ("non-public").
    The content is being updated and it is temporarily unavailable but will be made available again soon.
    If you still have questions about why you could not access this article or bug, please use Feedback.
    Please help!!

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

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

Maybe you are looking for

  • How to create an ERP Sales Order in CRM by referring to CRM Quotation

    Hello Experts: My requirement is as follows: I have done the replication of customers and materials between ECC and CRM.  I need to create a quotation in CRM and create a follow-up transaction as ERP Sales Order within CRM. My question is: how do i l

  • Unable to connect to MySQL database in Dreamweaver CS3

    I have been working on this problem for hours and am getting very frustrated. I hope someone can help me out. My FTP server and MYSQL server have to use two different hosts. I will be using false information in this post but hopefully someone can hel

  • "Search for Jobs" link not working in E-Recruitment

    Hi, Whenever Employee/External Candidate clicks on the link "Search for Jobs" on the start page, list of jobs are not getting displayed despite after data is available.

  • TS3367 I can call my friend threw her face time, but she can not call me.

    My face time is able to call all my friends threw their face time. But when it comes to one of my friends, she can not call me or message me threw face time, she can't call anyone threw face time. I can't seem to figure out how to get hers to be able

  • Unwanted border around png picture

    I cutout unwanted content in a picture selecting a mask then saving for web as a png to show on a web background. But the picture shows a faint light coloured hairline border against a grey webpage background.  How can I get rid of this unwanted bord