'&' in the Replace function

Hi all


I use the replcase function in generatig xml as below

Select Replace ("Test & New", "&", "& amp ;')") Double;

It asks me to enter the value (this is to be considered as subtitute value). How can I manipulate '&' in the function replcase to replace the respective value.

Thanks in advance

This can be useful
Escape the sign & (and) in queries

Tags: Database

Similar Questions

  • Using the Replace function

    Hi all

    I have a column called supplements and it has values such as

    1. the payment is > 90 days
    2. the payment is < = 10 days

    Now, I want to use the Replace function to replace > and < to "greaterthan".
    and 'lessthan' RESP, but the problem is that, in the function replace, I can give that one argument. So what I do is in the region of fx for the column

    Replace (supplements,' > ',' greaterthan')

    This replaces the > sign very well with string greaterthan and show me values such as

    1. the payment is greaterthan 90 days
    2. the payment is < = 10 days

    but I want to replace < "lessthen" also, how can I do? Can I undergo two replace statements? How can replace several string or special characters for a single column?

    Help, please.

    Thank you
    Ronny

    Try this
    CASE
    WHEN supplements LIKE ' % > %' THEN Replace(latepayment,'>','greaterthan')
    WHEN supplements LIKE ' %<=%' then=""><>
    END

  • Can you apply a 'or' within the Replace function

    I developed a script which will produce a flat file UTLFILE. It works for what I need, but my customer's requirement has changed when I need to apply a condition 'OR' with a function replacement:

    From:
    Replace (ALM_OG_PAYMENT_CODE, '6SMP', '51') to something like

    Replace (ALM_OG_PAYMENT_CODE, '6SMP' OR '5ach', 51) or maybe
    Replace (ALM_OG_PAYMENT_CODE, '%', 51) or something like that.

    Any ideas on that?

    -----------------------------------COMPLETE PROGRAM BELOW-------------------------------------------------------------------------------

    Set serveroutput ON SIZE 1000000
    set the position
    Set feedback off
    off Set trimspool
    trigger the echo
    set pagesize 0

    DECLARE
    v_data_file varchar2 (30);
    v_sch_code varchar2 (10);
    v_instance_name varchar2 (10);
    ws_path payroll.pybutfl.pybutfl_utl_file_path%TYPE;
    v_data_line VARCHAR2 (2000): = NULL;
    fhandle_o UTL_FILE.file_type;
    v_line_count NUMBER: = 0;
    v_selected_count NUMBER: = 0;
    v_error_count NUMBER: = 0;
    v_written_count NUMBER: = 0;
    v_error_text VARCHAR2 (50): = ' cannot write the line. ';
    v_errm VARCHAR2 (255);
    v_sqlerrm VARCHAR2 (255);
    v_payment_type VARCHAR2 (10);



    CURSOR c1 IS

    Select RTRIM
    ((to_char (ALM_OG_ACTIVITY_DATE, 'MMDDYYYY')) |'|) ' ||
    ALM_OG_NAME_PREFIX |' | ' ||
    ALM_OG_FIRST_NAME |' | ' ||
    ALM_OG_MI |' | ' ||
    ALM_OG_LAST_NAME |' | ' ||
    ALM_OG_NAME_SUFFIX |' | ' ||
    ALM_OG_DNR_SPOUSE_FIRST_NAME |' | ' ||
    ALM_OG_DNR_SPOUSE_MI |' | ' ||
    ALM_OG_DNR_SPOUSE_LAST_NAME |' | ' ||
    ALM_OG_DONOR_ADDRESS_1 |' | ' ||
    ALM_OG_DONOR_ADDRESS_2 |' | ' ||
    ALM_OG_DONOR_CITY |' | ' ||
    ALM_OG_DONOR_STATE_PROVINCE |' | ' ||
    ALM_OG_DONOR_ZIP |' | ' ||
    ALM_OG_PHONE_AREA | ALM_OG_PHONE_NUMBER |' | ' ||
    ALM_OG_PHONE_EXT |' | ' ||
    ALM_OG_EMAIL |' | ' ||
    ALM_OG_TOTAL_AMOUNT |' | ' ||
    ALM_OG_TOTAL_AMOUNT |' | ' ||
    Replace (ALM_OG_PAYMENT_CODE, '6SMP', '51') |' | ' ||
    Data_line ALM_OG_CAMPAIGN_CODE)

    of wsualumni.wsu_online_giving_table
    where ALM_OG_CAMPAIGN_CODE = 'WDET.

    /**********************************************************************/
    / * Program main treatment * /.
    /**********************************************************************/

    BEGIN



    Dbms_output.put_line ('program began in wsualumni.wsu_online_giving_online");
    IF (fhandle_o) UTL_FILE.is_open
    THEN
    UTL_FILE.fclose (fhandle_o);
    END IF;

    / * Name of the file here * /.
    v_data_file: = ("WDET_" |) To_char (sysdate, 'dd-MON-yyyy') | "_OG_DATA.txt");



    SELECT RTRIM (pybutfl_utl_file_path)
    IN ws_path
    OF payroll.pybutfl;



    fhandle_o: = UTL_FILE.fopen (ws_path, v_data_file, 'w');
    Dbms_output.put_line (' file UTLFILE for this race is: ' | ws_path |) » /'|| v_data_file);
    v_written_count: = 0;




    C1_rec in C1 LOOP
    BEGIN
    v_selected_count: = v_selected_count + 1;
    v_data_line: = rtrim (c1_rec.data_line);
    UTL_FILE.put_line (fhandle_o, v_data_line);
    v_written_count: = v_written_count + 1;
    EXCEPTION
    WHILE OTHERS
    THEN
    Dbms_output.put_line (v_error_text);
    v_error_count: = v_error_count + 1;
    END;
    END LOOP;

    Dbms_output.put_line (' number of records selected: ' | v_selected_count);
    Dbms_output.put_line (' number of records written: ' | v_written_count);

    IF (fhandle_o) UTL_FILE.is_open
    THEN
    UTL_FILE.fclose (fhandle_o);
    END IF;




    END;
    /

    Hello

    Regular expressions are much, much better for this kind of thing.

    REGEXP_REPLACE ( alm_og_payment_code
                   , '(6SMP|5ach)'
                   , '51'
                   )
    

    replaces all occurrences of '65MP' or '5ach' by ' 51 ".

    It works in Oracle 10 (and more).

  • If the Replace function can be used

    Hi all

    I use 11 GR 2 and I love out to take the form of the below output in a row. rather than retrieve the output from "/ db/ptmtrain/data1/system01.dbf" is should be something like "/ db/rdstrain/data1/system01.dbf".

    SQL > select name from v$ datafile where rownum < 6;

    +++++++

    NAME

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

    /DB/ptmtrain/Data1/System01.dbf

    /DB/ptmtrain/data2/sysaux01.dbf

    /DB/ptmtrain/Data1/undotbs01.dbf

    /DB/ptmtrain/Data3/tools01.dbf

    /DB/ptmtrain/data24/users01.dbf

    change as

    SQL > select name from v$ datafile where rownum < 6;

    NAME

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

    /DB/rdstrain/Data1/System01.dbf

    /DB/rdstrain/data2/sysaux01.dbf

    /DB/rdstrain/Data1/undotbs01.dbf

    /DB/rdstrain/Data3/tools01.dbf

    /DB/rdstrain/data24/users01.dbf

    ++++++++

    Concerning

    Select Replace (name, 'ptmtrain', 'rdstrain') of v$ datafile where rownum<>

  • problems using the replace() function

    Hey everybody. :)

    I wrote a query that finds the address of a company (5 columns and concatenates into one). These columns are street, city, County, telno and faxno.
    Some of the companies have a null value for the County, that is when I write the query that it returns a similar result to... 3 main Street, Manchester, 0384758948, 04857846927, but if there was a County it would be 3 Main Street, Manchester, Greater Manchester, 0384758948, 04857846927.

    I tried to write the query then if it is not a County, it removes just the comma and the address becomes 3 Main Street, Manchester, 0384758948, 04857846927... but I can't seem to understand so I thought I'd come and ask the professionals. :)

    set linesize 100
    column suppname heading "name of the provider.
    Select suppname, street | ', ' || City | ', ' || County of | ', ' || Zip code | ', ' || telno | ', ' || faxno "address of supplier.
    from suppliers
    where the County is null
    Replace (County, County, ");

    It gives me an error "command not completed successfully", but I can't for the life of understand me why.

    Thank you in advance. :)

    If the County is optional, you can concatenate the like this:

    select suppname, street || ', ' || town || ', ' ||
        nvl2(county, county||', ', null)
               || postcode || ', ' || telno || ', ' || faxno "Supplier Address"
    

    (you can do the same for the other columns if necessary)

  • backKeyHandler() function not present in ViewNavigatorApplication... What is the replacement?

    The function 'backKeyHandler()' which was once within MobileApplication is no longer present in the new ViewNavigatorApplication.

    Anyone know what the replacement feature is for ViewNavigatorApplication?

    It was renamed backKeyUpHandler.  Remember that an event 'backKeyPressed' has been added to points of view that can be used to respond to a back key press event.

    Chiedo

  • the keyboard functions

    I recently replace my T410 to a T450. I have a heavy use of the key between right Alt and Ctrl on the keyboard T410. However, the new portable T450 doesn't have this key. He has been replaced by a print can I know if there is a way for me to have an original the T410 key shortcut, I need to use frequently?

    Ah yes! The keyboard can be faster and easier to use than the mouse in certain circumstances. Your ideal solution would be to map the right button of the mouse on the key PrSc. This can be done in two ways:

    (1) edit the Windows registry directly

    (2) to do the job more simply install one of many small programs on the net

    Meanwhile, you can get the function key 'Application' by pressing the 'Shift' key, then press the "F10" key (make sure that the locking function is activated). Of couse, it is not as easy as just by pressing the 'Application' on your original T410.

    In addition, you can download the T450 from here user guide: https://download.lenovo.com/pccbbs/mobiles_pdf/t450_ug_en.pdf

  • Call the DLL function with a pointer to a complex structure

    Hello

    I try to call a function by using COLD LAKE. My problem is the function parameters that I'm trying to access.

    Here is the function and its parameters:

    typedef struct _BAR_INFO
    {
    ULONG dwSize;
    ULONG dwFlag.
    } BAR_INFO, PBAR_INFO;

    typedef struct _DEVICE_INFO
    {
    ULONG dwBarNum;
    BAR_INFO BarInfo [6];
    } DEVICE_INFO, * PDEVICE_INFO;

    Int GetDeviceInfo DLLIMPORT)
    unsigned int CIH.
    PDEVICE_INFO pdevinfo
    )
    {
    ULONG i;

    If (DFR > = DevNum)
    Return PCICORE_DEVICE_NO_FOUND;

    If (DevTable [JC]. DevHandle is NOTHING)
    Return PCICORE_DEVICE_NO_INITIALIZE;

    if(pdevinfo == null)
    Return PCICORE_INVALID_PARAMETER;

    pdevinfo-> dwBarNum = DevTable [JC]. DevInfo.dwBarNum;
    < pdevinfo-="">dwBarNum; i ++)
    {
    pdevinfo-> .dwFlag BarInfo [i] =
    DevTable [JC]. DevInfo.BarInfo [i] .dwFlag;
    pdevinfo-> .dwSize BarInfo [i] =
    DevTable [JC]. DevInfo.BarInfo [i] .dwSize;
    }

    Return PCICORE_SUCCESS;
    }

    As an attachment, there is the Info.vi device Get trying to access this feature. The code crashes when the function is called.

    I have probably not pass parameters of data properly to COLD LAKE.

    Thank you for your lights.

    An array of fixed size in C is equivalent to a cluster of LabVIEW that contains the same number of identical items, replace the table with a cluster. In addition, structs are always passed by reference and the C function expects a pointer to a structure, you don't need to unbundle. Skip the cluster to function as a single parameter. Try the attached revised version of your VI.

  • subtract the error function

    Maybe it's a mistake on my part of basic mathematics, but I'm sure 9 less 2 is 7 and not-2.

    Seriously, someone has come across an instance where the function of subtraction mess up like this (see screenshot)?  I tried to replace the function of subtract several times, and it is impossible that the values are simply by changing so fast that I do not see the true values being passed to the function, because the values are the values of thread retention after that I stopped the program.  If I leave a white VI and just put in the 9-2 it outputs 7, as they are supposed to, is not a problem with the machine.

    I found ways around this problem of course.  For example, if I replace the subtraction function with a composed arithmetic add function and put in a - 2 for the constant it works correctly.  (Note: replace the simple add function and using a constant - 2 does not .)  Also, if I convert the value of the variable (represented by #38 probe in the image) to a double representation, instead of the I32 either, that works too.

    In any case, I'm just curious as to if I am the only one affected by this bug, or maybe someone knows why this bug occurs?

    It is possible that you have found a bug in the behavior of the system of values keep.  Since LV 2010 had some changes in the way the code is compiled, it is possible that it was introduced it there.  If you have the means, try to run your VI in 2009 of LV and see if it has the same behavior with the values to keep power on and off.

    If a person of NEITHER sees what wire and jump in, they can request a copy of your code that you could send their private for them to try and understand what is happening.

  • SetCtrlVal used during the Thread function works causes memory leaks

    I am writing a program that works if... Or not work if... - see the next lines... :-)...

    The program includes a section, mostly GUI - and User Interaction.

    The other part is a DLL. In the DLL we readings on an external consultant controller RS232. Sometimes the controller card needs (called how much) time and this time must pass then the result can be read card controller... and so on...

    Blocking is not GUI-user-program for the expectation of the return value of the DLL functions (which need a few seconds to be finished) I start a thread in the DLL with

    CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, THREAD_FunctionX, & tmpTFP, NULL);

    with "tmpTFP" as an instance of type "TYPE_THREAD_FUNCTION_PARAMETERS":

    typedef struct
    {
    //
    int IntVal1;                // 1. Integer-Wert
    int IntVal2;                // 2. Integer-Wert
    int IntVal3;                // 3. Integer-Wert
    int IntVal4;                // 4. Integer-Wert
    int IntVal5;                // 5. Integer-Wert
    //
    int IntBuffer1 [32];            // 1. Integer-buffer (aktuell genugt einer)
    //
    Double DblVal1;                // 1. Double-value
    Double DblVal2;                // 2. Double-value
    Double DblVal3;                // 3. Double-value
    Double DblVal4;                // 4. Double-value
    Double DblVal5;                // 5. Double-value
    //
    char CharVal1;                // 1. (Single)- Tank-Wert
    char CharVal2;                // 2. (Single)- Tank-Wert
    char CharVal3;                // 3. (Single)- Tank-Wert
    char CharVal4;                // 4. (Single)- Tank-Wert
    char CharVal5;                // 5. (Single)- Tank-Wert
    //
    char CharBuffer1 [1024];        // 1. Char buffer (akutell einer genugt)
    //
    } TYPE_THREAD_FUNCTION_PARAMETERS;

    In the GUI-user program - I get fast by default-return value of the thread start function.

    Then I asked the DLL (some global state variables are used for this) when it is finished.

    According to the map-controller (RS232) contacted the waiting time depends on the 'mood' of the controller card.

    In the DLL-mark of the GUI-user-program routine now everything works fine - without using "SetCtrlVal!"

    In my GUI, there is a text box of the info/comment for messages. If I do a few outputs user using 'SetCtrlVal' I always errors, caused by the false "TYPE_THREAD_FUNCTION_PARAMETERS"-values in the service of thread. "» If I set a breakpoint at the beginning thread-function I see mostly erroneous values in my transfer structure variables. If I put a breakpoint in the thread-function-calling 'CmtScheduleThreadPoolFunction (...)"and at the beginning of the thread values are (mostly) correct!

    I tried several and different things - but:

    If I ONLY (!)  Commenting on the (!) of a line with "SetCtrlVal", the program works, all States are asked out of the DLL.

    If I replace the "SetCtrlVal" with a written record-file function clean everything works fine and after completing the program I can look at the log file and see all the user information. BUT with 'SetCtrlVal' instead or set or (...) it does not work.

    My description is maybe not entirely clear, but believe me: only ONE line the «SetCtrlVal "line - should be commented out to let the program run properly!»

    Because if the line "SetCtrlVal"is program-user-GUI, after the call to the thread in the DLL, the DLL-memory seems to be corrupted by the call "SetCtrlVal" in the user-GUI program.»

    Best regards

    F.

    There may be a problem in your structure that your variable is set.

    You said that, after the address of the variable in the thread function the appellant one ends. Now, as you can read help each value passed in parameter threadFunctionData of the layed function must point to an area of memory that persist when the fuction is running: If your variable is defined at the level of the functions it is not valid when the thread runs since the appellant finished and released its local memory.

    Your approach with a global variable is a valid alternative, but if it is the solution, you will find data passed to the thread function must be valid for all his life.

  • Continuity of the functions of the basic function generator and the right time

    I need to create a sine wave, point by point, which will be forwarded to the MIP and finally to a channel of analog output on a PCI-6014

    Ive tried a few different ways to do it, but everyone has some problems with her slider.

    with the 'generator.vi of the base feature.

    and also the "sine waveform.vi.

    There seems to be problems with this lack of points.

    someone helpfully pointed, its very likely windows interrupts the origin of the problem

    Here is a schematic representation of the panels front and rear

    the back panel

    the façade has a few points that are missing

    Another way to do that seems to work better known that the signal "simulate" express vi.

    It's great because it's actually a way of sine 1htz occur at 1htz.

    There are also all the points.

    The problem is that as soon as I put in my request, she grinds to stop.

    Program speed about changes 10khtz less than 1htz when the basic function generator is replaced with this express vi.

    A third idea or concept that has been proposed is to put a programmer to slow the timetable.

    It is once again, works fine, no more points are missed in the plot.

    Yet, he kills again the speed of execution of the program as everything can wait 1ms (or the recripocal of sampling points interval time).

    Someone at - it an idea on how I can get a sine wave in PID, then, in the analog waveform without a huge amount of the efficiency of the program. Im sure this is simple.

    Nevermind

    accedanta do the 2nd option from the top.

    go just to increase the number of samples for now leave the rest of the fastest of the program

  • How to activate the Sleep function to put the computer to sleep if a program is open?

    I have Windows Vista basic on a desktop Dell 530.  I found that if I have a program or application running (such as I-tunes or windows media player) then the Sleep function will not put the computer to sleep.  How to activate the Sleep function to replace these programs and put the computer to sleep?

    Note: This is how it was with windows XP, the Sleep function would put the computer to sleep no matter what was running, he was reliable, if you left the computer and I forgot that you had something running.

    Thanks for your help.

    Hi kevino4130,

    If you disable sharing on your computer (not only the power settings) of media, it should allow him to enter the mode 'sleep'.

    See if that does not solve your problem and let us know.

    Dave D

    Dave D
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Key on the replacement hard drive?

    I replaced the hard disk several months ago and restored from the product CD that comes with this HP.  Now Trend Micro wants to update and tells me to update windows.  When you install SP1 I get error C004F033.  How can I get the key on the new drive?  Why, the restoration does not have the key on the new hard drive?

    More recent AV rely on a certain level of Service Pack of Windows to be present - if this isn't the case, they may be assuming that the bad things about the system and actually break BONES, or simply come to a grinding halt.

    The problem lies in some of the changes in the OS functionality between version RTM and SP2, which are quite significant - and the VA have hang the system in a slghtly differently. do this on the old system sets off red flags with the Service of software license, because it looks like the system, as if something is falsification of critical files.

    It's what makes appear the non-genuine notification, rather than anyting to do with the key itself.

  • Conditional replace Function

    Good afternoon everyone,

    I am trying to assign which I am certain is a basic replace function on certain values in the first column of a table depends on the value of the second column. So if I run the SELECT simple below I get the following:

    -SCRIPT-

    SELECT Col_name_1, Col_name_2

    Table_Name FROM

    -Results-

    Col_name_1 Col_name_2

    13                    0

    23                    0

    44                    1

    47                    1

    50                    0

    Now, say I wanted to replace the values of "Col_name_1" for negative values if the value in the same line of "Col_name_2" is 1. Which gives the following result.

    Col_name_1 Col_name_2

    13                    0

    23                    0

    -44                    1

    -47                    1

    50                    0


    , What would be the most effective way to do it. I thought using logic in the sense of if (Col_name_2 = 1), and then replace (col_name_1, '-&col_name_1') the syntax of this is obviously incorrect, I was wondering how I could produce a "function to replace conditional" which affect only certain rows in the table of results depends on the State.

    Thank you very much

    Charlie

    Hello

    7eb33dbf-5ba7-4248-8088-339e77b11c5e wrote:

    Hi, thanks for you far pointers. Some real examples of data. Col_name_1 was actually 'TARGKEY' and Col_name_2 'CHANGESIGN' then the digital operations to find the reverse (*-1) won't work.

    I guess that means I'm trying to add a hyphen to the TARGKEY value indicates if the value of CHANGESIGN is 1

    To clarify, yes I'm trying only to change the values in the table of results and not "up-to-date" the table of origin.

    It comes to my script.

    SELECT TARGKEY, CHANGESIGN

    OF FDM_SAB. TDATAMAP

    TARGKEY CHANGESIGN
    P0126010 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    P0126015 1
    1078 0
    1078 1
    1078 0
    [NONE] 0

    Once more, always post CREATE TABLE and INSERT statements for the sample data and show the exact results you want from this data.

    If targkey is a string, you can prepend a hyphen with the |   operator, like this:

    SELECT THE CHECK BOX

    WHEN changesign = 1

    THEN '-' | targkey

    Of OTHER targkey

    END AS new_targkey

    changesign

    OF tdatamap

    ;

    It is preceded by a hyphen to targkey when changesign = 1.  That is what you want, or there are a few exceptions (for example, targekey already begins with a hyphen or is null)?  If there is no special cases like this one, include examples in the sample data, results and explanations.

  • How to use the instancecount function in Excel

    Hi OPA Experts,

    I have under the rule of the word:

    ES HL functional review has no records which no State registration is completed if

    InstanceCountIf (function of hl hw customer proposal, status of the review of the hw proposal hl = "Review complete" function) = 0 and

    InstanceCountIf (function of hl hw customer proposal, status of the review of the hw proposal hl = "Return" function) = 0 and

    InstanceCountIf (function proposal customer hw, the review hw proposal function = "Cancelled" status) = 0

    or

    or the other

    InstanceCountIf (function of hl hw customer proposal, status of the review of the function hw proposal hl = "Not started") > 0 or

    InstanceCountIf (function of hl hw customer proposal, status of the review of the hw proposal hl = "in the journal" function) > 0 or

    InstanceCountIf (function of hl hw customer proposal, status of the review of the function hw proposal hl = "awaiting updated comments") > 0 or

    InstanceCountIf (function of hl hw customer proposal, status of the review of the hw proposal hl = "Returned for Reassigning reviewer" function) > 0 or

    InstanceCountIf (function of hl hw customer proposal, status of the review of the function hw proposal hl = "Returned for adding/updating of Documents") > 0

    Can I create a legend for (function of hl hw customer proposal, status of the review of the proposal hl hw function) and use it in excel, please give me an example.

    Thank you

    As a side note, you can replace "InstanceCountIf (function of hl hw customer proposal, status of the review of the hw proposal hl ="Review complete"function) = 0"

    With

    There are (according to hl hw customer proposal, status of the review of the hw proposal hl = "Review complete" function)

Maybe you are looking for

  • Camileo S20 - cannot turn on

    I'm having a problem with my camcorder Camileo S20. I cannot power the device however pc can read. Can anyone help I need for my Friday?

  • My y50 freezes randomly

    computer blocks I do not know why its just randomly.when going its all stopped respoding gel, its just stuck 00 Task Manager does not, the keyboard light does not work capslock and numlock light, I can not do anything rather than close it manually.

  • How to Start sshd in El Capitan?

    Hello I use the remote login on El Capitan. Can you fix the following? Before El Capitan: Turn on my mac, so I have to connect via ssh. After El Capitan: Turn on my mac and log in to my account, then I can connect via ssh. but I can not connect via s

  • Copy music to computer, Apple TV

    How to transfer music from my computer to my AppleTv?

  • the records are in order reverse alpha

    I tried all seen in Word 2007, but my files are still listed in the order opposite alpha. Someone knows how to fix this?