How to escape the single quote from email value?

Hi,
Is there any way to escape the special character single quote from the email value.
       String ownerQry = "Select Id, email from User where email in('0000'";
        for(int i=0; i<accountData.length; i++)
            ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
ownerQry += ")";
QueryResult qrTeam = sfdcCtrl.query(ownerQry);
When i tried to set the email value on a custom object, its throwing the error as below  and failed to update. <xml-fragment xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><faultcode>sf:MALFORMED_QUERY</faultcode><faultstring>MALFORMED_QUERY:
'[email protected]','brenden.o'[email protected]','[email protected]'
^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</faultstring><detail><sf:fault xsi:type="sf:MalformedQueryFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com"><sf:exceptionCode xmlns:sf="urn:fault.enterprise.soap.sforce.com">MALFORMED_QUERY</sf:exceptionCode><sf:exceptionMessage xmlns:sf="urn:fault.enterprise.soap.sforce.com">
'[email protected]','brenden.o'[email protected]','[email protected]'
^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</sf:exceptionMessage><sf:row xmlns:sf="urn:fault.enterprise.soap.sforce.com">1</sf:row><sf:column xmlns:sf="urn:fault.enterprise.soap.sforce.com">963</sf:column></sf:fault></detail></xml-fragment>

Thanks Dr.Clap.
I think its very tricky to implement this.
Here is the SOQL query. i am passing all the email values.
Select Id, email from User where email in('0000','o\'[email protected]','[email protected]')
These values are coming from oracle DB table in the form of array accountData[].TEAM_EMAIL
        String ownerQry = "Select Id, email from User where email in('0000'";
        for(int i=0; i<accountData.length; i++)
           ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
ownerQry += ")";the array value may contain the email with single quote before @gmail.com which i need to ignore. :-( i think this is very tricky. who knows the solution for this?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to escape a single quotes from a string of dynamic sql clause?

    if a single quotes exist in a dynamic sql clause for a string,
    like
    v_string :='select tname from tab where tabtype='table'',
    there tabtype='table' will conflict with the single quote ahead.
    could somebody tell me how to escape this single quotes?
    thanks for your tips,
    frederick

    fredrick,
    To represent one single quotation mark within a literal, enter two single quotation marks. For example :
    v_string :='select tname from tab where tabtype=''table'''
    Regards,
    Srinivas

  • How to escape a single quote in a find mode view

    Hello,
    I'm working with JDeveloper 10g.
    I've defined a view that is used in "find mode" in a JSP.
    When a value with a single quote is inserted in a field of the search form, an exception is thrown:
    JBO-27122: SQL error during statement preparation.
    ORA-00907: missing right parenthesis.
    The problem is that the "single quote" is not being escaped:
    WHERE STREET LIKE 'ABAT ESCARRE, DE L'A'
    How could I force the view to escape the "single quote"?
    Thanks

    Arrest the single quote by calling a javascript method.
    This might help you
    Re: af:clientListener javascript function call question
    http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_clientListener.html
    Edited by: Srinidhi on Mar 23, 2011 3:46 PM

  • How to escape the double quote in URL

    Hi,
    I know that using backslash we can escape the ',' while sending the data between pages using URL.
    Can any body please help me how to escape the double quotes.
    Thanks a lot.

    Thanks again for the reply and now I am able to encrypt and decrypt my document number... one more question please : will it be possible to chnage the whole URL to some basic message type URL for eg:
    let's say our URL is "http://testdoc/post?mssg" and I want to change this to as "OPEN DOCUMENT" and when user clicks on ""OPEN DOCUMENT" it will still direct to the original destination that is our original URL.
    I have been told that we don;t want to maintain custom table until and unless it's our last choice.
    Thanks,
    Rajat

  • How to Delimit the Single quotes ( ' )

    Hi friends.
    how to delimite the single quotes ( ' )  or
    how to move the single quotes in fields.
    any body pls reply
    thanks
    pauldharma

    Hi,
    Use for single quotes and that will result in a single quote.
    i.e.
    lv_quote = ''''.
    Darren

  • How to delete the single record from the  ODS

    HI,
       I want to DELETE  the particular record from ODS.. how to delete that..
    plz give me the solution.. it's urgent..
    with regards
    @jay

    Hi Prakash,
        You can delete a particular record from ODS by specifying the key field name in Selective deletion button available in Contents tab in the manage screen of ODS. But it will only delete the record from the active data table and not from the Change log and new data table . You should be very carefull if you are doing in Production system as there is chance of deleting other records accidentally.
    Go to Selective deletion button - > Click on delete selection -> Enter the key field values of the record you want to delete-> Press save button to save as Variant -> Go back and click on selection button -> Chosse the background job type -> Click on start button.
    Regards,
    Prakash

  • Extract the single archivelogfile from RMAN backup

    Hi,
    Can anyone tell me how to extract the single archivelogfile from RMAN which taken on primary database.
    This archivelogfile is required for recovering the standby database.
    Oracle version is 10.2.0
    Thanks in advacne.......

    user1813632 wrote:
    Hi,
    Can anyone tell me how to extract the single archivelogfile from RMAN which taken on primary database.
    This archivelogfile is required for recovering the standby database.
    Oracle version is 10.2.0
    Thanks in advacne.......Why you do not want searching in google or referring documentation?
    If you have backup of archivelogs then you can restore archivelogs(one or more) using below command
    rman>restore archivelog from sequence 20 until sequence 21

  • Suppress the single quote when display downloaded file in EXCEL

    I have a requirement to keep all the cells contents left-justisfied when display in EXCEL. I used GUI_DOWNLOAD and concatenate a single quotes to the numeric fields in my internal table. However, when open the file in EXCEL, the single quote show up in the cell also. Anyone knows how to suppress the single quote when open in EXCEL? Here are my codes:
    concatenate '''' itab-field2 into itab-field2.
    modify itab.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
           filename                      = 'c:test_xls.xls'
           FILETYPE                      = 'ASC'
           WRITE_FIELD_SEPARATOR         = 'X'
         tables
           data_tab                      = itab.
    Thank you,

    Check the below program :
    REPORT ZJOINS message-id z01. .
    *REPORT ZTEST3 line-size 400.
    DATA : V_CHAR(1) TYPE C VALUE ''''.
    data : v_field(12) type c.
    data : begin of itab occurs 0,
           fld1(12) type c,
           end of itab.
    start-of-selection.
    v_field = '0000012345'.
    CONCATENATE V_CHAR  V_FIELD  INTO V_FIELD.
    itab-fld1 = v_field.
    append itab.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
        FILENAME                      =
        'C:\Documents and Settings\smaramreddy\Desktop\fff.xls'
       FILETYPE                      = 'ASC'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = itab
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I just tried one field in internal table,i am not sure this program help you
    Thanks
    Seshu

  • Single Quote in Parameter values...!

    Hi there,
    I am using oracle oracle disco. 10g
    In my report there are 2 parameters. First being the customer name and another being the transaction reference. Transaction reference parameter is based on the customer name(s) selected.
    The customer data contains a single quote [e.g. ABC's]. Thus, when the user selects the customer name [with a single quote] and tries to select the transaction reference - discoverer viewer returns an error message - 'Invalid Value'
    This does not happens in discoverer plus.
    Imp: We can not change the data - otherwise I would have remove the single quote from the customer name as part of my query.
    any ideas..!
    Any help would be really appreciated.
    Best Regards,
    Manish

    Hi Yogini,
    Thanks for your reply.
    When the customer name is selected, discoverer reports automatically enclose the customer names in single quotes. like 'ABC LTD', 'ABC's INC',
    I know how to change this single quote format. Also we don't want user to change the parameter selection criteria once selected.
    Also related to double quotes isn't it doubles are treated as column names in the SQL query and can not be used for any other purpose.
    Apologies, I haven't tried this but I think it will not work. Have you tried this with discoverer viewer.
    As mentioned intrusting things is when a customer name with single quote is selected in discoverer Plus it automatically formats the filter criteria to look like ['ABC LTD', 'ABC''s INC'] but this thing doesn't happen in viewer.
    I think this is a bug in discoverer viewer and think there must be some patch available to correct this problem.
    Sorry, don't have a solution yet but will certainly update the thread once I get the solution.
    Also please keep looking for a solution and let me know as well.
    Thanks a lot in advance.
    Best Regards,
    Manish

  • How can I get the host name from Email address?

    hi
    When I using socket to develope an email-sending servlet,I don't know how to get the host name from emial address.can you help me,thanks

    Stripping off the user name will give you the domain of from field in the message. This is not the same as the host. Take a look at:
    http://www.stopspam.org/email/headers/headers.html
    Theres a pretty good discussion about email headers and how to use the information. You probably want to check the information here against the RFC.
    Sean

  • How can I find out the mail server from email address?

    Hi:
    How can I find out the mail server from email address?
    for example: If I know the email address is [email protected],
    how to find the pop3 and smtp mail server?
    THANK YOU

    You can't tell by the email address since you can pretty much put whatever you want in there (especially if the SMTP server is not filtering anything).
    The header may be able to tell you something. There is a Received header value which looks like it has the routing information although I am not sure if this is a complete trace or just the last hop the message took.
    Sean

  • How do you save a picture from email to the iPhoto?

    How do you save a picture from email to the iPhoto?

    Click and hold on the Save button, and a menu appears, listing each attached file’s name along with a Save As button. Select any individual file, and you’ll save just that attachment to disk. But the really nice feature is the final menu item—Add to iPhoto. That’s right; with one button click-and-hold, you can add all of a message’s attached images to iPhoto.
    From Macworld.

  • How to escape the special character ' (ascii 39) in a query

    Hi,
    does anybody know how to escape the special character ' (ascii 39) in a select query?
    I've tried a lot of ways but nothing seems to work, for example I try to get all
    names in table foo where coloumn name contains a '-sign (ascii 39)
    select name from foo where name like '%\'%';
    select name from foo where name like '%{'}%';
    select name from atg_horse where name like '%chr(39)%'
    ... but neither works, I end up with a ORA-01756: quoted string not properly terminated
    I would apriciate any help
    /Carl-Michael

    Use two single quotes inside your literals to represent one single quote.
    For example, this would find my name:
    SELECT *
      FROM emp
    WHERE name = 'Michael O''Neill';
    Michael O'Neill
    (acutely aware of the apostrophe issues in the world)

  • How to pass a single quote in a URL using Javascript

    Can someone tell me how to pass a single quote in a URL using Javascript. I have created a Javascript funciton in which I pass several column values from an APEX report.
    The URL for the report link I am using is "JAVASCRIPT:passBack('#EMP_ID#','#Name#','#e-mail#')"
    The problem occurs with the Name and e-mail columns contain a single quote (i.e. James O'Brien)

    Thank you Saad, that worked.
    Since I built the report using type 'SQL Query (PL/SQL function fody returning SQL query)' I had to add some additional quotes to get it to work.
    i.e.
    replace(EMP_EMAIL_NAME,'''''''',''\'''''')
    or
    replace(EMP_EMAIL_NAME,chr(39),''\'''''')
    Thanks for the help,
    Jason

  • Reading String within the single quotes

    Hi All,
    Can you please let me know, how to read a String within the sinle quote in line.
    I have to read a report into internal table and again from that I need to read a string within the single quote. Please help me in this.
    Thanks in Advance,
    Raghu

    I have the following code:
    REPORT  test.
    DATA:  v_test(05) TYPE c.
    v_test = ‘TTT’.
    I am getting this errror:
    Field “TTT” is unknown.  It is neither kin on e of the specified tables nor defined by a “DATA” statement.
    For some reason, my single quote is not being recognized from my keyboard.  I noticed that my emotion icons are not being displayed either (example:  I type and i do NOT get the smiley face on my end).
    Is there a button that I pressed that caused that?

Maybe you are looking for

  • Problem Upgrading Photoshop 5.0 to CS1

    I have been using Photoshop Elements 6 for a few years now. Recently, I decided to upgrade to Photoshop CS (yes, the first one). However, I found out I needed a version of Photoshop, not Elements if I wanted to do this. So I purchases Photoshop 5.0 o

  • Page break, or start to next page?

    Hi, I have a paragraph style that must be mirrored in a running header. So, I must create a single style for both paragraphs staying in the same page, and paragraphs starting in a new page. Therefore, I must add the break manually when needed (unless

  • Looses wireless connection all the time.

    Hi I have a problem with my macbook pro, it looses its internet connection all the time. I don't know why since it's quite close to it's modem and other laptops that's more far away works fine. Any idea? Best regards Frankensten

  • 17 " Macbook Pro (Early 2011) wont wake up from sleep

    Hi, super new to the forums and was hoping for a solution here. When I leave my computer on while I'm asleep (playing iTunes) it wont wake up by pressing keys or the trackpad or pressing the power button. The computer is still responding to keys, I c

  • Problems on serial communicat​ion with an instrument

    Hello everybody! I'm having some problems interfacing with an Optical Spectrum Analyser from Anritsu via RS232. It has a GPIB interface that works well already, but i need to make communication work thru the serial port. If i use Measurement and Auto