URGENT : replacing some letters in an expression

Hi all
I think that I should post this topic here because I think it concerns SQL and PL/SQL functions. Here is the problem :
I am developping a forms application . There is a listbox named FORMULA containing list of formulas. When I choose a formula from that list then there is a program which exctracts all of its operands. For example if the formula is : (a+b)*abs(c-d) then the operands are : a,b,c and d.
Then I populate another listbox named OPERANDS with these operands. So the value of the OPERANDS listbox is either a or b or c or d in our example.
I held the expression of the formula in a global variable so it can be accessible anywhere in my application.
When I choose one of the operands from the OPERANDS listbox , for example b,then I enter its value , for example 5, in a text field named VALUE ,and then I click on a button to replace the letter "b" in the formula with the value I entered , which is 5. So I want to get an expression like this : (a+5)*abs(c-d) .
But the problem is that when I run the application then all letters "b" in the formula are replaced by 5 . So even the expression "abs", which is a pl/sql function, is replaced by "a5s". And I do not want that to happen.
Here is how I proceeded :
formula := replace(formula,operands,value); where "formula" is the global variable containing the formula expression, "operands" is the variable containing the value of the OPERANDS listbox which is "b" here, and "value" is the variable containing the value 5.
So how can I avoid this misreplacement ?
Thank you very much indeed.

select
   e,
   regexp_replace(
      regexp_replace(e,
      '([^[:alnum:]_]|^)b([^[:alnum:]_(]|$)','\15\2'
      ),'([^[:alnum:]_])b([^[:alnum:]_(]|$)','\15\2'
   ) "EXP"
from
   (select '(a+b)*abs(c-d)' e from dual
   union select 'b+b' from dual
   union select 'b+b+b+b' from dual
   union select '1-b(b)' from dual)
E              EXP
(a+b)*abs(c-d) (a+5)*abs(c-d)
1-b(b)         1-b(5)
b+b            5+5
b+b+b+b        5+5+5+5If you do not have 10g, you can look at the OWA* packages or write you own function
Regards
Laurent

Similar Messages

  • URGENT : replacing letters in an expression

    Hi all
    I think that I should post this topic here because I think it concerns SQL functions. Here is the problem :
    I am developping a forms application . There is a listbox named FORMULA containing list of formulas. When I choose a formula from that list then there is a program which exctracts all of its operands. For example if the formula is : (a+b)*abs(c-d) then the operands are : a,b,c and d.
    Then I populate another listbox named OPERANDS with these operands. So the value of the OPERANDS listbox is either a or b or c or d in our example.
    I held the expression of the formula in a global variable so it can be accessible anywhere in my application.
    When I choose one of the operands from the OPERANDS listbox , for example b,then I enter its value , for example 5, in a text field named VALUE ,and then I click on a button to replace the letter "b" in the formula with the value I entered , which is 5. So I want to get an expression like this : (a+5)*abs(c-d) .
    But the problem is that when I run the application then all letters "b" in the formula are replaced by 5 . So even the expression "abs", which is a pl/sql function, is replaced by "a5s". And I do not want that to happen.
    Here is how I proceeded :
    formula := replace(formula,operands,value); where "formula" is the global variable containing the formula expression, "operands" is the variable containing the value of the OPERANDS listbox which is "b" here, and "value" is the variable containing the value 5.
    So how can I avoid this misreplacement ?
    Thank you very much indeed.

    post it where you want, but only once...
    I will follow the other thread
    URGENT : replacing some letters in an expression

  • Missing some letters in string

    Well guys, I have one VI that I write some text at a string and I can read it from another VI.
    Always works nice for me, but since some days ago... I start to have some problems
    When I wrote a text like: "Hey, my name is Eduardo"
    when I tryed to read in the other VI, it's missing some letters at the beggining
    it's appearing like: "ame is Eduardo" 
    Some one know what is happening? Because I already tryed change the strings, replace for a new one.. but still the same!
    Thanks

    Well, This VI is in LV 7.1
    I use create a binary header to nominate the file...
    It always work good, but since some days ago start to give me problems with the string that show the name of the file.
    Yes, I tryed to duplicate the code, but I receive the same error, I'm starting to think about reinstall LV 7.1
    maybe something happened I don't know... but if it always work and now start to have problems and I didn't change anything.
    Well I'm uploading the images from write and read, and bouth Sub-vi's that make this ID:
    The problem is happen where I make a red circle.
    Message Edited by EduU on 12-21-2009 07:40 AM
    Attachments:
    SubVI_create binary header.vi ‏61 KB
    SubVI strip binary header.vi ‏64 KB

  • Replacing the letters in a string

    I have an odd set of fields for properties for my client.
    Some have multiple
    letters which correspond to a code table. How can I loop
    through the string
    and replace the letters with words
    For example
    A = central air
    B = ceiling fan
    C = A/C Unit
    If the field looks like 'ABC', it would be outputted to the
    page as 'central
    air ceiling fan A/C Unit'
    Wally Kolcz
    MyNextPet.org
    Founder / Developer
    586.871.4126

    You don't say how many unique letters you have, but I presume
    it is 26 or less. If that's the case, you could index an array that
    has been initialized with the words. See concept code below. It
    assumes only upper case letters.

  • Can't see some letters from my Gmail box in Mail.app in MAC OS 10.8.5.

    Hello, can't see some letters from my Gmail box in Mail.app in MAC OS 10.8.5.

    The solution was to remove all versions of Acrobat Pro and reinstall Acrobat Pro XI. I still had the download file in my Time Machine backup. That's a good thing, since the download link from the order listing on the Adobe website under my account would not work.
    The problems don't occur with version 11.0.0. I got the work done, now I'm updating to 11.1.0 and will report if they came back.

  • How do I find out the size of each individual element within a photoshop file as need to replace some elements?  Thanks :)

    How do I find out the size of each individual element within a photoshop file as need to replace some elements?  Thanks

    What do you mean by "Elements"?
    Elements in a flat image or Layers?
    Could you please post a screenshot with the Layers Panel visible?

  • Where can I purchase a replacement CD for the Airport Express Base station A1264?

    Where can I purchase a replacement CD for the Airport Express Base station A1264?
    I'd like to sell my Airport Base Station, but I believe I need a CD with the software on it for the new owner. Anyone know where I can find one?
    Thanks!
    Meredith

    I doubt it is available.. and since a new Mac doesn't even have an optical drive.. there is no need whatsoever today for the cd.. it is all available in the OS or download. In fact the stuff on the cd will now be totally out of date.

  • Adobe acrobat  v9.4.7 - when combining PDF's some letters are missing

    Hi All,
    Adobe Acrobat  v9.4.7. When viewing individual PDF's the letters are showing OK. Once we combine them (there are about 20 single pdf's that need combining) some letters are removed and it leaves behind a space.
    Looks like 9.4.7 is the last update available for acrobat 9. Anyone had this issue before and what to do about it?

    Open your Printers (Control Panel > Printers)
    Right Click on the PDF Printer and select Properties
    Printing Preferences - Set the Default Settings to High Quality Print
    Click Ok, Ok
    That will set the default for all pdf's to embed fonts.

  • Replacing some text in a text file using TEXT_IO built-in package

    Hi everybody...
    I have written a form procedure in order to replace some text in a text document using the TEXT_IO built-in package. Although the text to be replaced is found , eventually the text is not replaced....
    Obviously , the new file - after the replacement - is not saved(?)..
    So , what should i do?
    The procedure is as follows...
    BEGIN
    in_file := Text_IO.Fopen(filename, 'a');
    LOOP
    Text_IO.Get_Line(in_file, linebuf);
    IF INSTR(linebuf,'C:\LIBS\')<>0
    THEN
    I:=INSTR(linebuf,'C:\LIBS\')-1;
    SUB_STR_BEFORE_VAR:=SUBSTR(linebuf,1,I);
    SUB_STR_AFTER_VAR:=SUBSTR(linebuf,I+9);
    Text_IO.PUT(in_file,SUB_STR_BEFORE_VAR||'D:/SIM/'||SUB_STR_AFTER_VAR);
    END IF;     
    END LOOP;
    EXCEPTION
    WHEN no_data_found THEN
    Text_IO.Fclose(in_file);
    END;
    WHERE :linebuf : is the variable in which the line contents are saved...
    SUB_STR_BEFORE_VAR : is the variable which keeps the substring before the first character of the search string
    SUB_STR_AFTER_VAR : is the variable which keeps the substring after the last character of the search string
    I : variable which keeps the number of character in line (variable linebuf) in which the first character of the search string is found
    Thanks , a lot
    Simon

    Hello,
    The A (Append) mode is used to add data at the end of the file. It will not replace existing data.
    Open the source file in R mode, open the target file in W mode, then rename it with the source name when finished.
    Francois

  • How do i restore default text/font settings for fire fox?Text is not displaying correctly some letters not dark and see odd characters inplace of letters in words

    How do i restore my text so that all words are uniform in darkness?Now some letters are fragmented or missing a part of it and see odd characters instead of letters in some sentences.Ive tried different fonts in the Options still the same.Would like to
    be able to restore my default settings for text/fonts.Would that eliminate this problem?

    Try to set the Boolean pref <b>gfx.font_rendering.directwrite.use_gdi_table_loading</b> to <i>false</i> on the <b>about:config</b> page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold (user set).
    *Preferences can be reset to the default via the right-click context menu if they are user set
    *Preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean)

  • Difficulties replacing some BC functionality with XI (refer to example)

    <b>Difficulties replacing some BC functionality with XI (refer to example)</b>
    I am transferring all interface processing from BC to XI and am having difficulties replacing some of the current BC functionality.  Please refer to my example below
    <b>Current process</b>
    <b>SAP R/3</b>
    SAP R/3 executes an abap that extracts certain data.  This data is passed via a remote function which is configured to point to Business Connector
    <b>Business Connector</b>
    Business Connector takes control and the relevant package does some internal processing then calls the remote enabled function BAPI_ACC_BILLING_POST
    <b>SAP R/3</b>
    Control is returned to SAP R/3 to post the data and on completion control is returned to Business Connector
    <b>Business Connector</b>
    Business Connector again takes control where some more processing is done to generate an xml version of the data prior to returning control back to SAP R/3
    <b>SAP R/3</b>
    Control is returned to the abap immediately following the call to the remote function and processing completes
    The initial synchronous call from SAP R/3 to Business Connector remains open whilst Business Connector executes a subsequent synchronous call to SAP R/3.
    Finally the initial synchronous call in SAP R/3 completes
    <b>Proposed Process</b>
    I am transferring all interface processing from BC to XI and am having difficulties replacing some of the current BC functionality.  In this instance I can set up the initial synchronous call via an XI Integration Process (sync/async bridge).  This allows me to perform subsequent asynchronous calls prior to closing the synchronous bridge
    I have successfully performed synchronous calls to SAP R/3 from XI for different scenarios and have set up the XI design and config in the same manner
    When I try to perform the synchronous posting back to SAP R/3 from within the SA bridge I get the message ‘Message is incomplete. No Sender found’
    Unlike BC, it appears that XI does not allow me to perform the synchronous posting back to SAP R/3 from within the SA bridge.
    <b>Refer to</b> http://help.sap.com/saphelp_nw04/helpdata/en/83/d2a84028c9e469e10000000a1550b0/frameset.htm <b>for the SAP description</b> To enable the communication between a synchronously calling business system (synchronous outbound interface) and an asynchronously called business system (asynchronous inbound and outbound interface), you can define a sync/async bridge in an integration process. You can only define one sync/async bridge for each integration process.
    How can I replace the current BC functionality using XI?
    Regards,
    Mike

    Hi all,
    I cannot replicate the current BC functionality in XI
    So I will take this opportunity to simplify and improve the design for XI --> R/3
    Regards,
    Mike

  • Just want to replace some video with photos, but LEAVE AUDIO THERE. No way?

    Is there no simple way to just replace some video with other video or photos, but not affect audio? I have an interview, and they're talking about places, and I want to put in photos of the places. Pretty basic stuff.
    Thanks for whatever help...

    OK, yeah, CUTAWAY. But, I have the audio "purpled". Should it be? And my photo is sitting ABOVE the place where I want it. How do I get it to go down where it's supposed to? I really need a step-by-step here. I see how to manage the duration of the cutaway, but I don't see how to actually get it INTO the track, and how to "un-purple" the audio track.
    Thank you!

  • When i restored my iphone 5 it shows 4013 and 4005 error and my phone was stuck with apple logo and above some letters where also there in black and white colour .

    when i restored my iphone 5 it shows 4013 and 4005 error and my phone was stuck with apple logo and above some letters where also there in black and white colour . pls say me how to fix this plssss . my email = **********
    <E-mail Edited by Host>

    Wrong Forum

  • Why do some letters render incorrectly in Reader or PDFL when rotated?

    I've noticed that some fonts I'm using don't display correctly in Adobe Reader (or when printed using a Adobe PDF Library based RIP) if they are rotated. Whether I pre-rotate the PDF in iText as I did before we sent a similar file to our printer, or whether you view the right side up PDF in Adobe Reader and rotate the view, the some letters look wrong whenever they're dispalyed sideways.
    Example PDF - this just has one big letter A: http://cl.ly/1c1q0l3F3f2s
    Here's the problem. You can see that the bottom left of the A is screwed up when it's rotated. To see this with the above PDF, open it in Reader and go to View > Rotate View.
    This doesn't happen in other PDF readers such as Chrome's but at the end of the day, our printer uses Adobe based technology and our prints come out wrong. Not rotating is not an option.
    QUESTIONS:
    1. Why is this happening?
    2. How can I fix this? Is this a bug in the Adobe PDF Library?

    There's a Bug which causes Firefox to print '''gibberish''' or '''garbeled''' characters for certain fonts, with certain print drivers.
    https://bugzilla.mozilla.org/show_bug.cgi?id=454532
    ''(Please don't comment in that Bug report unless you can provide a patch to fix the problem.)''
    https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

  • When combine multiple PDFs into one, some letters are missing and display wrong letter

    Hi all. I get a problem with combine multiple PDFs into a single PDF document. There are some PDF documents and they are working fine to open each document separately. But after I use Adobe Acrobat 8 Standard to combine them into one, some letters are missing and some display wrong letter (e.g. "forums" display "fo ums"). Our company has Adobe Acrobat 8 Standard, Adobe Acrobat 7 Professional and Standard. But all of them have some problem. Does anyone have idea for that? Please help me! Thanks very much!

    I have a similar situation, but my PDFs look fine in Acrobat Pro 8,Acrobat Reader 8, and Apple preview, but are missing letters in Acrobat Pro 7. I think it stems from the files being combined all having the same font, but each having a unique subset stored in the respective files, but with the same name (and ID?), and when they are combined, the character sets are getting hosed somehow.

Maybe you are looking for

  • United Kingdom Regional Format sets Monday as the first day of the week.

    With the Region Settings (Settings -> General -> International -> Region Format) set to United Kingdom, Calendar displays Monday as the first day of the week. I have seen other posts whereby it was suggested to change to US Internationalization but t

  • Why can't I sign in to download Photoshop?

    Why can't I sign in to download Photoshop?  I have submitted all necessary information.

  • Runs slow & locks up plus can't windows update & upgrade to professional

    HP 6250 desktop running windows seven. problems started after replacing hard drive.   Help please.....

  • Shift + Smart Object

    When holding shift with a smart object (to constrain proportions) there are times when the smart object will just jump back to where it was before I was resizing and I cannot get it to move when shift is held down. Ideas as to why this happens? It do

  • ASCP Data Collection Error

    Hi, Environment: Decentralized Number of Org: One After doing initial setup in Dev Planning and Source instances, In Planning Instance, When I launched "Planning ODS Load", this set is launching the concurrent program "Generate Items and Category Set