Logic of the sequence

HI friends,

IN a table, we have the value of column as (IAL030003IND).
To delete the 0 after the IAL.
After the removal of 0 the value of the column looks like (IAL30003IND).
Then, you must add A after 3. Now, look at the value of the column slike (IAL3A0003IND).
Need to add A, B, C, D, based on the sequence aplhabetical.

CREATE or REPLACE procedure My_proc_1
IS
total_val number (6);
cursor c1 is
Select substr(data,1,3). substr(Data,5) new_col text_1 update of data;
new_col2 varchar2 (40);
BEGIN
total_val: = 65;
FOR employee_rec in c1
LOOP
text_1 update
data value = substr (employee_rec.new_col, 1, 4). Chr (total_val) | substr(employee_rec.new_col,5) location being the c1;
total_val: = total_val + 1;
If total_val > 90 then
total_val: = 65;
end if;
END LOOP;
commit;
END;

This above query works fine for the logic above.

But if I pass the value of the column as (IAL0110003IND) then it shows the output voltage
(IAL1I10003IND),
If I pass the value of the column as (IAL0120003IND), then it displays the output voltage
* (IAL1J20003IND) *.
where I have put out as (IAL11I0003IND) and (IAL12J0003IND).

Table creation script:
create table text_1
(
given varchar2 (20)
)

insert into text_1 values ("IAL0120003IND")

Please suggest.

lony wrote:
In the query, we need to adapt to the logic.
This query is partially correct if I pass the value of the column as (IAL030003IND), then he'll be back (IAL3A0003IND).
I pass the value of the column as (IAL040003IND), and then he'll come back (IAL4B0003IND).

But the problem is when I change the value of the column as (IAL0120003IND) and then he will return (IAL1J20003IND) whicc is not correct result.

where I have put out as (IAL12J0003IND).

As for my last request? Is not what you want?

Tags: Database

Similar Questions

  • Generate the sequence number

    
    create table t
    (id int primary key,
    dt date,
    file_no int,
    batch_no int,
    data varchar2(5)
    );
    
    insert into t values (1,trunc(sysdate),23,113,dbms_random.string('a',5)); -- 1.1.1
    insert into t values (2,trunc(sysdate),23,345,dbms_random.string('a',5)); -- 1.2.1
    insert into t values (3,trunc(sysdate),23,345,dbms_random.string('a',5)); -- 1.2.2
    insert into t values (4,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.1
    insert into t values (5,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.2
    insert into t values (6,trunc(sysdate),23,543,dbms_random.string('a',5)); -- 1.3.3
    --
    insert into t values (7,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.1
    insert into t values (8,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.2
    insert into t values (9,trunc(sysdate),24,333,dbms_random.string('a',5)); -- 2.1.3
    insert into t values (10,trunc(sysdate),24,222,dbms_random.string('a',5)); -- 2.2.1
    insert into t values (11,trunc(sysdate),24,222,dbms_random.string('a',5)); -- 2.2.2
    insert into t values (12,trunc(sysdate),24,111,dbms_random.string('a',5)); -- 2.3.1
    
    
    

    Oracle 11.1

    How can given this structure and data, I generate sequence at the end of each line numbers? Basically, the sequence number (x.y.z) is such that x (1.n) is awarded for each unique value in file_no. In each x, y (1.n) is assigned for each unique value of batch_no. Within each y, z (1.n) is assigned for all records of this batch. Sample data shows only dt but all sequences must reset and start over when dt changes.

    I tried using row_number() over (partition by dt, file_no) and such but nothing quite gives me what I'm looking for.

    Help? Thank you

    Hello

    HELEN wrote:

    If you look at my CREATE TABLE, the ID column is a primary key and represents the order of the data in the file.

    Done batch_no = 100 come before or after 101?  Batch_no = 100 a ID so much until after the id for batch_no = 101.

    Good point, but that won't happen because of the way the 'record' is generated. All batch_nos will be contiguous. So if batch_no 100 comes earlier in the file as 101, it should get some 2nd highest sequence number. Otherwise, lower. Basically, the 2nd part of the sequence must simialar logical number to the 3rd party (i.e. order by id) but that messes things. Still struggle with it. Any help appreciated.

    I think I understand.  You say that, because of the way that the ID is issued, it wouldn't matter if you used the highest id of the batch_no, or the lowest id, or the average, or if you chose one at random; you would get the correct order in all cases.

    The following query uses the id low in the order file_no and batch_nos.

    WITH got_min_ids AS

    (

    SELECT id, dt, file_no, batch_no, data

    MIN (id) over (PARTITION BY dt

    file_no

    ) AS min_id_file_no

    MIN (id) over (PARTITION BY dt

    file_no

    batch_no

    ) AS min_id_batch_no

    T

    )

    SELECT id, dt, file_no, batch_no, data

    DENSE_RANK () OVER (PARTITION BY dt

    ORDER BY min_id_file_no

    )

    || '.'

    || DENSE_RANK () OVER (PARTITION BY dt

    file_no

    ORDER BY min_id_batch_no

    )

    || '.'

    || ROW_NUMBER () OVER (PARTITION BY dt

    file_no

    batch_no

    ORDER BY id

    ) AS seq

    OF got_min_ids

    ORDER BY dt, min_id_file_no, min_id_batch_no, id

    ;

    The main request is in fact what I posted before, but instead of

    "ORDER BY file_no" and "ORDER BY batch_no", she uses

    "ORDER BY min_id_file_no" and "ORDER BY min_id_batch_no".  These values are calculated in the subquery, got_min_ids.

    Output (including the additional sample data I posted):

    ID FILE_NO DT BATCH_NO SEQ DATA

    ---------- ----------- ---------- ---------- ----- ----------

    1 23 25 April 2014 113 dXAad 1.1.1

    2 345 23 25 April 2014 pumVG 1.2.1

    3 345 23 25 April 2014 jLnbO 1.2.2

    4 23 25 April 2014 543 xKhCL 1.3.1

    5 23 25 April 2014 543 JQoWk 1.3.2

    6 23 25 April 2014 543 YjJeC 1.3.3

    7 24 25 April 2014 333 WjQNE 2.1.1

    8 24 25 April 2014 333 ScWSL 2.1.2

    9 24 25 April 2014 333 pXDSD 2.1.3

    10 222 24 25 April 2014 OSajn 2.2.1

    11 222 24 25 April 2014 QNpix 2.2.2

    12 24 111 OwkjI 2.3.1 April 25, 2014

    91 100 99 25 April 2014 sRWmT 3.1.1

    93 100 99 25 April 2014 IAEFd 3.1.2

    92 101 99 25 April odQxh 2014 3.2.1

    I know you said that this situation is impossible (that is, if ID 91 and 93 have the same batch_no, then id 92 cannot have a different batch_no), but the application works even if this rule is broken.

  • After the passage of a different program and vice versa, Premiere Pro will play is no longer the sequence

    It took me a while to limit this problem. Quite randomly, my sequence would not apply.  I finally reduced to this.  I hope that the 28/01/16 update should fix, but it didn't.

    Summary:

    -commutation of Premiere Pro to a different program, while a sequence is stopped and then backward, tilt will cause Premiere Pro is no longer playing the sequence.  .

    Follow this exactly to reproduce the problem:

    (1) create a new file with a new sequence inside

    (2) create a minute long clip of anything (bars + tone, color matte, text, etc.) and drag it into the timeline

    3-hit game

    (4) setback (this is important!, see below)

    (5) to switch to another program, either via alt - tab or open another program so it gets the focus.

    6) move to Premiere Pro

    7-piece struck again, sequence no longer will play is not the expected behavior.  PP must be rebooted to solve the problem.

    If you do not hit 'stop' to step 4 and let the sequence to keep playing:

    -When you pass on Premiere Pro and then return, you can press the stop button.  When you click the button new play things will work as expected.

    My configuration: win 7 + Premiere Pro 2015.2 release, build 9.2.0 (41), i7 Proc/32 GB memory

    My solution (sad), it of that if I need to go to another program for a bit, make sure to hit 'play' in Premiere Pro before moving on to another program and let it in the background.  When I come back I can play and stop as usual.

    Hey thanks, that the explanation is logical. "Mallocing everything in desperation" will be my new go to words to describe my state of mind sometimes.

    Fixed it!, but it was something else. :

    I tried to uncheck "allow applications to take exclusive control it" box and rebooted, verified that the box was always checked... but the first has always had the same problem. The stop/play button icon changed as you noted, but the timeline not yet played.  This led me on a path of futzing with different combinations of audio material.

    Difficulty of summary:

    -First, change the 'default' output to some other active sound output (even if it is not physically used), then change it back.

    (1) in the first Audio hardware preferences, I changed "Default Output" for "Realtek Digital Output" (which is enabled in my sound control panel, but nothing is physically connected).

    (2) I went back to the first, and he could still play the timeline after alt-tabbing to other programs and return.  There was no audio since obviously I have nothing plugged on my outputs digital.

    (3) 'Exit by default' Changed in first preferences Audio equipment Audio back to "Speakers (Realtek High Definition)", tried the stuff of alt - tab again and as if by magic it worked like the good old days (early 2015).  Even still, it still works very well even though I have the checkboxe "exclusive control" ticked off now (parameters of sound from speakers in the Panel).

    Notes:

    -I don't know if step 2 is required.  Things are working fine for me and no matter what I change, I can't do things in the State 'broken '.

    -At some point, in the sound control panel, I changed one of the outputs digital to be default, but that doesn't seem to make a difference at first. Whether or not this has finally made a difference affecting the steps above, I don't know.

    BTW, audio installation is:

    Audio is Realtek High Definition Audio, version 21/08/2013 6.0.1.7023 (hardware Audio first output by default is "Speakers (Realtek High Definition Audio)"

    I have a 3 GB Evga 780 also graphics card, but no HDMI outputs are used/activated.

  • Browse the sequence of the book on the subject and back to book

    Hello

    We adapted production and Webhelp is broadcast by RH11.

    We have created a navigation sequence to navigate between courses (book) and between subjects. The customer expects these buttons to jump to the lesson in the first section of this lesson, and when they the last subject, he has to bring to the next lesson.

    For example, when the learner clicks on the next button on the book of lesson 2, it takes for heading 1 of the lesson 2. When he clicks the next button on the last topic of lesson 2, must be reserved Lesson 3. Same thing with the buttons Back.

    We are generating the sequence to browse using ToC levels. Is there a way to get the type of sequencing my client expects?

    Anthony

    P.S.: We are facing this problem with a HR FM-based project, I think that this is a generic problem. That's why I post here the query.

    You need create a single sequence that begins at the first logical topic and moves to the last logical subject.

    I don't know if FM allows you to set the sequence it. If so, I'm not equipped to tell you how to do it. But if it is possible only in RoboHelp, it's super easy-just open the sequence editor to browse and tell RoboHelp to create a sequence based on the table of contents "such what ' (for RoboHelp 2015 broadcast) or type 0 (zero) to the number of levels of table of contents to use.

    See you soon... Rick

  • Need to fill the value of the sequence in a field after insertion in the ofa page

    Hi all

    I have a custom OAF insert the page in do I have to fill out a sequence to a field value, once the data inserted with success at the table.

    so for this I followed the approach below.

    1 > created a database sequence.

    2 > java in the EOImpl of the file in the accessor method Set for their respective fields wrote code below.

    {} public void setContainid (numeric value)

    If (value == null) {}

    OADBTransaction t = getOADBTransaction();

    value = t.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    }

    setAttributeInternal (CONTAINID, value);

    }

    But still, I'm not able to complete the sequence value for the field in my oaf page, please help me with that.

    Thank you

    Hello

    Write this logic to create the EOImpl method:

    public void create (AttributeList attributeList)

    {

    Super.Create (AttributeList);

    Transaction OADBTransaction = getOADBTransaction();

    ContID number = transaction.getSequenceValue ("XXXXX_CONTAIN_SEQ");

    setContainId (contID);

    }

    Sushant-

  • How to assign the sequence attribute

    Hello

    I want to create the new record in the employee table, but the emp_id column must be fill in sequence.

    There where I should write coding to do this next sequence val when I press the button to create employee.

    That means I want newly created record with following number based on the sequence.

    How to approach the issue?

    Please explain to me the steps to do this.

    Thanks in advance,
    SAN

    SAN,

    The same logic as specified above, will work for you.
    Initialize the VO based EO & attach the employeeId of the bean attribute, you get depressed your condition.

    Kind regards
    GYAN

  • Reading of the logic of the notation software

    Try to use logic and the sounds of software included as the playback engine for my partitions created with final 2014 rating software. Find it me hard to imagine that I am the only one having this problem but I can't seem to find the answer to anywhere!

    I activated the IAC driver audio / MIDI set up and added IAC bus 1-4

    In 2014 finals, I activated the ports between applications and reading "MIDI System. I've set up my score so that all (11 litters) wind instruments are forwarded to IAC Bus 1, brass (12 staves) are routed to IAC Bus 2, strings and percussion (15 slats) to Bus IAC 3 effects / other (6 sticks) to IAC Bus 4. "Play Finale through Midi" is checked, and I have disabled human playback as well.

    Logic Pro x, I created a new project with software instruments on different tracks with different MIDI channels that match the MIDI channels I have implemented in the final (i.e.: trips the clarinet 1 in the final to IAC Bus 1/MIDI Channel 5.) In logic, track 5 is a clarinet EXS24 on MIDI Channel 5)

    The problem:

    Actually, I got it to work (it is not more) but only on the 1st 16 channels. I could not figure out how to get the IAC Bus 2 coming to the slopes of brass, the IAC Bus 3-String sounds or the IAC Bus 4 to the sounds of the effect.

    Sorry if this post is a little long and please forgive my ignorance if this question does not belong. I ask the community to Logic Pro because I don't believe that final is the issue here. Any help would be most appreciated!

    MacBook Pro 15 retina, mid-2014, Core i7 2.8 Ghz, 16 GB RAM, OS 10.10.5 (Yosemite)

    Logic Pro 10.2.4

    Final 2014

    MOTU MIDI Express

    Yamaha DX 7 II FD

    You can not. Logic only offers the possibility to receive simultaneously on 16 midi channels. Logic does not enter designations based on the port. If you're limited to 16, regardless of which port you send.

  • How can I change the sequence of displayed in Thunderbird mail accounts?

    I need to set up a laptop computer to take on the go. How can I change the sequence (list) of e-mail accounts in the vertical pane to match my office?

    Install this add-on.
    https://addons.Mozilla.org/en-us/Thunderbird/addon/manually-sort-folders/

  • They showed me a way to do a massive bowl of spam, but I don't remember the keys and the sequence to do.

    I recently had installed Thunderbird and more 10,000 e-mails were transferred. They showed me a way that if I press Ctrl and another sequence of keys, I could scroll through many emails and send them to 'trash' collectively, instead of having to delete each message individually. I don't remember the keys and the sequence to do.

    CTRL + a (for 'all') will select all of the visible items.

    http://Xenos-email-notes.simplesite.com/417754237

  • How to change the sequence of films in iMovie Theater

    By exporting iMovie projects in iMovie Theater, the sequence of films is determined by the time of download. How to change the sequence of films in iMovie Theater list?

    HI, breeaz,

    I have not found a way to change the sequence of films shown in the movie screen.

    If you access your movies in the Finder folder, then Ctrl-click on the folder of the theatre, you will find your movies to the poster

    in the alphabetical order in archival records.   I was not able to manually rearrange it.   They can be rearranged in some categories, through the view menu item at the top of the screen and the changes applied to the entire window, but it was not carrying at the display of iMovie.  In General, I'd like to make changes to the structure of iMovie in the finder.  It can cause serious problems.

    Best,

    Rich

  • This point cannot be shared while it's still multimedia reference on the camera.  This message prevents the sharing of file in the sequence

    This message keeps me from sharing file in the sequence.  I'm done with the movie and want to print on DVD

    Your camera with multimedia files that it is connected to your Mac?

  • How can I change the sequence exported to iMovie?

    When I finished making the video and it has exported, some errors found only. How can I change the sequence exported in the application iMovie editing new, mainly texts?

    Just open the project that you exported from iMovie, make the changes necessary, then export again.  (Sod / Murphy's law always ensures that errors found only after export)

    Geoff.

  • How can I sequence photos in an album of Pad?  Pictures are sequenced by file name (for example, 10 C, 20 C, CN) within their folder (album) in Photoshop Elements on my PC to 10 Windows, but the sequence is disrupted on the iPad via iTunes import/synchron

    How can I, sequence, photos, in, one, pavement, album?, the, photos, are, sequenced, file, nam e, (e.g., AC, 10, AC, 20,...) (CNN), within, their, folder, (album), in, Photoshop, elements, on, my, Windows, PC 10, but sequencing, is, disturbed, to, import, /, synchronization, to, t it, Pad, via air, how, may, sequencing, PC, be maintained, soon, transfer, to, nth, Pad?  My PC operating system is Windows 10 and my iPad is version 9.2.1.  Photoshop Elements is version 10.

    There is no way to manually sequence on an iOS device.  You can import them to your computer and the sequence by using a photo application that has this feature.

    iOS: import personal pictures and videos of iOS devices to your computer

  • What is the sequence to manage his photos on iPhone, iPad and Mac

    Ask for help to understand how to manage an iPhoto library.  What is the sequence for recording on a Mac, to eliminate duplicates on iPhone and iPad?

    Depends on undisclosed information

    You have posted the pictures to Mac forum but ask questions about iPhoto - who you? What operating system do you use?

    Assuming you have pictures where you posted what settings do you have for iCLoud in preferences Mac system, of Photos and your IOS devices preferences

    as duplicates there is no way for Apple to do except manually - there is third party including PowerPhotos packets, Duplicate Annihilator for Photos PhotoSweeper for the Photos help

    Regarding the management of the best way is to use iCloud photo library so any changes made on any device are made on all devices

    LN

  • How to let axSequenceView view the sequence file, after the opening before the race.

    How to let axSequenceView view the sequence file, after the opening before the race.

    I would do it differently, you do not see when running because your sequence control is connected to the requeteexecution Manager. I have two controls of the same size that sits on top of the other, one connected to requeteexecution as it is by default and the other to SequenceFileView Manager.

    You can then use reminders to start execution and execution of end events in the user interface to make the control visible. It is very easy to achieve.

Maybe you are looking for