Logic for correcting strings with different barckets

can any one tell me the simple logic for correcting strings with different barckets
suppose say for eg.
(<{abc}>defgh) should evaluate to TRUE
(<{abc>} should evaluate to FALSE
Things to check is
1. number of opening brace and closing brace
2. Their position are correct or not
If the above two conditions are met than it is TRUE else FALSE
i guess string function with decode and lenght function or case should do but bit difficult to develop this logic in with sql
Thanks,
AAK

Hi,
Here is non REGEXP_REPLACE version ( Unfotunately dont have 10G to feel the power of REGEXP_REPLACE.
SQL> ed
Wrote file afiedt.buf
  1  SELECT DECODE(SUM(CASE
  2                    WHEN Left = '(' AND Right =')' THEN 0+Count_Bracket
  3                    WHEN Left = '<' AND Right ='>' THEN 0+Count_Bracket
  4                    WHEN Left = '{' AND Right ='}' THEN 0+Count_Bracket
  5                    WHEN Left = '[' AND Right =']' THEN 0+Count_Bracket
  6                    ELSE
  7                       1
  8                    END
  9                    )
10         ,0,'Valid','Invalid')
11  FROM
12  (
13     SELECT SUBSTR(str,(len+1 - level),1) Left, SUBSTR(str,(len + level),1) Right, MOD(LENGTH(str),2)
14     FROM
15     (
16      SELECT
17         REPLACE(translate('&exp','abcdefgh','        '),' ') str,
18         LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
19      FROM DUAL
20    )
21    CONNECT BY LEVEL <= LEN
22* )
SQL> /
Enter value for exp: (<{abc>} )
old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
new  17:        REPLACE(translate('(<{abc>} )','abcdefgh','        '),' ') str,
Enter value for exp: (<{abc>} )
old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
new  18:        LENGTH(REPLACE(translate('(<{abc>} )','abcdefgh','        '),' '))/2 len
DECODE(
Invalid
SQL>
SQL> /
Enter value for exp: <{[()]}>
old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
new  17:        REPLACE(translate('<{[()]}>','abcdefgh','        '),' ') str,
Enter value for exp: <{[()]}>
old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
new  18:        LENGTH(REPLACE(translate('<{[()]}>','abcdefgh','        '),' '))/2 len
DECODE(
Valid
SQL>
SQL> /
Enter value for exp: ([{<>}])
old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
new  17:        REPLACE(translate('([{<>}])','abcdefgh','        '),' ') str,
Enter value for exp: ([{<>}])
old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
new  18:        LENGTH(REPLACE(translate('([{<>}])','abcdefgh','        '),' '))/2 len
DECODE(
Valid
SQL>
SQL> /
Enter value for exp: (<{abc}>defgh)
old  17:        REPLACE(translate('&exp','abcdefgh','        '),' ') str,
new  17:        REPLACE(translate('(<{abc}>defgh)','abcdefgh','        '),' ') str,
Enter value for exp: (<{abc}>defgh)
old  18:        LENGTH(REPLACE(translate('&exp','abcdefgh','        '),' '))/2 len
new  18:        LENGTH(REPLACE(translate('(<{abc}>defgh)','abcdefgh','        '),' '))/2 len
DECODE(
Valid
SQL> Note: Only thing needs to care is " translate('<{[()]}>','abcdefgh',' ') " if string has some additional characters please include here.
Regards

Similar Messages

  • Price determ. for a Customer with different ship to parties within

    Dear all,
    I will try to explain our need with an example.
    We received a requirement from our sales department who wants to manage a sales price of a specific item which is dependent from a fixed quantity in case the order is placed for a customer with different destinations (different ship to parties).
    The example is as below:
    Sales Price for Customer and Material A is 50u20AC per pieces for a scale of 10 pz.
    The condition type ZPR0 used is a copy of standard PPR0 and it has the following characteristics:
    calculation type Q Quantity
    scales basis C quantity basis and scale formula "0".
    We receive an order by our Customer for 10 pz and for two destinations:
    5 pz directed to the location MMM
    5 pz directed to the location BBB
    The customer is asking us to apply this price because the pre-requisit is satisfied but how can we determine automatically in the same order if the material A is present in several order items?
    We create an order with two sales order items and in each one we specify the destination in the partner roles. How can we set the condition type in order to redetermine the exact price considering the total quantity of material whitin the same order?
    I hope you can help me
    thanks in advance
    Andrea

    Hi
    Your question is not fully clear to me. But what I guess you are looking for a discount which will be applicable to only one order and not for the other orders even if those orders contain the same material.
    If I am correct, than yoy can do it by setting the condition Update. Suppose, you want to give Customer-material specific discount,i.e. condition type K005. Activate the "condition update" check box in the condition type detail screen first.
    Then, in VK31 ,create a condition record for K005 & save it.Go to the change mode (vk32) of the cond. record and now enter " 1 " in the " No.of orders" coulmn & save it.
    Now if you will create an order, this discount will be applicable only for the first one order only and next order onwards it will be deactivated automatically.
    Similarly,You can set it also in terms of quantity,if the condition is calculated based on quantity ,by putting the quantiy (up to what quantity you want it to be effective) in the "Max. condition base value" column.
    Regards
    Pradyumna
    Edited by: pradyumna patel on Jun 24, 2008 11:28 AM

  • Single invoice for multiple orders with different divisions

    Dear All,
    while I am trying to do single invoice for muliple orders with different divisons invoice is gettting splitted..In copy control vbrk routine I  tried with 003 and 007 etc..but result is same..what configuration need to be done for getting the single invoice
    Thanks In advance
    Regards
    CNRNAIR

    Hello
    single invoice for multiple orders with "different divisions" invoice is getting split
    FYI - Different Division means different Sales Area.
    So, sales doc (whether sales order, Delivery & Billing) is applicable to EXACTLY one sales area.
    Thus, combining docs with different sales area is practically impossible.
    Provided, you are using common division.
    Hope this assist you,
    Thanks & REgards
    JP

  • How to structure the DMA buffer for PXie 6341 DAQ card for analog output with different frequencies on each channel

    I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
    The examples, e.g. aoex5, show a single Timer  (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
    There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
       (the comment is: Switching between different buffer sizes will not be used)
    Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?

    Hello Kenstern,
    The data is always interleaved because each card only has a single timing engine for each subsystem.
    For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
    kenstern wrote:
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
    In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
    Update Frequency: 150 KHz
    Channels: 2
    Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
    Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
    Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
    You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.

  • [svn:fx-trunk] 5445: Fix for - @ copy tag for two methods with different arg lists not working.

    Revision: 5445
    Author: [email protected]
    Date: 2009-03-19 17:47:57 -0700 (Thu, 19 Mar 2009)
    Log Message:
    Fix for - @copy tag for two methods with different arg lists not working.
    Some changes for refactoring.
    QE Notes: None.
    Doc Notes: None.
    Bugs: SDK-19975
    tests: checkintests, asdoc
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19975
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

    Revision: 5445
    Author: [email protected]
    Date: 2009-03-19 17:47:57 -0700 (Thu, 19 Mar 2009)
    Log Message:
    Fix for - @copy tag for two methods with different arg lists not working.
    Some changes for refactoring.
    QE Notes: None.
    Doc Notes: None.
    Bugs: SDK-19975
    tests: checkintests, asdoc
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-19975
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocUtil.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

  • So will 7.2 universal improve Logic for people sticking with G5 hardware?

    Hi,
    So will 7.2 universal improve Logic for people sticking with G5 hardware?
    SvK

    When you say "improve" I assume you mean either add new features, or bug fixes. Well, the new features have been documented already (do a search in the Manuals section above). But on the question of bug-fixes (which, in the minds of many of this forum's members would be the ultimate "improvement" to Logic) no one can say.
    There's nothing posted thusfar about bug fixes in 7.2 on this, their website. There's no way of knowing at this time whether or not Apple will publish a bug-fix document after 7.2 is released. And despite many of this forum members' posting requests for a bug-fix list, sometimes literally pleading for such information, the only responses we've seen to such forum topics are:
    a) silence
    b) locking of the threads
    So IMO, it's impossible to answer your question, because ultimately, Apple is not answering the question.
    I think the best advice is to wait until Apple officially releases 7.2 and then see if a bug-fix list will be issued.

  • VMM 2012 sp1: unable to create a logical switch on team with different nics (bug?)

    Hyper-V Host is HP Proliant G7 with 4 onboard nics and additional (different) 4-port adapter, all 1Gbit. Server 2012 with latest updates.
    VMM 2012 is sp1 with latest updates, server 2012 running in a vm.
    When I create a logical switch with teamed uplink port profile in VMM, the job builds the team but fails to create the vswitch when ports from both onboard nics and adapter is used.
    I am able to create  a vswitch manually on the team if I do it directly on the host.
    If the team is created on either purely onboard nics or purely adapter nics, the logical switch creation succeeds.
    In short terms: I am able to create a vswitch based on a server 2012 team with different nics, but not a logical switch. Why?

    I have tried assigning both nics in one step, and one by one. When I create the logical switch team with only one nic it succeeds, but then fails when I add the second (unless it is similar to the first).
    Error in VMM is
    Error (2912)
    An internal error has occurred trying to contact the dkfuzhv01.mia.local server: : .
    WinRM: URL: [http://dkfuzhv01.mia.local:5985], Verb: [GET], Resource: [http://schemas.microsoft.com/wbem/wsman/1/wmi/root/scvmm/ErrorInfo?ID=1010]
    Unknown error (0x80041001)
    Recommended Action
    Check that WS-Management service is installed and running on server dkfuzhv01.mia.local. For more information use the command "winrm helpmsg hresult". If dkfuzhv01.mia.local is a host/library/update server or a PXE server role then ensure that
    VMM agent is installed and running.
    If I add the second non-similar team member from the host itself, I get this error from nic teaming wizard
    Validation failed and changes to the system are rolled back
    It is not a question of losing connection (been there), management interface is on a different team. And it also fails when second team member is added directly on the host...
    So far I will stick to the conclusion that my problem is with logical switch and different nics :)
    Oh, by the way nics are HP NC382i (Broadcom) and NC365T (Intel)

  • BO xi 3.1 u2013 schedule a template for multiple reports with different column

    Hi,
    I need to migrate the existing reports from SQL Server Reporting Services to BO, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to schedule a single template with different parameters for all reports in BO, or create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
    For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?
    Thanks!

    Hi,
    The only approach I can think of is to create a template report which uses variables
    For each column you would need to variable
    v_columnAName and v_columnAValue
    v_columnAName would have a if statement in it
    =if([client]="clientA" or [client]="clientC";NameOf([firstName]);if([client]="clientB";NameOf([SSN]);NameOf([lastName]));
    v_columnA would have a if statement in it
    =if([client]="clientA" or [client]="clientC";[firstName];if([client]="clientB";[SSN],[lastName]));
    This would only work when you had a small set of clients.
    This might be more managable if it was done in the universe
    Regards
    Alan

  • Single ERS Invoice for multiple POs with different GS and same IP

    Dear All,
    I have a Requirement as per the below scenario:
    We need to have single invoice created using ERS (MRRL) functionality in the below scenario:
    Two POs created with different Partner function GS (goods supplier) and same IP (Invoice party partner function).
    Ex:
    GS IP PO GR ERS
    vendor1 10001 4500001 500001 Yes ( GR-IV-Yes, GR done- Yes, same payment terms - 001)
    vendor2 10001 4500002 500002 Yes ( GR-IV-Yes, GR done- Yes, same payment terms - 001)
    When I run ERS for last 1 week (GR) and select the option (Doc selection – per IP or other criteria like GRs posted in last one week) , system should create 1 invoice document. Standard SAP posts 2 documents for each GS.
    I have tried using 2 user exits for MRRL, but none of them work for this functionality.
    Thanks,

    Hi,
    Go for  MIRO without MRRL.
    Instead ERS, you can post single  Invoice(MIRO) for multiple POs  for one vendor.
    OR
    Check with Technical consultant and go for development to have single ERS output for multiple ERS invoice documents for single vendor.
    Regards,
    Biju K

  • PDF for multiple users with different values

    Is there a way to create a PDF to be sent to multiple users but have different values in the PDF? For expample employee A's offer letter is for $50/hour while employee B's offer letter is for $55/hour. But they have the same offer letter just with different values.
    I have Enterprise EchoSign and FormsCentral.
    Thank you!

    Hi,
    Thanks for asking, but FormsCentral currently does not support this.
    Perry

  • Design a single template for multiple reports with different column order

    Hi,
    I need to migrate the existing reports from SQL Server Reporting Services to Crystal Report 2008, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
    For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?
    Thanks in advance.

    -As I mentioned you can find Template Field object in Insert menu of crystal report Designer 2008.
    As soon as you select Template Field object you will be able to see a box beside ur mouse cursor. Drag and drop this box at required place. Now when you place this object in report you will get some thing like this "<TemplateField1>" listed under Formula Fields tree. Double click "<TemplateField1>" formula to add your conditions.
    -I have not tested it for large amount of Customers. However as the number of customer increases the number of conditions will get increased.
    For the customer that want the same ordering of columns you can put those customers under one condition.
        for Example...
              if(?Client in ['clientA','clientA']) then
                        <TableName>.<Field>......
    -What do you mean be 40 columns? Do you mean 40 fields or you want to show 40 columns in report? Please elaborate.
    Regards,
    Amrita
    Edited by: Amrita Singh on May 21, 2009 7:54 AM

  • Need BIOS Update Lenovo V580c [for correct work with HDD PUIS] Windows 10 x64 TP

    Hello, Im update my bios notebook V580c from official page this model, latest release from official site. But when i try update my notebook - i got message, your bios update file older than your original firmware? but im ignore it and force update. When i install Windows 10 x64 TP - i got some problems with HDD freezing, intel rst AHCI controller driver installing get only BSOD, lot of a versions i try. Need bios update. Thanks.

    Im understand that, but i still have a problems with Windows 8.1 x64, after Win10. When i try update AHCI controller driver - i got BSOD. no one version get good update, only oldest 2006 year standart universal driver HACI from Microsoft still work, but HDD continue freezing. Some Power flags on my HDD after Win10 get u some strange settings, and BIOS V580c too old - to correct work with it.
    What i must do to fix it? (sorry for bad english, im russian)

  • Can I use iTunes Match for 2 iPhones with different music, same account?

    My wife and I each have an iPhone and share an iTunes account.  We share a master music library but each manually manage our music on our iPhones.  So she has certain songs on her phone and I have different ones on mine, both coming from the same master library.  I'm trying to figure out if I can use iTunes Match in this scenario.  I don't want to see her songs on my iPhone.  Is there a way to only see music on my iPhone if I use Match or am I stuck seeing my entire library on my iPhone?

    I think I'm getting it finally, thanks for the clarification.  So at least I know there is a way to not see all music in my library from my iPhone. 
    So in my case i have about 800 songs on my iPhone out of about 1600 on my iTunes library.  If I'm understanding correctly I would have to enable Match on my iPhone, then turn off the "show all music" option.  This in turn should leave me with my original 800 songs listed which I woud then have to download from the cloud.  Once I have all of my 800 songs back down from the cloud I won't be required to download them again from that phone. 
    A worse scenario would be that I enable Match, and then have to find my 800 songs out of the total 1600 manually from the list and then download them from the cloud.
    Which scenario is correct?

  • Perdiem calculations for multiple locations with different statutory types

    Dear Experts,
    As part of the perdiem calculations, when an employee selected different statutory trip types for different dates in a trip duration,perdiem to be calculated differently.But i am failing to calculate to such type of perdiems.
    For Example :
    Trip duration is, say from 01.05.2014 to 10.05.2014
    Statutory trip types X with amount 200/day, Y with amount 300/day
    When employee select the statutory trip type for  01.05.2014 to 05.05.2014 as X
    and for 06.05.2014 to 10.05.2014 as Y
    As per the scenario
    01.05.2014 to 05.05.2014 (5 days *200) =1000
    06.05.2014 to 10.05.2014 (5 days *300) =1500
    total perdiem amount to be 2500 for the total trip duration
    But my system considering last statutory trip type in calculating total perdiem as 3000 for the entire trip.
    Please provide your suggestions to meet the requirement mentioned above
    Thanks & Regards,
    Y.V.P.Deepak

    Hi Deepak
    Kindly mark correct  if  your question has been solved .
    For your next query , you can post it another post.
    To  post in Fi with amount split , you can work on another badi: TRIP_POST_FI
    There  you can make lot of changes before you post in FI
    Thanks
    Anwar Hossain

  • ICloud for multiple devices with different IDs

    I presently have a MacbookPro (10.7.2), iPhone (5.0.1), and an iPad (5.0.1) all on iCloud, linked by my former MobileMe me.com account, that is now my new iCloud ID. No problems with these three.
    What I would like to do (I think, read on...), however, is link my husband's iPhone and MacAir to the same iCloud account, as we share all key programs (calendar, contacts, photos, music, etc) except Mail. We were previously synced up
    He has not upgraded his computer to Lion or his phone to 5.0.1 yet, but before we do that, I'm trying to figure out how we can make them all work together, less Mail, which I believe would mean setting up a new iCloud ID that we use for everything.
    My questions are:
    1 - Is it possible to reset my computer, iPhone and iPad that are already on iCloud to a new iCloud ID/email address, and if so, would I a) lose access to my old MobileMe me.com account that is presently acting as iCloud ID, and b) lose content from the programs (contacts, iPhoto, iTunes, etc)?
    2 - If above is possible, if we create a new 'official' iCloud ID that we use on all devices in the family, would I be able to retain my old MobileMe me.com address, as I've used it for years and have too much saved in mailboxes to easily let it go?
    3 - Also, would the joint syncing of all devices mean that all of my email addresses would be on his devices and vice versa, or would that be controllable (example, if I have new iCloud ID, old MobileMe, Yahoo, etc and he has new iCloud ID, AOL, Hotmail, do all show on both devices??)
    If I am making our sharing of applications more complicated than it should be, please enlighten me. We basically just want to be able to have the same master contact list, calendar, iPhoto and iTunes libraries, Apps, etc..
    Thank you!!!!

    1a You won't be able to re-use your me address.
    1b No you could save the content if done correctly (iTunes is not iCloud)
    2 No, you won't be able to re-use your me address.
    3 The me addresses on a single account can all show up on a device or none show up on a device depending on whether mail syncing is on or off, you can't have some addresses on and some of on a device.
    I believe you have two choices.
    You can both use your existing account and could sync all the things like calendars etc etc, you can have your email address and your husband could have an alias, but you would both see each others mail (and it's not overly clear which is which)
    You can keep your account, he can start his own, that way you would each have your own email address without seeing each others. You can add his account to yours as a secondary account and just turn on syncing on calendars, contacts etc, he could do the same with your account. iTunes isn't iCloud, so you could both use your existing iTunes account and keep access to all your music, movies, apps, books etc. The only thing you couldn't share would be photostream, which is rather unfortunate but there.

Maybe you are looking for

  • How do I stop the "other" data from growing every time I sync my iPhone?

    I recently started putting music on my iPhone 4s, and I found that every time I sync music, the "other" storage keeps growing. This only happens when I sync music. If I don't have music on my iPhone, the "other" doesn't grow. Why is this?? Does anyon

  • Change display name of the server under Equipment

    is it possible to change the display name of the LIVE / PRODUCTION blade under equipment --> Chasis -->Servers to our own naming standards. Attached is the screenshot of current names. UCS Manager Version 2.1(3a)

  • Migrating forms 6i to oracle 9i

    Hello, I am currently running an Oracle 8.0.5 Database about 1.2 GigaBytes in size on a Novell 5.1 server. 1) I want to migrate to a Linux Red Hat 8 Server (I know that I have to upgrade to Linus Red Hat Enterprise 3 (ES)) No questions about that. 2)

  • How to make linesize for autotrace be larger than 80?

    Is it possible to make that the linesize of the output in sqlplus to be larger than 80? I have my linesize = 150 but the output of the autotrace is wrapped and it is quite difficult to see.

  • Edit the About Button

    Hi again ... I am trying to include our company logo and links in the 'About' button on the Main Toolbar. Working in RoboHTML 6.0 with my primary output as FlashHelp. I've tried to edit an existing skin and Edit is disabled. I tried to create a new s