Single Quote issue

Hi
i have a string value as IN's/Out Report for Repairs
i need to take the count of table records for above matching string value
ex
select count(*) from Table_x where doc_type in ('IN's/Out Report for Repairs')
its throwing me sytanctical error as single quore already exists in the data.. how to get it work.
Thanks
Naren

What's not working?
SQL> create table table_x as select 'IN''s/Out Report for Repairs' doc_type from dual;
Table created.
SQL> select count(*) from Table_x where doc_type in ('IN''s/Out Report for Repairs');
  COUNT(*)
         1
1 row selected.
SQL> -- or perhaps you'd better try it case-insensitive:
SQL> select count(*) from Table_x where lower(doc_type) = lower('IN''s/Out Report for Repairs');
  COUNT(*)
         1
1 row selected.

Similar Messages

  • Single Quotes Issue??

    Hi,
    Bit of a strange one - hopefully there is a really simple answer that I will kick myself over….!
    I have a query which references a partioned table. When the following condition is added, the query references the intended partion - evident by looking at the explain plan:
    and e.dac_end_date >= '20080401'
    (VARCHAR2 (8 Byte))
    However, I want to automate my script. When I use a variant of the Sysdate function (detailed below) and execute the query, the explain plan indicates that Oracle is doing a full table scan….. Not good!!
    e.dac_end_date >= to_char(add_months(sysdate,-1),'YYYYMM')||'01'
    I'm guessing this may have something to do with single quotes… I have done a forum trawl, and tried some of the suggestions (char(39)||, three quotes surrounding the 'YYYYMM', concatenating single quotes around the format mask etc) - but I either get an error message, or the query just bombs out after a few seconds.
    Anyone have any ideas or suggestions??
    Any help greatly appreciated….
    Cheers in advance.

    Firstly - thanks for the replies.
    Just to confirm - the table I'm referring too is ranged partioned on a varchar2 column that contains a date-as-a-string. I didn’t build the tables - I'm not a developer. I'm just trying to automate a query that I have written which on the surface appears to do a full table scan when I use the Sysdate function (instead of a hard coded date).
    'Bomb out' - bad grammar, apologies. What I meant was the query appears to complete within a few seconds, however does not return any data.
    peticH - I was using 'Session Browser' within Toad to monitor the query (running in another session) - I didn’t realise that even in this instance Explain Plan provides expected rather than actual behaviour. I'll do some reading up on the 'Trace' functionality, to try and see what is actually happening.
    Cheers guys.

  • SQL Strings in Where Clause - single quotes issue

    All,
    I’m having issues related to SQL String literals when trying to deploy to flash. The complication works fine but I then get a message (see below) stating that a ; is missing. The SQL query and the iview runs fine when we use numeric values or do not apply a where clause on the table.
    I am using Visual Composer that has been packaged with NW2004sSP7_Preview
    VC & Flex Version: 645.7.0.3
    The Error message is get is;
    Error in executing a process for Flex compilation, Error 1033: ';' expected
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Error 1205: The statement 'Test' is incomplete.
          (C:usrsapJ2EJC01j2eeclusterserver0GUIMachine_Business_Packagestest_48731FLEX_COMPILATION_FOLEDRAADCN.mxml:269)
    Failed to compile AADCN.mxml
    When I goto the deployment file – it has the below line;
    <i>'<Request type="EXECUTE_RELATIONAL" system="BI_JDBC" system_type="SAP_BI_JDBC" maxrows="500" templateid="BIR_SQL"><Objects type="INPUT" shape="OBJ" role="INPUT"><Object type="INPUT_FIELD" id="SQL_STATEMENT" appName="SQL" mapped="0" value=""/></Objects><Objects type="OUTPUT" shape="SET" role="OUTPUT"><Object type="OUTPUT_FIELD" id="name" appName="name"/></Objects><Objects id="1" type="TEMPLATE_PARAMETER"><Object id="2" type="SQL" value="select name from pub.srcompany where name ='Test Company'"/></Objects></Request>';</i>
    It seems that the parser for the flash deployment is prematurely finishing the parse when it hits the single quotation in the SQL string!
    We had a similar error where if we had a carriage return in the SQL (e.g. between the from & the where clause) then the deployment parser was stating that the line finished prematurely. In the deployment file the carriage return forced a new line thus making the message incomplete. Removing the carriage return resolve that issue
    The SQL Preview in the SQL Editor within VC works fine with the string literals in the where clause.
    The functionality compiles & deploys in web dynpro however it does not return the results to the table
    Questions
    1:> Has anyone successfully used flash with string literals in the SQL where clause or had seen this issue in the past?
    2:> Is there a setting to get the SQL working on Web dynpro for the information to be returned that I may have missed?
    Any assistance would be greatly appreciated.
    Best Regards,
    Ian.

    Hey,
    I have worked with SQL Editor a lot. Here's a how to guide I put together on it:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6339e7d4-0a01-0010-1c98-db00e52e989a
    Let me know if that helps...
    Prakash

  • Importing excel files - problem with single quote

    When importing excel files using 1.5, I can't get data with single quotes (') imported.
    When I run the insert statement given in SQLPlus I get "ORA-01756: quoted string not properly terminated", which is different than the error that SQL Developer gives me (see below).
    Also, I have a numeric value shown without a thousands comma-separator in the XLS file that I'm trying to load into a varchar2 field. But, the insert statements have added a thousands comma-separator which I don't want.
    REM Error starting at line 1 in command:
    REM INSERT INTO table (ID, NAME, CODE)
    REM VALUES (2427407, 'Ed-u-care Children's Center', '73,000');
    REM Error at Command Line:2 Column:37
    REM Error report:
    REM SQL Error: ORA-00917: missing comma
    REM 00917. 00000 - "missing comma"
    REM *Cause:   
    REM *Action:
    One last thing, TOAD gives a way to automap columns chosen from XLS to the columns in the database. It sure would be nice to have this functionality in SQL Developer.
    Thanks,
    Steve

    Did you consider both to be bugs (i.e., single quote issue and thousands comma separator issue)?
    Thanks

  • Issue searching a content with a single quote in title using matches

    Hi,
    I'm trying to search a content which has a single quote in its title by using the following code:
    ISCSSearchAPI searchAPI = app.getUCPMAPI ().getActiveAPI ().getSearchAPI ();
    ISCSSearchQuery query = (ISCSSearchQuery)app.getUCPMAPI ().createObject (ISCSSearchQuery.class);
    query.setQueryText(queryText);
    ISCSSearchResponse response = searchAPI.search(scsContext, query);
    when the query text is: dDocTitle <matches> `What's New`
    an exception occurs:
    Unable to retrieve search results. Error occurred while retrying the search query. Error occurred while processing. Unable to return results.
    Exception in thread "main" com.stellent.cis.client.command.CommandException: Unable to retrieve search results. Error occurred while retrying the search query. Error occurred while processing. Unable to return results.
         at com.stellent.cis.server.api.scs.impl.SCSCommand.executeRequest(SCSCommand.java:338)
         at com.stellent.cis.server.api.scs.impl.SCSCommand.execute(SCSCommand.java:222)
         at com.stellent.cis.client.command.impl.services.CommandExecutorService.executeCommand(CommandExecutorService.java:57)
         at com.stellent.cis.client.command.impl.CommandFacade.executeCommand(CommandFacade.java:158)
         at com.stellent.cis.client.command.impl.BaseCommandAPI.invokeCommand(BaseCommandAPI.java:84)
         at com.stellent.cis.client.api.scs.search.impl.SCSSearchAPI.search(SCSSearchAPI.java:52)
         at com.guycarp.cm.service.ContentQueryService.search(ContentQueryService.java:133)
         at com.guycarp.cm.service.ContentQueryService.main(ContentQueryService.java:168)
    Caused by: com.stellent.cis.server.api.scs.request.SCSRequestException: Unable to retrieve search results. Error occurred while retrying the search query. Error occurred while processing. Unable to return results.
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.checkBinderForErrors(SCSRequestProcessor.java:357)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.validateResponse(SCSRequestProcessor.java:273)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestProcessor.processRequest(SCSRequestProcessor.java:118)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:61)
         at com.stellent.cis.server.api.scs.request.stream.SCSOptimizedPublishFilter.handleRequest(SCSOptimizedPublishFilter.java:128)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)
         at com.stellent.cis.server.api.scs.request.stream.SCSOptimizedRetrieveFilter.handleRequest(SCSOptimizedRetrieveFilter.java:250)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)
         at com.stellent.cis.server.api.scs.request.rewrite.SCSRewriteURLFilter.handleRequest(SCSRewriteURLFilter.java:140)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)
         at com.stellent.cis.server.api.scs.request.cache.impl.SCSServiceCacheFilter.handleRequest(SCSServiceCacheFilter.java:104)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestFilterChain.doRequestFilter(SCSRequestFilterChain.java:58)
         at com.stellent.cis.server.api.scs.request.impl.SCSRequestExecutorProxy.execute(SCSRequestExecutorProxy.java:105)
         at com.stellent.cis.server.api.scs.impl.SCSCommand.executeViaProxy(SCSCommand.java:353)
         at com.stellent.cis.server.api.scs.impl.SCSCommand.executeRequest(SCSCommand.java:335)
    but the query text dDocTitle <contains> `What's New`
    works fine.
    Is there any escape character that I should be using for the single quote when we use <matches> operator?
    Facing the same issue when searching from the content server console.
    Any idea!
    Thanks,
    Anil

    There seems to be none OOTB, but you can define it, see http://docs.oracle.com/cd/E25054_01/doc.1111/e10792/c05_search.htm#CHDIEECF

  • 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

  • Intermittent error on login page when username is entered as a single quote( ' ) and tab is pressed.

    Hi All,
    We have an ADF based portal application which has a login page with Username and Password inputText field.
    When we type a single quote( ' ) in the Username field and press tab to go to the Password field an error is thrown saying "A connection to the server has failed" and this window does not close if we click on ok or the close option of the popup.
    This is causing serious problems for us. It would be great if anyone could help us out as to why this is happening or if anyone has experinced the same issue.
    Thanks,
    Tanya

    Hey Frank,
    Sorry for the delayed reply. Since the issue was a high priority one and had to fix it ASAP we didn't have time to analyse it further.
    We just inserted a javascript that prevented the form from getting submitted if a single quote is entered in the inputText field.
    So far it has worked for us.
    Thanks for your help though.
    Tanya

  • Column Template conditions foiled by a single quote

    I am using a generic column template and have a few pl/sql conditions to shade different rows like so:
    '#1'  like '%Total%'This worked fine until an employee's name appeared in the first column with a single quote in his last name (like O'Brien). Well apparently Apex literally takes whatever is in the field and just shoves it in between the single quotes because the single quote is terminating the string as if you were doing this in sql instead of making it a bind variable:
    'O'BRIEN' like '%Total%'Which results in this friendly message to the users:
    ORA-06550: line 1, column 65: PLS-00103: Encountered the symbol "BRIEN" when expecting one of the following: ) , * & | = - + < / > at in is mod remainder not rem => ..  <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ as between from using || multiset member SUBMULTISET_
         Error      ERR-1025 Error processing PLSQL expression. 'O'BRIEN, JOHN P ' like '%Total%' Can someone from the Apex team confirm that this is the issue? I know I could do a replace on the single quote in my sql, but can't figure out how to escape the '#1#' properly so I don't have to do a replace. I also don't really want to use the Carl Backstrom approach of having to code in a class into the sql when these templates work for 99% of what I need to do.
    Any ideas?

    Dude you rock! I tried about 6 different combos of the q function before I got frustrated and posted. I had too many quotes in mine I guess but that works perfectly.
    Thanks again!

  • Passing String Which Has Single Quote Row/Value to a Function Returns Double Quoate

    Hi, I'm getting weird thing in resultset. When I pass String which has single quote value in it to a split function , it returns rows with double quote. 
    For example  following string:
    'N gage, Wash 'n Curl,Murray's, Don't-B-Bald
    Returns:
    ''N gage, Wash ''n Curl,Murray''s, Don''t-B-Bald
    Here is the split function:
    CREATE Function [dbo].[fnSplit] (
    @List varchar(8000), 
    @Delimiter char(1)
    Returns @Temp1 Table (
    ItemId int Identity(1, 1) NOT NULL PRIMARY KEY , 
    Item varchar(8000) NULL 
    As 
    Begin 
    Declare @item varchar(4000), 
    @iPos int 
    Set @Delimiter = ISNULL(@Delimiter, ';' ) 
    Set @List = RTrim(LTrim(@List)) 
    -- check for final delimiter 
    If Right( @List, 1 ) <> @Delimiter -- append final delimiter 
    Select @List = @List + @Delimiter -- get position of first element 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    While @iPos > 0 
    Begin 
    -- get item 
    Select @item = LTrim( RTrim( Substring( @List, 1, @iPos -1 ) ) ) 
    If @@ERROR <> 0 Break -- remove item form list 
    Select @List = Substring( @List, @iPos + 1, Len(@List) - @iPos + 1 ) 
    If @@ERROR <> 0 Break -- insert item 
    Insert @Temp1 Values( @item ) If @@ERROR <> 0 Break 
    -- get position pf next item 
    Select @iPos = Charindex( @Delimiter, @List, 1 ) 
    If @@ERROR <> 0 Break 
    End 
    Return 
    End
    FYI: I'm getting @List value from a table and passing it as a string to split function.
    Any help would be appreciated!
    ZK

    fixed the issue by using Replace function like
    Replace(value,'''''','''')
    Big Thanks Patrick Hurst!!!!! :)
    Though I came to another issue which I posted here:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a26469cc-f7f7-4fb1-ac1b-b3e9769c6f3c/split-function-unable-to-parse-string-correctly?forum=transactsql
    ZK

  • JSF inputText takes apostrophe (single quote) as end of string

    Hi,
    I run into a problem with JSF when apostrophe(single quote) is in input text:
    <h:inputText id="input1" styleClass="field" size="20" maxlength="20" value="#{bean.property1}" />
    When user inputs string contains apostrophe (single quote), for example "John's task", the bean only gets "John". The text after the apostrophy is gone. It seems that the inputText takes apostrohe as end of the string.
    I also test with escaple sequence, for example, input is "John\' task", the result in bean is still "John"
    input is "John\\\' task", the result in bean is "John
    It doesn't have problem with other special characters, such as "<">", "@" , double quote etc.
    Finally, I fix the problem by replacing apostrohy with "& # 0 3 9".
    I just wonder if anyone has similar prolbem and wehether this is some bug in certain version of JSTL or some configuration issue ( for example, some definittion for end of the string in some config file, etc).
    Your insight is appreciated.
    Thanks

    Without the actual code we can't be of any meaning for you. Create a small reprocudeable test case and post the actual code here. For example:
    JSF<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <f:view>
        <html>
            <head>
                <title>test</title>
            </head>
            <body>
                <h:form>
                    <h:inputText value="#{myBean.value}" />
                    <h:commandButton value="submit" action="#{myBean.action}" />
                    <h:outputText value="#{myBean.value}" />
                </h:form>
            </body>
        </html>
    </f:view>MyBeanpackage mypackage;
    public class MyBean {
        private String value;
        public void action() {
            System.out.println(value);
        public String getValue() {
            return value;
        public void setValue(String value) {
            this.value = value;
    }faces-config:<faces-config>
        <managed-bean>
            <managed-bean-name>myBean</managed-bean-name>
            <managed-bean-class>mypackage.MyBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
    </faces-config>Which works fine by the way.

  • Finding location of single quote ( ' ) in a string

    Hi,
    I have a need to find the location of second single quote in a string.
    Below query works fine for a string without single quote. It gives me the location of word 'HIER' for 2nd occurrence.
    select instr('HIER A HIER B','HIER',2) from dual
    I want to do the same with single quote. I am trying with the below query.
    select instr('HIER A '' HIER B ''',chr(39),2) from dual
    But it always gives me the location of first occurrence of single quote and not the second.
    Any idea about this issue..?
    Thanks

    select regexp_replace('AND ( ACCT_V.HIER_NODE_NM = ''D0100'' AND TODAYS_DATE IS NULL ','.*''(.*)''.*','\1') from dual
    select substr('AND ( ACCT_V.HIER_NODE_NM = ''D0100'' AND TODAYS_DATE IS NULL ',instr('AND ( ACCT_V.HIER_NODE_NM = ''D0100'' AND TODAYS_DATE IS NULL ','''')+1,instr('AND ( ACCT_V.HIER_NODE_NM = ''D0100'' AND TODAYS_DATE IS NULL ','''',1,2)-instr('AND ( ACCT_V.HIER_NODE_NM = ''D0100'' AND TODAYS_DATE IS NULL ','''')-1) from dualComment to the second approach: check SUBSTR() syntax, the second numeric parameter is length of the fragment, not the ending position. Still, RE approach is way shorter and more readable, isn't it? ;)

  • Error with single quotes in open document function

    Hi all,
    I have an issue with the special characters using the open document function. I'm passing a name, and I'm using the URLEncode function, but it doesn't work for single quotes, it shows a javascript error. I tried with HTMLEncode and it works for single quotes, but not for the other special characters like @,+. I tried with both functions at the same time but it doesn't work either.
    Please let me know if you know how to solve it.
    Thanks,
    Marcela

    Hi Prashant,
    I did not work it works for single quotes only, but not for other special characters.
    This one doesn't work for single quotes
    ="<a href='../../scripts/openDocument.aspx?sType=wid&sDocName=Report_Name&sWindow=NEW&sReportName=Company Details&lsSPartner Id=" + [Partner Id] +"&lsSPartner Name=" + URLEncode([Partner Name]) +"'>View catalog</a>"
    This one doesn't work for special characters
    ="<a href='../../scripts/openDocument.aspx?sType=wid&sDocName=RP-DSPP-Company_Catalog_CORETEAM&sWindow=NEW&sReportName=Company Details&lsSPartner Id=" + [Partner Id] +"&lsSPartner Name=" + [Partner Name] +"'>View catalog</a>"
    Thank you,
    Marcela

  • (JDBC)how to diffrenciate a single quote in string ? eg : 'Micheal's Store'

    Hi all,
    I wanted to difrrenciate a single quote in string. Is there any way to do so ?
    I'm using Java.
    Thanks

    If you're using Java, I assume you're using straight JDBC rather than one of the many APIs layered on top of JDBC.
    You should be using PreparedStatement objects with bind variables and you should be passing in string values by making appropriate setString() calls. When you're using bind variables, rather than building up SQL strings in your app, you won't have any issues with escaping quotes. You also won't have to worry about defending against SQL injection attacks and your application will perform much better since you won't be re-parsing the same statement over and over and won't be flooding your library cache with thousands of mostly identical statements.
    Justin
    I intended to say that you won't be flooding your shared pool with thousands of mostly identical statements, not the library cache.
    Message was edited by:
    Justin Cave

  • Single quote in url

    We are using the following configuration in our env...
    Sun web server 6.1 - webserver
    Sun appserver 9.1 EE -application server
    the application server instances are configured with the webserver via loadbalancer plugin.
    If the url contains single quote (%27) the webserver redirects the GET request to a 302 and displaysthe default 404 error page in webserver's docroot
    However, if the issue the same url (with %27) to the appserver, the designated web page is displayed.
    To test the above..
    Try the following
    http://<webserver>:<port>/index.html
    This displays the webserver welcome page
    http://<webserver>:<port>/index.html?test=a
    This displays the webserver welcome page, there is no change
    Now try this
    http://<webserver>:<port>/index.html?test=a%27s
    This will result in the webserver doing a 302 and redirectig to the configured error page..
    Why is this happening, how can we control this.. there cud be escaped single quotes in the URL, which we cannot control
    regds,
    Chiths

    Hi,
    I could not reproduce this with a standalone web server instance. I tried with Web Server 6.1 as well as 7.0 Update 2 release.
    http://<Host>:<Port>/index.html?test=a%27s
    shows me the index.html page fine.
    I tried http://<Host>:<Port>/index.html?test=a's
    as well. This also shows me index.html.
    Can you check if you can reproduce with your standalone web server instance? BTW, Which SP are you using?

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

Maybe you are looking for

  • Can you view multiple iTunes accounts and libraries on the same computer

    Can my wife open her itunes account on my computer and view and play her libraries on my computer

  • OBIEE group and filter in analysis

    Hi all, As an example, I have an analysis with the following table and values on it: Code Description 1 Description 2 Date Description 3 Description 4 Description n 1 abc1 a 01/01/2001 random value random value random value 1 abc1 a 01/01/2003 random

  • Socket Exception in File to Mail Scenario

    Hi All, I developed file to mail scenario, where I am getting the following error in SXMB_MONI :- <b>  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:

  • Tree control with Nodes in ALV

    Hi ABAP Gurus, I am trying to create tree control with nodes in ALV. I have referred to standard BCALV_TREE* programs but new to OO programming. Not sure as to how I can display my internal table data than the SFLIGHT information in these programs. C

  • How do I Change the Name of My MacBook and Why was it Changed after the Upgrade to Yosemite?

    Hi everyone, I upgraded my MacBook Air (2012) to Yosemite a few months back and it changed the name of my Mac from "Alan's MacBook" to "Alan MacBook Air (2)." I simply want to know how to change it back to the original name. Also, why was it changed