Single quote in the query

Hi,
I am inserting a string literal that contains one or more single quotes. I know i have to use two single quote ('') to represent one single quote in my insert query and four single quotes('''') to show two single quotes. However, when i do a select from the table, all single quotes are escaped with a backslash in front of it (\'). This cause some problem when i display the string in html page. How can i skip the back slash and keep only the single quote in my select query? Thanks
Kim Titu

Kim,
To insert single quote or double quote string try using the ascii values as below -
CHR(34) ==> " (double quote)
CHR(39) ==> ' (single quote)
Example:
Insert into emp(EMPNAME) values(CHR(39)||'TEST'||CHR(39));
Now,
Select EMPNAME from emp;
will give you the result - 'TEST'
Regards,
Murali Mohan

Similar Messages

  • Single quote in SPARQL query

    Hi,
    I have a SPARQL query with a clause like (?affy gb:bioprocess "3\'-phosphoadenosine" .). Oracle Jena adapter translates it into
    sdo_rdf_match('(?affy <gb#bioprocess> "3\'||chr(39)||'-phosphoadenosine")..., which throws the following error when executing the query:
    java.sql.SQLException: ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.TokenMgrError: Lexical error at line 1, column 50. Encountered: "\'" (39), after : "\"3\\"
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 169
    ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 35
    ORA-06512: at line 4
    What does Oracle Jena adapter expect if the SPARQL query has single quote in the literal value? Thanks,
    Weihua

    Hi,
    What is your database version?
    Could you list exactly the literal value you want to query? Please ignore any escapes. Is it as follows?
    3'-phosphoadenosine
    Thanks,
    Zhe

  • Single quote in the String????

    Hello All,
    I want to supress the meaning of single quote in the string, so that I can use the string as one of the fields in my sql query, for doing this inserting "/" before the single code is the way or is there any other standard way to achieve this.
    Thanks in Advance,
    Sarada.

    usually you need to use the scape character for stopping the meaning of a single qoute, or even double quite \', \"
    String s = "select empname from emps where id=\'123\'" ;
    Regards

  • How can I will declare the symbol u2018 (Single Quote) in the report

    Hi ,
    Could you please tell me how can I will declare the symbol u2018 (Single Quote) in the report.
    My requirement is that I have concate the data with single quote and after that I have to store the data in to an internal table and I have to download the data in the form text file in the presentation server.
    For example :
    Let the below data I want to download into the presentation serve in the format of text file by storing in internal table.
    Assume all are constants:
    1st line : abcu2019add
    2nd line :  defu2019gef
    Thanks in advance.

    Hi Jyothi,
    Thanks for the quick reply .
    I can agree with you are point but My requirement is like this I am explaining clearly.
    I have declared the internal table like this.
    DATA: BEGIN OF OTAB OCCURS 0,
             LINE (9024),
           END OF OTAB.
    So I have to append the each line item into the internal table.
    So I am explaining what the data I have to append
    Ist line contains
    'UNBUNOC:2020308u2019 where 020308 I will get the  date from reguh table
    2nd line contains:
    'DTM+20020510' where the 20020510 will be reference document number from the table reguh.
    So I want to declare a constant 'UNBUNOC:2
    2nd the date from reguh table
    And another constant u2018
    So that I can concate all the three and I can put into string and I will append into internal table and I can download the data into the presentation server.
    Please let me know if you need any more clarification regarding my requirement.
    Thanks in advance.

  • Single quote in dynamic query

    Hi all;
    Can u please help me on the following dynamic query code ? I know I am missing the single quote around 2 dates but could not figure out where to put it ! I have tried putting 2 or 3 quotes around 2 bind vars but to no avail.
    Want to create a dynamic query to simulate the the following:
    select
    EMPNO,ENAME,JOB,MGR,HIREDATE from emp where HIREDATE >= to_date('01/01/1981','MM/DD/YYYY') and HIREDATE <= to_date('12/31/1982','MM/DD/YYYY');
    dynamic code:
    declare
    v_q varchar2(4000);
    begin
    v_q :='select EMPNO,ENAME,JOB,MGR,HIREDATE from emp ';
    V_q := V_Q
    || 'where HIREDATE >= '
    || 'to_date(' || :P_DATE1 || ',' ||'''MM/DD/YYYY''' || ' )'
    || 'and HIREDATE <= '
    || 'to_date(' || :P_DATE2 || ',' ||'''MM/DD/YYYY''' || ' )';
    -- end the sql
    v_q := v_q ||';';
    dbms_output.put_line ('V_Q is ' || V_Q);
    end;
    Thanks.
    Zen

    declare
        v_q varchar2(4000);
        v_rec emp%rowtype;
        v_cur sys_refcursor;
    begin
        v_q :='select EMPNO,ENAME,JOB,MGR,HIREDATE from emp ';
        V_q := V_Q  || 'where HIREDATE >= to_date(:P_DATE1,''MM/DD/YYYY'') and HIREDATE <= to_date(:P_DATE2,''MM/DD/YYYY'')';
        dbms_output.put_line ('V_Q is ' || V_Q);
        open v_cur
          for v_q
          using '01/01/1981',
                '12/31/1982';
        loop
          fetch v_cur
            into v_rec.empno,
                 v_rec.ename,
                 v_rec.job,
                 v_rec.mgr,
                 v_rec.hiredate;
          exit when v_cur%notfound;
          dbms_output.put_line('empno = ' || v_rec.empno);
          dbms_output.put_line('ename = ' || v_rec.ename);
          dbms_output.put_line('job = ' || v_rec.job);
          dbms_output.put_line('mgr = ' || v_rec.mgr);
          dbms_output.put_line('hiredate = ' || to_char(v_rec.hiredate,'MM/DD/YYYY'));
          dbms_output.put_line('====================');
        end loop;
        close v_cur;
    end;
    V_Q is select EMPNO,ENAME,JOB,MGR,HIREDATE from emp where HIREDATE >=
    to_date(:P_DATE1,'MM/DD/YYYY') and HIREDATE <= to_date(:P_DATE2,'MM/DD/YYYY')
    empno = 7499
    ename = ALLEN
    job = SALESMAN
    mgr = 7698
    hiredate = 02/20/1981
    ====================
    empno = 7521
    ename = WARD
    job = SALESMAN
    mgr = 7698
    hiredate = 02/22/1981
    ====================
    empno = 7566
    ename = JONES
    job = MANAGER
    mgr = 7839
    hiredate = 04/02/1981
    ====================
    empno = 7654
    ename = MARTIN
    job = SALESMAN
    mgr = 7698
    hiredate = 09/28/1981
    ====================
    empno = 7698
    ename = BLAKE
    job = MANAGER
    mgr = 7839
    hiredate = 05/01/1981
    ====================
    empno = 7782
    ename = CLARK
    job = MANAGER
    mgr = 7839
    hiredate = 06/09/1981
    ====================
    empno = 7839
    ename = KING
    job = PRESIDENT
    mgr =
    hiredate = 11/17/1981
    ====================
    empno = 7844
    ename = TURNER
    job = SALESMAN
    mgr = 7698
    hiredate = 09/08/1981
    ====================
    empno = 7900
    ename = JAMES
    job = CLERK
    mgr = 7698
    hiredate = 12/03/1981
    ====================
    empno = 7902
    ename = FORD
    job = ANALYST
    mgr = 7566
    hiredate = 12/03/1981
    ====================
    empno = 7934
    ename = MILLER
    job = CLERK
    mgr = 7782
    hiredate = 01/23/1982
    ====================
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Insert single quote into the table

    Hi
    I have to insert values into a column that are retrieved by a select query on another table.
    The values inserted have single quotes (').
    Does anybody know how to do it?
    Thanks in advance

    If you get from one table and then insert in the other there shouldn't be any problem at all.
    SQL> create table blah_one as
      2  select 'Radha''s Sarma' col from dual
      3  /
    Table created.
    SQL> select * from blah_one
      2  /
    COL
    Radha's Sarma
    SQL> create table blah_two as
      2* select col from blah_one
    SQL> /
    Table created.
    SQL> select * from blah_two
      2  /
    COL
    Radha's Sarma
    SQL>Cheers
    Sarma.

  • Can we have a Single quote in the tooltip text?

    Hi,
    We have some tooltips for the presentation columns which contains a single quote.
    When I try to view the tooltip from answers the single quote is being replaced by double quotes.
    I tried to use all sorts of escape characters for single quote, like "\'" and ''' and "'" but that didn't work.
    Is there any way to do this.
    Thanks!!
    Vasantha.P

    As I said in my earlier post, I am looking for the tooltips for the Presentation tables and columns. The tooltips for these were extracted from the RPD using the externalize Strings option and these externalized strings are stored in the database.
    So I am escaping the single using a single quote both in rpd and in the database.
    Example text I have used both in the rpd and database is something like "Shipment's start time". I tried with "Shipment''s start time", " Shipment'''s start time", but it didn't work.
    Thanks!!
    Vasantha.P

  • Adding a single quote in the flash chart legend

    Hi all,
    I am using a following code to create a line chart.
    SELECT null link
    ,TO_CHAR(monat, 'MON-YY')
    ,ROUND(No_of_hits/1000) "No of Clicks(''000)"
    FROM
    SELECT DISTINCT TRUNC(ref_month,'MONTH') monat
    ,SUM(no_of_hits) OVER (ORDER BY TRUNC(ref_month,'MONTH') RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) No_of_hits
    FROM goodnews_hits
    WHERE ref_month BETWEEN :p77_DATE_startline
    AND :p77_DATE_endline
    ORDER BY monat;
    I get the following legend in the top region of the chart
    No Of Stories
    No of Clicks(''000)
    I need the No of Clicks to be displayed as
    No of Clicks('000)
    i.e.
    Only one single quote before 000
    Could you please tell me , how this can be achieved?
    Thanks,
    Archana

    As I said in my earlier post, I am looking for the tooltips for the Presentation tables and columns. The tooltips for these were extracted from the RPD using the externalize Strings option and these externalized strings are stored in the database.
    So I am escaping the single using a single quote both in rpd and in the database.
    Example text I have used both in the rpd and database is something like "Shipment's start time". I tried with "Shipment''s start time", " Shipment'''s start time", but it didn't work.
    Thanks!!
    Vasantha.P

  • How to insert a string containing a single quote to the msql database? help

    how can i insert a string which contains a single quote in to database... anyone help
    Message was edited by:
    sijo_james

    Absolutely, Positively use a PreparedStatement. Do not use sqlEscape() function unless you have some overriding need (and I don't know what that could possibly be).
    There are 1000's of posts on the positive aspects of using a PreparedStatement rather than using a Statement. The two primary positive attributes of using a PreparedStatement are automatic escaping of Strings and a stronger security model for your application.

  • Single quotes problem with execute immediate

    Thanks for considering to solve the issue.
    [i]Situation:
    I am trying to create a procedure to perform a set of operations. As part of that, I am trying to create a table using execute immediate statement. This create table statement has a select sub query where p_LOB3 is the variable for the procedure of datatype varchar2.
    Problem :
    I need to pass the variable p_LOB3 as single quoted as it is of type Varchar2. Also I need to enclose the entire create table query within single quotes. How do I specify this as it is throwing an error when the PL/SQL engine is parsing the single quotes in the query used twice for different purposes as mention earlier.
    Query:
    execute immediate'create table test5 as select min(contract_number)as contract_number,contact_id,max(line_of_business) as line_of_business from mytable group by contact_id having min(contract_number) = max(contract_number) and max(Line_of_business) = 'p_LOB3' ';

    Thank you Todd,
    Is just worked fine.
    New issue is: I am not able to put 2 such statements in a single procedure and execute. Before I give parameters to the procedure, PL/SQL engine is actually creating a view of the mytable and naming is as test5, as a result I am not able to create a table as there is a view with the same name.
    Right now, the workaround I am using is to create three different procedures to create three such tables. I know this is not a good idea....can you please tell me if there is a better way.
    Procedure
    CREATE OR REPLACE PROCEDURE SP_CREATE_0_0(p_LOB1 IN varchar2, p_LOB2 IN varchar2)
    IS
    BEGIN
    execute immediate 'create table test5 as select min(contract_number) as
    contract_number,contact_id,max(line_of_business) as line_of_business from
    mytable group by contact_id having min(contract_number) = max(contract_number)
    and max(Line_of_business) = ' ' ' || p_LOB1 || ' ' ' ';
    execute immediate 'create table test5 as select min(contract_number) as
    contract_number,contact_id,max(line_of_business) as line_of_business from
    mytable group by contact_id having min(contract_number) = max(contract_number)
    and max(Line_of_business) = ' ' ' || p_LOB1 || ' ' ' ';
    END SP_CREATE_0_0;
    /

  • Query with Apostrophe (single quote)

    Hi all,
    I have noticed that when you enter a search string with an apostrophe (eg. Tito's Station) in a textbox on a form linked to a table and hit the Query button, it generates an sql error. I think this is cos u cannot have an apostrophe (single quote) in the search string in a "where" clause.
    I am using Portal version 3.0.6.6.5 on an 8.1.7 database.
    I have logged a tar (1744105.999) for this but it is said to be a bug (1759202). I wish to enquire whether any of you have had this problem with a later version or at which version leve this bug has been fixed.
    Does any1 know how to limit the text typed into a texbox, so that it wont accept certain characters (eg. the apostrophe key) ??
    Thanks

    Hi Rene'
    Thanks for your help! This will definitely help me alot! I am a little baffled with your code for delimiting the single quote. I tried it and it doesnt work.
    Thanks very much for the response
    Naseem
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rene' Castle ([email protected]):
    This is still an issue in 3.0.8.9.8. You can use a Javascript validation routine to disallow special characters.
    If you want to check to see that they only enter certain things you can do:
    var s = theElement.value;
    var filter=/^[a-zA-Z]{1,}$/;
    if (s.length == 0 ) return true;
    if (filter.test(s))
    return true;
    else
    alert(" Please input a valid character" );
    theElement.focus();
    theElement.select();
    return false;
    The above code would only allow one or more alphabetic characters. You could make it [a-zA-Z0-9] to allow alphanumeric characters. You could also allow anything but specific characters by doing the following:
    var s = theElement.value;
    var filter=/[^']*/;
    if (s.length == 0 ) return true;
    if (filter.test(s))
    alert(" Please input a string without a single quote (') in it" );
    theElement.focus();
    theElement.select();
    return false;
    else
    return true;
    Hope this gets you started.
    Rene'<HR></BLOCKQUOTE>
    null

  • 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?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Copying a table with the right-click menu in schema browser fails to copy comments when string has single quote(s) (ascii chr(39))

    Hi,
    I'm running 32-bit version of SQL Developer v. 3.2.20.09 build 09.87, and I used the built in context menu (right-clicking from the schema browser) today to copy a table.  However, none of the comments copied.  When I dug into the PL/SQL that the menu-item is using, I realized that it fails because it doesn't handle single quotes within the comment string.
    For example, I have a table named WE_ENROLL_SNAPSHOT that I wanted to copy as WE_ENROLL_SNAPSHOT_V1 (within same schema name)
    1. I right-clicked on the object in the schema browser and selected Table > Copy...
    2. In the pop-up Copy window, I entered the new table name "WE_ENROLL_SNAPSHOT_V1" and ticked the box for "Include Data" option.  -- The PL/SQL that the menu-command is using is in the "SQL" tab of this window.  This is what I extracted later for testing the issue after the comments did not copy.
    Result: Table and data copied as-expected, but no column or table comments existed.
    I examined the PL/SQL block that the pop-up window issued, and saw this:
    declare
      l_sql varchar2(32767);
      c_tab_comment varchar2(32767);
      procedure run(p_sql varchar2) as
      begin
         execute immediate p_sql;
      end;
    begin
    run('create table "BI_ETL".WE_ENROLL_SNAPSHOT_V1 as select * from "BI_ETL"."WE_ENROLL_SNAPSHOT" where '||11||' = 11');
    select comments into c_tab_comment from sys.all_TAB_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and comments is not null;
    run('comment on table BI_ETL.WE_ENROLL_SNAPSHOT_V1 is '||''''||c_tab_comment||'''');
    for tc in (select column_name from sys.all_tab_cols where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT')
        loop
       for c in (select comments from sys.all_col_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and column_name=tc.column_name)
       loop
       run ('comment on column BI_ETL.WE_ENROLL_SNAPSHOT_V1.'||tc.column_name||' is '||''''||c.comments||'''');
    end loop;
    end loop;
    EXCEPTION
      WHEN OTHERS THEN NULL;
    end;
    The string of the table comment on WE_ENROLL_SNAPSHOT is this:
    WBIG table of frozen, point-in-time snapshots of Enrolled Students by Category/term/pidm. "Category" is historically, and commonly, our CENSUS snapshot; but, can also describe other frequencies, or categorizations, such as: End-of-Term (EOT), etc. Note: Prior to this table existing, Census-snapshots were stored in SATURN.SNAPREG_ALL. All FALL and SPRING term records prior-to-and-including Spring 2013 ('201230') have been migrated into this table -- EXCEPT a few select prior to Fall 2004 (200410) records where there are duplicates on term/pidm. NO Summer snapshots existed in SNAPREG_ALL, but were queried and stored retroactively (including terms prior to Spring 2013) for the purpose of future on-going year-over-year analysis and comparison.
    Note the single quotes in the comment: ... ('201230')
    So, in the above PL/SQL line 11 grabs this string into "c_tab_comment", but then line 12 fails because of the single quotes.  It doesn't know how to end the string because the single quotes in the string are not "escaped", and this messes up the concatenation on line 12.  (So, then no other column comments are created either because the block throws an error, and goes to line 22 for the exception and exits.)
    When I modify the above PL/SQL as my own anonymous block like this, it is successful:
    declare
      c_tab_comment VARCHAR2(32767);
    begin
    SELECT REPLACE(comments,chr(39),chr(39)||chr(39)) INTO c_tab_comment FROM sys.all_TAB_comments WHERE owner = 'BI_ETL'   AND table_name = 'WE_ENROLL_SNAPSHOT'  AND comments IS NOT NULL;
    EXECUTE IMMEDIATE 'comment on table BI_ETL.WE_ENROLL_SNAPSHOT_V1 is '''||c_tab_comment||'''';
    for tc in (select column_name from sys.all_tab_cols where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT')
        loop
       for c in (select REPLACE(comments,chr(39),chr(39)||chr(39)) comments from sys.all_col_comments where owner = 'BI_ETL' and table_name = 'WE_ENROLL_SNAPSHOT' and column_name=tc.column_name)
       loop
       EXECUTE IMMEDIATE 'comment on column BI_ETL.WE_ENROLL_SNAPSHOT_V1.'||tc.column_name||' is '||''''||c.comments||'''';
    end loop;
    end loop;
    EXCEPTION
      WHEN OTHERS THEN NULL;
    end;
    On lines 4 and 8 I wrapped the "comments" from sys.all_tab_comments and sys.all_col_comments with a replace command finding every chr(39) and replacing with chr(39)||chr(39). (On line 8 I also had to alias the wrapped column as "comments" so line 10 would succeed.)
    Is this an issue with SQL Developer? Is there any chance that the menu-items can handle single quotes in comment strings? ... And, of course this makes me wonder which other context menu commands in the tool might have a similar issue.
    Thoughts?
    thanks//jacob

    PaigeT wrote:
    I know about quick drop, but it isn't helpful here. I want to be able to right click on a string or array wire, navigate to the string or array palette, and select the corresponding "Empty?" comparator. In this case, since I do actually know where those functions live, and I'm already using my mouse to right click on the wire, typing ctrl-space to open quick drop and then typing in the function name is actually more work than navigating to it in the palette. It would just be nice to have it on hand in the location I naturally go to look for it the first time. 
    I don't agree with this work flow.  Right hand on mouse, left hand on home keys.  Pressing CTRL + Space is done with the left hands, and then you could assign "ea" to "Empty Array" both of which is accessible with the left hand.  Darren posted a bunch of great shortcuts for the right handed developer.
    https://decibel.ni.com/content/docs/DOC-20453
    This is much faster than waiting for any right click menu navigation, even if it is found in the suggested subpalette.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to search the location of the single quote using instr func in a string

    I have a string '345634','234'(all 4 single quotes are part of the string) and I want to find the location of the 3rd single quote using the instr function , could sum1 quickly please help me out.
    Regards
    Rahul
    Edited by: Rahul Kalra on Aug 26, 2010 8:58 AM

    Carlovski wrote:
    You really do learn something new every day!
    It really is quite ugly syntax though.Not really. You can use whatever character you want to indicate the start and end of the string, but if you use any of the brackets "[", "(" or "{" you should terminate using the opposing bracket "]", ")" or "}" respectively. It also looks a bit more ugly with data like that, but if you are entering regular text then it looks ok...
    e.g.
    SQL> select q'[This is my string with fred's quotes in it]' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL> select q'(This is my string with fred's quotes in it)' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL> select q'{This is my string with fred's quotes in it}' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL> select q'.This is my string with fred's quotes in it.' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL> select q'#This is my string with fred's quotes in it#' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL> select q'`This is my string with fred's quotes in it`' as mystring from dual;
    MYSTRING
    This is my string with fred's quotes in it
    SQL>Well... almost any character...
    SQL> select q'¼This is my string with fred's quotes in it¼' as mystring from dual;
    ERROR:
    ORA-01756: quoted string not properly terminated

  • 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

Maybe you are looking for

  • Problem Trying to Subscribe to a Google Calendar in iCal

    We work with a freelance contactor who has shared his Google calendar to one of our staff. When he shares it she gets an email invitation, follows the included link, and can see the shared calendar just fine in Google Calendar. She wants to have the

  • BI 11g with Configuration Manager

    Hi, I have a problem with setting up Configuration Manager with Oracle BI 11.1.1.5. The installation ends with succes but in Oracle Support i can't see any information about my BI platform configuration. Do you have any ideas what may be wrong?

  • How to determine APNS settings are ON or OFF

    Hi, How can i determine from my App whether the Push notification for my app (alerts, sounds and Badges) are switched ON or OFF. If it is OFF, I would like to warn the user and take him to the APNS Settings page from my app. How can I do that. Could

  • When trying to run an AVI I get a compresser/decompresser note and AVI wont open?

    Running premier elements 9.0 and when trying to load an AVI a note shows up saying the file can not be played because the system does not have the required compresser/decompresser installed. I updated the my computer software with the software update

  • My Pismo Stalls at Startup

    I have a Powerbook G3/400 Pismo with 512MB RAM running OS X 10.3.9. When I turn on the Powerbook, I get the familiar Apple logo, then the spinning circle, then the screen turns blue, then grey and then the Powerbook just stalls. But when I boot in sa