Regular Expressin / Fund

Dear all,

I have a table guess named gl_je_lines with an attribute4 column.

Now the column attribute / / 4 was given as:

1000 0000-103056

1000 0000-103056

1314-0000-103056

1000 0000-103056

1314-1000-020112-2055059

1000-1234-103056

1314-1000-789633-2044457

1000 0000-156789

1000-1314-049029-2043243

Requirement:

Case 1:

When I value as 020112-1314-1000-2055059

Then, it should be divided into four columns and this can be achieved by using sub statement:

REGEXP_SUBSTR(JEL.attribute4,'[^-]+') SYSTEM_REFERENCE_NUMBER_1,

REGEXP_SUBSTR(JEL.attribute4,'[^-]+',1,2) SYSTEM_REFERENCE_NUMBER_2,

REGEXP_SUBSTR(JEL.attribute4,'[^-]+',1,3) SYSTEM_REFERENCE_NUMBER_3,

REGEXP_SUBSTR(JEL.attribute4,'[^-]+',1,4) SYSTEM_REFERENCE_NUMBER_4,

Case 2:

When I value such as 1000-0000-156789.

Then he must also be divided into four columns, but:

1. when the second value after is first - 0000, then it should be replaced by a value such as 1111.

2. value after first - i.e. 0000 should be placed in the fourth column.

3 value after second - i.e. third value should remain such what.

Expected result:

Col1 Col2 Col3 Col4 Attribute4

103056 0000-1000 1000 111 103056 0000

103056 0000-1000 1000 111 103056 0000

1314-0000-99303 1314 111 103056 0000

103056 0000-1000 1000 111 103056 0000

1314 1000-020112-2055059 1314 1000 020112 2055059

1000 0000-101205 1111 1000 0000 101205

1000-1314-049026-2043159 1000 1314 049026 2043159

1000-1314-049029-2043243 1000 1314 049029 2043243

103739 0000-1000 1000-1111 103739 0000

Kindly inviting you to suggest how this can be achieved.

Kind regards

AS

Without knowing about your join condition, you have a 1:1 ratio, etc.

WITH separator (str, components, str1, str2, str3, str4)

AS (SELECT attribute4

regexp_count(attribute4,'-') + 1

regexp_substr(attribute4,'[^-]+',1,1)

regexp_substr(attribute4,'[^-]+',1,2)

regexp_substr(attribute4,'[^-]+',1,3)

regexp_substr(attribute4,'[^-]+',1,4)

b.segment1

OF GL_JE_LINES one

JOIN gl_code_combinations b ON ([your_join_condition])

WHERE period_name = ' JAN-12'.

AND attribute4 IS NOT NULL)

SELECT str

str1

CASE components

WHEN 4 THEN str2

WHEN 3 THEN DEAL str2

WHEN ' 0000' SO segment1

ELSE Str2

END

ANOTHER NULL

As END a str2

str3

CASE components

WHEN 4 THEN str4

WHEN 3 THEN DEAL str2

WHEN ' 0000' THEN str2

ANOTHER NULL

END

end up like str4

between the separator;

HTH

Tags: Database

Similar Questions

  • Event does not work when I have my variable of variable mutual FUND!

    Hello

    I programmed a labview vi to add a field to a list view when a Boolean variable value is changed. I used a case Event (value change event) structure to determine if a variable value is changed, it works when I force the Boolean control with my mouse click, but it does not work when the value of the variable is modified by the mutual FUND. What should I use instead?

    Value change events are based on the interaction of the user (or the same ejection programmatically based on the value property node (signaling).)  It is not based on a control change via a regular, variable property node local, terminal or any other connecito0n programmatic or binding.

    You must simply query the variable and determine when it changes.  In this case, you can then use the node value property (signs) in the case of event fire.

  • the magic mouse disconnects regularly

    Since last week my Magic Mouse is losing connection with my iMac (OS X Sierra) pretty regularly--several times each hour, sometimes more often - the connection is only lost for 5-10 seconds, but it's a lot of time when you're trying to work. Anyone else had this problem and had been able to find a solution?

    If your Magic Mouse is version 1 (with batteries), it won't be to fully integrate with Sierra.   You can buy Magic Mouse 2 for that.   Because all future operating systems need, you may as well buy now.

  • In Keynote is regularly lost function undo

    Hello! I have a problem. In Keynote is regularly lost undo function. This happens randomly, and I don't understand why. Maybe it happens in some other iwork apps, but I have not tried yet used. He arrived in the Sierra of macOS. Аnyone have this happen?

    We have no problem with cancellations in any application on any of our Macs. I heard not only reports of one having this problem.

    Perform this procedure for Foundation repair;   Remove the application Keynote, empty the trash, restart the Mac and then re - install Keynote from the Mac App Store.

  • How can I change a plan of special funding for an iPhone, program of upgrade Plan?

    I'm on a special funding for my iPhone 6 s and am stuck do not do the upgrade, although I have several iPhone from the Apple Store and pre-order 7. I'm curious to know how I can set up a program to upgrade and update my iPhone every year? I will ditch my 18 month special financing.

    You told us very little, as "special financing" could translate into hundreds of different things.

    The general answer is to repay your 6 s iPhone, then visit an Apple Retail Store or an Apple authorized reseller and buy an iPhone 7, following the upgrade program.

    Or, once you pay off your iPhone 6s and end your contractual obligation of the cellular carrier, then you can buy the iPhone 7 to the Apple store and is part of the upgrade program here.

    In any case, I think that you must pass the credit needs.

    Once your iPhone 6 is paid and without contract cellular carrier, it should be yours to sell.

  • Regular and Nike + software.

    Anyone know if the software located on the Nike + (running program and features) series 2 can be downloaded and put on 2 regulare series watch?

    Hello

    The Nike + Run Club app can be installed on any Apple Watch.

    The Apple Watch Nike + includes a greater integration of the application as well as other features such as the Nike exclusive dial faces (in addition to the standard Apple Watch faces), and an exclusive group of Sport Nike.

  • My MacBook 12 regularly gets an analysis of needs of Unix executable file names in her basket

    My MacBook 12 regularly gets a Unix executable file named 'needsanalysis' in his trash. Anyone have any idea why? What is it? What can I do to stop what is happening?

    I have two laptops on a an environment MBA 2011 and a 2016 MB and it happens on the latter. Both are on OSX 10.11.6

    Thank you, Colin.

    The executable "unix" just means that it doesn't have an extension for the operating system is not what it is. In addition, the executable bits are defined, so it may have been a case, but this info was lost, too.

    Do you run all software anti-virus on them? I don't know what else would generate something that "needs analysis".

  • How ad used regularly can be disabled without my permission or knowledge?

    I use regularly clean printing to save paper and ink. Now, Mozilla has taken upon itself to say that I can't use it? Did I say in this case or this big brother takes over my life?

    Hi bmmills, where Firefox say you can no longer use CleanPrint?

    Moreover, I assume you mean this:

    I clicked on the link in the left column under CleanPrint get for your browser, and then on the next page I could drag a "bookmark" in the bookmarks Menu or Bookmarks Toolbar button.

    Some sites use a content security strategy that may prevent the injection of scripts added. If you only have problems on some sites, a volunteer might check if that's the problem.

  • Are there reasons why T/B could not support wildcard (* xyzpqr *) or regular expressions in search of content of e-mail?

    When a string of characters, I'm interested, is buried in an e-mail, I would find these emails. It seems that as the code needed to find an email is already in place, it would take very little effort/code/support added to extend the search capabilities of more effectively, as it is available in spreadsheets.

    This particular forum has these capabilities, suggesting that users find useful installation.

    Are there reasons preventing these facilities being added to T/B? I find that the ability would frequently help me in search of my email.

    FiltaQuilla both Expression search/GmailUI provide functionality, specifically the regular expressions.

    FiltaQuilla aims to improve the message filters and has a useful side effect in improving the CTRL + SHIFT + f find. Research of expression increases the QuickFilter bar. Or rather weird global research assistance, but I work around this by using a Saved Search folder, where you use a dialog similar to the message filters and can make use of the enhancements offered by one of these modules.

  • I have somehow lost my tab bar. It contains tabs that I use regularly. Help.

    With Windows 10, I had a horizontal bar at the top which held in tabs, I want to use regularly. This horizontal bar set of tabs disappeared, as well as the button to reveal the legs of overflow (which had no place on the horizontal bar).

    First of all - what I did to lose who together bar and second why is so amazingly difficult to bring?
    I don't know about groups of tabs. I'm not interested by this at this time.

    Other toolbars are visible?

    If no: Make sure that Firefox is not in his view full screen. The F11 key toggles between normal display and full-screen.

    If Yes: The bookmarks toolbar can be turned off. You can use one of the following methods to display the toolbar list and activate the desired bars it:

    To enable the bookmarks toolbar, bar of menus or other bars, click it in the list.

    Does it work?

  • My gift of the App Store has lost card funds after factory reset

    I had £7.94 left on my Apple gift card but I had to start fresh my phone and now the funds have disappeared. I am on ios on iPhone 6 s 10 and it worked before the update because I factory reset my phone while I was on iOS 10. I have more card is it possible I could get my money on my account because I thought that the funds have been recorded in your account on your phone.

    Your balance is linked to your account, not for a device or its version of iOS (and as you know already software beta cannot be discussed here). Check the account balance and purchase history in iTunes on your computer

  • Firefox crashes regularly

    After years of trouble-free use, I now have problems with Firefox. It crashes regularly, every time I use it, began about a week or two ago. As far as I know, nothing has changed on my laptop. I tried to start in safe mode and I tried refreshing but nothing has worked so far. I have attached the most recent a succession of reports of incidents per day. Any help would be much appreciated, thank you.

    timmynumbers

    https://crash-stats.Mozilla.com/report/index/BP-7cdd2273-0918-4293-AA64-1f7bd2150427

    Hello

    Try disabling graphics hardware acceleration. As this feature has been added to Firefox, it has gradually improved, but there are still some problems.

    You will have to perhaps restart Firefox for it to take effect, so save any work first (e.g. you compose mail, documents online that you are editing, etc.).

    Then perform the following steps:

    1. Open the Firefox Options (Preferences on Mac or Linux) as follows:

      • In Firefox 29,0 and above, click on the menu button

        then select Options Preferences on Mac or Linux, or Windows.

      • In 28.0 Firefox and earlier versions, click on the Firefox orange upper-left button, then select the 'Options' button or, if there is no button up Firefox, go to tools > Options.
    2. In the window of Firefox Options (or preferences), click on the Advanced tab, and then select general.
    3. You will find in the list of parameters, the checkbox use hardware acceleration when available . Clear this check box.
    4. Now restart Firefox and see if the problems persist.

    In addition, please check the updates for your graphics driver by following the steps in the following knowledge base articles:

    This solve your problems? Please report to us!

    Thank you.

  • Response of local folders looks like the answer to the discussion group. No signature or formatting options. How can I change the local folders meets regularly?

    Please see image attached. Responses from the eyes of local folders as responses to the discussion groups. No signature or formatting options. How can I change the local folders meets regularly, as they are in the Inbox?

    I don't think that the format of replies to the messages in the local folders are linked with focus groups or to individual account settings. As local folders can contain messages between several accounts or identities, it is more likely that formatting uses the setting of the account or identity appearing in the: field when you reply.

    This is how I think it should work. How this works in practice may be different.

  • How can I save text that I use regularly in the emails to avoid having to retype it every time?

    How can I save text that I use regularly in the emails to avoid having to retype it every time?

    Try this add-on: https://addons.mozilla.org/en-US/thunderbird/addon/clippings/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • Why firefox is now save my history to view private and available in regular firefox as well? It is a disappointing failure.

    I just went to the private viewing mode and inserted the first letter of a web address and the address of the web all appeared. I then went to firefox regularly to test this and the same web address private-read has shown there as well. It's never happened before.

    can you try to reset firefox and see if that can solve the problem...

Maybe you are looking for