Double quotes in CFScript

I need to add " " within a sentence inside my CFscript. When
I applied it, I got an error, it seems that CFScript doesn't like
the extra "" within "". What should I do so the word "Warning"
appear to user within this double quotes
<CFSCRIPT>
.......some codes here
structFormText[numKey][1]["formText"] = "I have some text
here and I need to put double quotes surrounding a word within this
sentence so that my user will be able to see "Warning" like what
you are seeing now ";
................................some codes here
</CFSCRIPT>

Yet another variation
<cfscript>
x="...my user will be able to see #chr(34)#Warning#chr(34)#
like what you are seeing now ...";
</cfscript>
<cfoutput>#x#</cfoutput>

Similar Messages

  • SSRS Report Returning Double Quote string from a Single Quote String

    Hi, I'm getting weird thing in resultset from SSRS report when executed. When I pass parameter to a report, which passes String that has single quote value 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
    through SSRS report.
    Here is the split function Im using in a report.
    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

    Another user from TSQL forum posted this code which is returning the same resultset but when I execute both codes in SQL server it works and return single quote as expected.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8d5c96f5-c498-4f43-b2fb-284b0e83b205/passing-string-which-has-single-quote-rowvalue-to-a-function-returns-double-quoate?forum=transactsql
    CREATE FUNCTION dbo.splitter(@string VARCHAR(MAX), @delim CHAR(1))
    RETURNS @result TABLE (id INT IDENTITY, value VARCHAR(MAX))
    AS
    BEGIN
    WHILE CHARINDEX(@delim,@string) > 0
    BEGIN
    INSERT INTO @result (value) VALUES (LEFT(@string,CHARINDEX(@delim,@string)-1))
    SET @string = RIGHT(@string,LEN(@string)-CHARINDEX(@delim,@string))
    END
    INSERT INTO @result (value) VALUES (@string)
    RETURN
    END
    GO
    ZK

  • How to print/post double-quotes on reportserver

    Hi, I am using rwservlet and cannot send double quotes. I can escape single quotes with another single quote, but double doublequotes do not work. I have tried url-encoding and html encoding, and even their combination, but report server just refuses to generate the PDF with a string with a double quote.
    this is my URL:
    http://rs-server:7778/reports/rwservlet?cmdkey&report=somereport.jsp&desformat=pdf&TESTSTRING=aaaaaaaa&destype=cache&ACTUSER=19
    now I would need in TESTSTRING to have double quotes
    PS: tried BI Oracle Business Intelligence 10g (10.1.2) and forms and reports 10g

    PostScript printer - send it to the printer port e.g. LPT1: with a simple copy.
    Non-PostScript printer - you'll need to buy a PostScript RIP, or perhaps use Acrobat Distiller to convert the PostScript to PDF, then print the PDF with Acrobat's API - see the Acrobat SDK. (This is not possible with the free Reader).

  • How to globally change straight double quotes to curly open and close?

    I am editing with InDesign (5.5) some documents created by others. I suddenly noticed that the double quote marks were straight, not curly, in one document and Find/Change does not seem to offer and option to distiguish the open (left) double quote mark from the right (close) when starting with double straight quotes. Any suggestions?
    And--unrelated--why is so hard to get to a page where you can actually post a question?
    Thanks!
    Jill

    Since the position of a double quotation mark determines its shape, it is easiest to use GREP with Find/Change. You can (1) find a straight quotation mark at the beginning of a word/phrase and change it to left quotation marks, and then (2) find a straight quotation mark at the end of a word/phrase and change it to right quotation marks.
    (1)
    Find what:
    ~"([\l\u\)[:punct:]])
    This finds a straight quotation mark in front of any character or punctuation.
    Change to:
    \x{201C}$1
    This puts a left quotation marks in front of what was behind the straight quotation mark.
    (2)
    Find what:
    ([\l\u\)[:punct:]])~"
    This finds a straight quotation mark behind any character or punctuation.
    Change to:
    $1\x{201D}
    This puts a left quotation mark behind what was behind the straight quotation mark.
    I would find/change the first hits one at a time, and when you are confident that it works for your documents, go ahead and Change All.

  • Add double quotes (") surrounding each field in GUI_DOWNLOAD

    Experts,
    Does anyone know if it is possible to add double quotes (") to all fields in .txt file using FM GUI_DOWNLOAD besides manually concatenate the quotes into each field before calling the FM?
    For example, output need to be:
    "0000123" "NAME1" "   200.00"
    Any advice is greatly appreciated.
    Best regards,
    Minami

    If you are interested, here is a complete solution.
    report zrich_0001.
    data: it001 type table of t001.
    data: xt001 type t001.
    data: iflatf type table of string.
    data: xflatf type string.
    data: filename type string.
    data: field_value type string.
    field-symbols: <fs>.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-002 .
    parameters: p_file type localfile default
                'C:Test.txt'.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001.
      loop at it001 into xt001.
        do.
          assign component sy-index of structure xt001 to <fs>.
          if sy-subrc <> 0.
            exit.
          endif.
          concatenate '"' <fs> '"' into field_value.
          if sy-index = 1.
            xflatf = field_value.
          else.
            concatenate xflatf field_value into xflatf separated by space.
          endif.
        enddo.
          append xflatf to iflatf.
      endloop.
      filename = p_file.
      call method cl_gui_frontend_services=>gui_download
             exporting
                  filename                = filename
                  filetype                = 'ASC'
             changing
                  data_tab                = iflatf.
    Regard,
    Rich Heilman

  • Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value

    Hello forums,
    I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope.  Let me explain what I want to do and the difficulty that I'm having:
    I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog.  What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot.  The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like.  The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
    So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide.  This action script works fine for the first two input options, but I can't make it work for the third search option.
    I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue.  Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
    I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
    Thank you for your time and consideration.
    Andrew Wilk
    College Library
    UW-Madison

    The tutorial is for a "how to use catalog searching" instruction in an undergraduate library session.  We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep."  Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
    A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested.  Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
    I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
    Thank you for all your suggestions

  • How to replace double quotes with a single quote in a string ?

    Hi All:
    Can some one tell me how to replace double Quote (") in a string with a single quote (') ? I tried to use REPLACE function, but I couldn;t get it worked.
    My example is SELECT REPLACE('STN. "A"', '"', ''') FROM Dual --This one throws an error
    Thanks,
    Dima.

    Whether it is maybe not the more comfortable way, I like the quoting capabitlity from 10g :
    SQL> SELECT REPLACE('STN. "A"', '"', q'(')') FROM Dual;
    REPLACE(
    STN. 'A'{code}
    Nicoals.                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Extracting data in .txt which is enclosed in double quote," "

    Hello everyone,
    I am trying to read data from a .txt file which look like below.
    "13.000000,393.000000 13.000000,291.000000 92.000000,284.000000 94.000000,380.000000 64.000000,385.000000 13.000000,388.000000 "The problem is every time i tried to read and save the data, i also save the double quote sign. Is there anyway to ignore the double quote sign? I am using the below coding to read and save the data in double array. Anyway will be great.
         FileReader fread=null;
             BufferedReader bread = new BufferedReader(new FileReader("test1.txt"));
                java.io.File file=new java.io.File("test1.txt");
             java.util.Scanner input=new java.util.Scanner(file);
             while(input.hasNext()){
              String arr=bread.readLine();
    String[][] str = buildArray(arr);

    veldhanas wrote:
    Hi,
    String yourString = bread.readLine();        
             String substring = yourString.substring(1,yourString.length()-1);
             System.out.println(substring);
    [See the String class |http://java.sun.com/javase/6/docs/api/java/lang/String.html]
    ThanksWatch out for those empty lines...

  • Problems parsing double quote

    I have been trying to figure out my problem for several hours, but still didn't get it. Hope to get an idea from you guys. My code is as follows:
    var astr;
    var outCr ="|";
    var outLf = "\u0000";
    var cr = "\n";
    var lf ="\r";
    var ddQuote=""";
    var dtQuote='\"';
    astr = "<%=firstDesc%>";
    astr.replace(outCr,cr);
    astr.replace(outLf,lf);
    astr.replace(ddQuote, dtQuote);
    while (astr.indexOf(outCr) > 0) {
    z = astr.indexOf(outCr);
    astr = astr.substring(0, z) + cr + astr.substring(z+1,astr.length );
    while (astr.indexOf(outLf) > 0) {
    z = astr.indexOf(outLf);
    astr = astr.substring(0, z) + lf + astr.substring(z+1,astr.length );
    while (astr.indexOf(ddQuote) > 0) {
    z = astr.indexOf(ddQuote);
    astr = astr.substring(0, z) dtQuote astr.substring(z+1,astr.length );
    document.form1.description.value=astr;
    The value of firstDesc is a very big string from the database that contains carriage return, linefeed, single quote and double quote. It needs to be displayed in a HTML text area. Now everything works fine except the double quote. A firstDesc value containing double quote will not appear in the text area, and it even stop my jsp page and disable other buttons. But if I get rid of the code handling the double quote, everything works fine. What's the problem?

    maybe you should ask this question in a JavaScript forum.

  • XSD OTD compilefailure String literal not properly closed by double-quote

    Java CAPS 5.1.3
    I have created a XSD to describe a simple XML file. After this I created an OTD from the exported XSD file.
    This OTD is being used in a JCD. During the build of the Deployment Profile I get the error: :Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
    All steps have been preferformed within the same eDesigner and the same repository.
    I have verified the XSD file with netbeans and can not see a problem with the file itself.
    Any ideas to resolve this compile failure?
    The XSD is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:tns="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1" targetNamespace="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1">
        <xsd:element name="MessageBroker">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="IN" maxOccurs="unbounded">
                        <xsd:complexType>
                            <xsd:all>
                                <xsd:element name="MSGFN" type="xsd:string" default="IN"/>
                                <xsd:element name="DIR" type="xsd:string" default="\"/>
                                <xsd:element name="FILEMASK"
                                    type="xsd:string" default="*.DAT"/>
                                <xsd:element name="MAPID" type="xsd:string" default="MS000"/>
                                <xsd:element name="RCVPRN" type="xsd:string"/>
                                <xsd:element name="RCVPRT" type="xsd:string"/>
                                <xsd:element name="RCVPFC" type="xsd:string"/>
                                <xsd:element name="SNDPRN" type="xsd:string"/>
                                <xsd:element name="SNDPRT" type="xsd:string"/>
                                <xsd:element name="MESTYP" type="xsd:string"/>
                                <xsd:element name="MESCOD" type="xsd:string"/>
                                <xsd:element name="MESFCT" type="xsd:string"/>
                                <xsd:element name="TEST" type="xsd:boolean" nillable="true"/>
                            </xsd:all>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
                <xsd:attribute name="dateTime" type="xsd:dateTime"/>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>The complete error stack trace is:
    com.stc.codegen.framework.model.CodeGenException: error generating otd for CMap1_jcdMB_Recieve_SAP_Inbound1:Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
         at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:767)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.processCodelets(CodeGenFrameworkImpl.java:653)
         at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1544)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
         at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
         at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
         at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
         at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
         at org.openide.util.Task.run(Task.java:136)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
    Caused by: java.lang.RuntimeException: Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
         at com.stc.javac.Javac.compile(Javac.java:227)
         at com.stc.otd.codegen.BaseXsdDtdGenerator.compileFromJarfile(BaseXsdDtdGenerator.java:254)
         at com.stc.otd.codegen.BaseXsdDtdGenerator.compile(BaseXsdDtdGenerator.java:52)
         at com.stc.otd.xsd.codegen.XsdParserGenerator.compile(XsdParserGenerator.java:182)
         at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:166)
         at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:90)
         at com.stc.codegen.OTDImpl.model.CollabOTDGenerator.generateCollabOTDJavaFiles(CollabOTDGenerator.java:233)
         at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.processOTDJars(OTDCodeletFactory.java:861)
         at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:666)
         ... 10 more

    You may need to escape the default slash "\\".
    I'd suggest importing the xsd into the jcaps xml schema editor and verifying that way and then creating the otd by node export.
    Regards,
    Rupert

  • How to replace single quote with double quote

    hai all,
    i have a problem,
    i am trying insert a string containing single quote into ms-access database.
    it is giving error.
    how can i avoid this .if i replace a single quote in the text with double quote it will defenitely
    insert into database.
    in java.lang.String
    replace () will not work to replace quote with double quote.
    any otherway to solve this problem.
    please mail me to [email protected]
    thank you
    sambareddy
    inida

    java.lang.String.replace () will not work to replace quote with double quote.Really?
    String x = ...
    x.replace( "'", "\"" );

  • Replace Single Quote with double quote

    Hi All,
    I have a String s="help'me'to'replace";
    i want to replace single quote( ' ) in to double quote ( " )
    The final out put should be like this help"me"to"replace
    ( Actually this string i have to pass in to an XML )
    Please help any one

    s.replaceAll("'","\"");{code}
    or just one of the String#replace() methods.
    Edited by: sabre150 on Mar 17, 2009 11:48 AM                                                                                                                                                                                                                                                               

  • Replacing " (double quote) with ' (single quote)

    Hi there,
    I have the following method to manipulate user input. All I want to do is, to replace the double quote with a single quote. The implementation I tried was,
    this.replace(desc, "\"", "'");
    This does not work for me. It jsut removes the double quote and does not introduces the single quote. Could any one please advise?
    Thanks,
    Des
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
         }

    Bad luck.. I am unable to get it still.
    This is the code I am using (implemetation is in a JSP. I am using this code to test it).
    public class Test{
    public static void main(String args[]){
         String s = args[0];
         Test t = new Test();
         String doubleQuote = "\"";
         System.out.println(" output :"+ t.replace(s,doubleQuote,"'"));
         //System.out.println(" output :"+ t.replace(s,"\"","'"));
         //System.out.println(" output :"+ t.replace('"', '\''));
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                             System.out.println(" line count :");
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
    }mshn02
    The main problem is I am stuck with the server's version of Java (which I have no control on it). I could not use 1.4.2

  • String literal is not properly closed by a double-quote

    Hi,
    In my Java Class, this message appears:
    String literal is not properly closed by a double-quote
    LINE: The red part of the statement.
    Please help! Thanks!
    package demo;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    public class Flights {
         private EntityManagerFactory emf;
        private EntityManager getEntityManager() {
            if (emf == null) {
                emf = Persistence.createEntityManagerFactory("Flights");
            return emf.createEntityManager();
        public Flights[] getFlights() {
            EntityManager em = getEntityManager();
            try {
                javax.persistence.Query q = em.createQuery("SELECT /*+ INDEX(lh_master_q lh_master_pk)*/ DISTINCT to_char(FD.FLIGHT_DATE, 'DY')||'.'|| FD.FLIGHT_DATE AS DATE_HEADER,
      FD.FLIGHT_DATE AS TRAVEL_DATE,
      B.CITY                       AS LEAVING,
      LM.STD                       AS DEPART,
      C.CITY                       AS ARRIVING,
      LM.STA                       AS ARR,
      LM.FNR                       AS FLIGHT,
      E.CARRIER                    AS AIRLINE,
      LM.ACTYPE                    AS AIRCRAFT,
      LM.ACTYPEFULLNAME            AS EQUIP,
      LM.STD ||' '|| LM.DEP ||' - '|| LM.STA ||' '|| LM.ARR AS SCHEDULE,
      B.CITY ||' - '|| C.CITY AS ROUTE
      MAX(CASE WHEN FA.BOOKING_CLASS = 'S' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY_SAVER,
      MAX(CASE WHEN FA.BOOKING_CLASS = 'H' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY,
      MAX(CASE WHEN FA.BOOKING_CLASS = 'B' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS ECONOMY_FLEXIBLE,
      MAX(CASE WHEN FA.BOOKING_CLASS = 'Z' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS BUSINESS,
      MAX(CASE WHEN FA.BOOKING_CLASS = 'D' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS BUSINESS_FLEXIBLE,
      MAX(CASE WHEN FA.BOOKING_CLASS = 'F' AND p_num_adt > 1 THEN (ROUND(FA.LH_FARE_EUR, 2)* p_num_adt) END) AS FIRST_CLASS
    FROM LH_MASTER_Q LM, LH_FLIGHT_DATE FD, AIRPORTS_LOOKUP B, AIRPORTS_LOOKUP C, CARRIERS E, LH_FARES FA, LH_SERVICE_CLASS SC, LH_CABIN_CLASS CC
    WHERE LM.ROWNR = FD.FLIGHT_LEG_ID
       AND LM.DEP = FA.FROM_AP
       AND LM.ARR = FA.TO_AP
       AND LM.DEP = B.IATA_CODE
       AND LM.ARR = C.IATA_CODE
       AND LM.AL = E.CARRIER_CODE
       AND FA.BOOKING_CLASS = SC.BKG_CLASS_ID
       AND SC.CABIN_CLASS_ID = CC.CABIN_CLASS_ID
       AND LM.ACTYPE = FD.AIRCRAFT_TYPE
       AND B.CITY_CODE = :p_leaving
       AND C.CITY_CODE = :p_arriving
       AND CC.CABIN_CLASS_NAME = :p_class
       AND E.CARRIER = :p_airline
       AND FD.FLIGHT_DATE = :p_outbound
    GROUP BY FD.FLIGHT_DATE,
             to_char(FD.FLIGHT_DATE, 'DY')||'.'|| FD.FLIGHT_DATE,
             B.CITY,
             LM.STD,
             C.CITY,
             LM.STA,
             LM.FNR,
             E.CARRIER,
             LM.ACTYPE,
             LM.ACTYPEFULLNAME,
             LM.STD ||' '|| LM.DEP ||' - '|| LM.STA ||' '|| LM.ARR,
             B.CITY ||' - '|| C.CITY,
             to_char(FD.FLIGHT_DATE, 'DY')
    ORDER BY Depart;");
                return (Flights[]) q.getResultList().toArray(new Flights[0]);
            } finally {
                em.close();
    }

    From the Java specification (http://docs.oracle.com/javase/specs/jls/se5.0/html/lexical.html#3.10.5):
    It is a compile-time error for a line terminator to appear after the opening " and before the closing matching ".
    In other words, string literals cannot span lines.
    You can use the concatenation operator ( + ) to fix this:
    String myLiteral = "A long line " +
    "Another long line " +
    "Another long line, etc.";
    If you're going to ever print out that string literal (like for debugging purposes), it would probably be better to have a return at the end of each line (\n):
    String myLiteral = "A long line\n" +
    "Another long line\n" +
    "Another long line, etc.";
    Edited by: user739461 on Mar 5, 2012 8:10 AM

  • String value changes single quote ' to double quote "

    I am creating a list with different bill codes within single
    quotes as follows
    <cfset corlist = " '1100 ','1200 ','1300 ','1700 ','1800
    ','1950 ','7001 ' ">
    when I do an output
    for
    <cfoutput>AND idbillcode IN ( #corlist
    #)</cfoutput>
    I get the values as follows
    AND idbillcode IN ( '1100 ','1200 ','1300 ','1700 ','1800
    ','1950 ','7001 ')
    However when I put the same string within a cfquery the
    single quotes get replaced by double quotes as follows
    AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
    '',''1800 '',''1950 '',''7001 '') which throws an error.
    Anybody has any clues.
    Thanks.

    However when I put the same string within a cfquery the
    single quotes
    get replaced by double quotes as follows
    AND idbillcode IN ( ''1100 '',''1200 '',''1300 '',''1700
    '',''1800
    '',''1950
    '',''7001 '') which throws an error.
    Anybody has any clues.
    That is ColdFusion escaping the single quotes, by doubling
    them so that
    you can search for strings such as "singhpk's code does not
    work".
    (Note the single quote/apostrophe that would normally break
    this string
    if it was not escaped.
    To tell CF not to do this, one uses the
    preserveSingleQuotes() function.
    The documentation has all the details.

Maybe you are looking for