HttpServletRequesr.getParameter :  Problem with double quotes

Hi,
I am having a problem in accessing "POST" parameters which have "quotes" in it. For example,
If the post parameter named param contains Hello "(hw)" World, the getParameter returns Hello instead of Hello "(hw)" World.
I'm not sure if this is related to encoding. Encoding seem to be ISO-8859-1 (got from getCharacterEncoding).
Any clue of the problem ?

How do you send the post parameters. Do you send them usign a html from or are you sending them programaticaly. In that case make sure the keys and values are URL encoded with UTF-8

Similar Messages

  • 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( "'", "\"" );

  • SSIS importing comma delimited with double quote text qualifier - Works in VS - SQL Job ignores text qualifier and fails (truncation)

    I've created an SSIS package to import a comma delimited file (csv) with double quotes for a text qualifier ("). Some of the fields contain the delimiter inside the qualified text. An example row is:
    15,"Doe, John",IS2,Alabama
    In SSIS I've specified the text qualifier as ". The sample output in the connection manager looks great. The package runs perfectly from VS and when manually executed on the SSIS server itself. The problem comes when I schedule the package to run via SQL
    job. At this point the package ignores the text qualifier, and in doing so pushes half of a field into the next available column. But instead of having too many columns, it concatenates the last 2 columns ignoring the delimiter. For example (pipes are fields):
    15|"Doe| John"|IS2,Alabama
    So the failure happens when the last half of a field is too large to fit into the next available field. In the case above _John" is 6 characters where the IS2 field is char(3). This would cause a truncation failure, which is the error I receive from the
    job history.
    To further test this I created a failure flow in my data flow to capture the records failing to be pulled from the source csv. Out of ~5000 records, ~1200 are failing, and every one of the failures has a comma delimiter inside the quoted text with a 'split'
    length greater than the next ordinal field. The ones without the comma were inserted as normal and records where the split fit into the next ordinal column where also imported, with the last field being concatenated w/delimiter. Example records when selected
    from table:
    25|"Allan Percone Trucking"|GI6|California --Imported as intended
    36|"Renolds| J."|UI6,Colorado --Field position offset by 1 to right - Last field overloaded
    To further ensure this is the problem, I changed the csv file and flat file connection manager to pipe delimited, and sure enough every record makes it in perfectly from the SQL job execution.
    I've tried comma delimited on the following set ups. Each set up failed.
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 80
    SSIS Server 2008 R2 RTM
    DB Server 2008 RTM
    DB Compat 100
    SSIS Server 2008 R2 RTM
    DB Server 2008 R2 RTM
    DB Compat 100
    Since a lot of our data comes in via comma delimited flat files, I really need a fix for this. If not I'll have to rebuild all my files when I import them to use pipe delimiters instaed of commas. I'd like to avoid the extra processing overhead if possible.
    Also, is this a known bug? If so can someone point me to the posting of said bug?
    Edit: I can't ask the vendor to change the format to pipe delimited because it comes from a federal government site.

    Just wanted to share my experience of this for anyone else since I wasted a morning on it today.
    I encountered the same problem where I could run the package fine on my machine but when I deployed to a server and ran the package via dtexec, the " delimeter was being replaced with _x0022_ and columns all slurped up together and overflowing columns/truncating
    data etc.
    Since I didn't want to manually hack the DTS XML and can't install updates, the solution I used was to set an expression on the textdelimiter field of the flat file connection with the value "\"" (a double quote). That way, even if the one stored in XML
    gets bodged somewhere along the way, it is overridden with the correct value at run time. The package works fine everywhere now.

  • Csv with double quotes

    Hello,
    I've had harsh time trying to figure out how to read a csv file with double quotes, I need to read a csv file in order to fill a spreadsheet.
    I attach a csv file example to show the sort of file I'm working on.
    Thank you
    Raymundo Cassani
    Solved!
    Go to Solution.
    Attachments:
    test_file.csv ‏1 KB

    Upon closer inspection, you are right, it was a trick question.  You need to look for commas that follow an even number of quotation marks for the separators.  Since my previous snippet was not converted, I assume you have an earlier LV version so I have attached an example in 8.6.  You can get rid of the quotes if you like (exercise for the reader).
    Attachments:
    ReadCSVwithQuotes.vi ‏9 KB

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

  • JS - surrounding selected text with double quotes

    I have a working script which places brackets around selected text in the main body of my document (not in a table), but when I changed the script to insert double curly quotes, the script wont work.
    Why wont this JS work (script stalls on the var line):
    var myObject = (app.selection[0].parent.constructor.name == "Cell") ? app.selection[0].parent.texts[0] : app.selection[0];
    with (myObject)
    insertionPoints[-1].contents = "";
    insertionPoints[0].contents = "";
    while this one does work:
    var myObject = (app.selection[0].parent.constructor.name == "Cell") ? app.selection[0].parent.texts[0] : app.selection[0];
    with (myObject)
    insertionPoints[-1].contents = ")";
    insertionPoints[0].contents = "(";
    Thx Oz
    PS The quotes are showing as three straight quotes above, but in my script they are two straight double quotes surrounding either a right or a left curly double quote.

    Perhaps there's a Smart Quotes interpreter in JS? Who knows.
    If you find it failing again, try inserting the quotes as Unicode values, as these should not be subject to any translating.
    I.e.,
    >insertionPoints[-1].contents = "\u201c";

  • JAVA arithmetic problem with double ?

    If I try to work double precision numbers I get a unintelligible result, but what do I do wrong ?
    Are there any inaccuracy in the JAVA double precision numbers arithmetic or what's the problem with this very simple example code ? How can I get correct result ?
    Simple example code :
    ================
    for (double i = 0; i < 10; i = i + 0.01)
    System.out.println(i);
    On the output :
    ===========
    0.0
    0.01
    0.02
    0.03
    0.04
    0.05
    0.060000000000000005
    0.07
    0.08
    0.09
    0.09999999999999999
    0.10999999999999999
    0.11999999999999998
    0.12999999999999998
    0.13999999999999999
    0.15
    0.16
    0.17
    0.18000000000000002
    0.19000000000000003
    0.20000000000000004
    0.21000000000000005
    0.22000000000000006
    0.23000000000000007
    0.24000000000000007
    0.25000000000000006
    0.26000000000000006
    0.2700000000000001
    0.2800000000000001
    0.2900000000000001
    0.3000000000000001
    0.3100000000000001
    0.3200000000000001
    0.3300000000000001
    0.34000000000000014
    0.35000000000000014
    0.36000000000000015
    0.37000000000000016
    0.38000000000000017
    0.3900000000000002
    0.4000000000000002
    0.4100000000000002
    0.4200000000000002
    0.4300000000000002
    0.4400000000000002
    0.45000000000000023
    0.46000000000000024
    0.47000000000000025
    0.48000000000000026
    0.49000000000000027
    0.5000000000000002
    0.5100000000000002
    0.5200000000000002
    0.5300000000000002
    0.5400000000000003
    0.5500000000000003
    0.5600000000000003
    0.5700000000000003
    0.5800000000000003
    0.5900000000000003
    0.6000000000000003
    0.6100000000000003
    0.6200000000000003
    0.6300000000000003
    0.6400000000000003
    0.6500000000000004
    0.6600000000000004
    0.6700000000000004
    0.6800000000000004
    0.6900000000000004
    0.7000000000000004
    0.7100000000000004
    0.7200000000000004
    0.7300000000000004
    0.7400000000000004
    0.7500000000000004
    0.7600000000000005
    0.7700000000000005
    0.7800000000000005
    0.7900000000000005
    0.8000000000000005
    0.8100000000000005
    0.8200000000000005
    0.8300000000000005
    0.8400000000000005
    0.8500000000000005
    0.8600000000000005
    0.8700000000000006
    0.8800000000000006
    0.8900000000000006
    0.9000000000000006
    0.9100000000000006
    0.9200000000000006
    0.9300000000000006
    0.9400000000000006
    0.9500000000000006
    0.9600000000000006
    0.9700000000000006
    0.9800000000000006
    0.9900000000000007
    1.0000000000000007
    1.0100000000000007
    1.0200000000000007
    1.0300000000000007
    1.0400000000000007
    1.0500000000000007
    1.0600000000000007
    1.0700000000000007
    1.0800000000000007
    1.0900000000000007
    1.1000000000000008
    1.1100000000000008
    1.1200000000000008
    1.1300000000000008
    1.1400000000000008
    1.1500000000000008
    1.1600000000000008
    1.1700000000000008
    1.1800000000000008
    1.1900000000000008
    1.2000000000000008
    1.2100000000000009
    1.2200000000000009
    1.2300000000000009
    1.2400000000000009
    1.2500000000000009
    1.260000000000001
    1.270000000000001
    1.280000000000001
    1.290000000000001
    1.300000000000001
    1.310000000000001
    1.320000000000001
    1.330000000000001
    1.340000000000001
    1.350000000000001
    1.360000000000001
    1.370000000000001
    1.380000000000001
    1.390000000000001
    1.400000000000001
    1.410000000000001
    1.420000000000001
    1.430000000000001
    1.440000000000001
    1.450000000000001
    1.460000000000001
    1.470000000000001
    1.480000000000001
    1.490000000000001
    1.500000000000001
    1.5100000000000011
    1.5200000000000011
    1.5300000000000011
    1.5400000000000011
    1.5500000000000012
    1.5600000000000012
    1.5700000000000012
    1.5800000000000012
    1.5900000000000012
    1.6000000000000012
    1.6100000000000012
    1.6200000000000012
    1.6300000000000012
    1.6400000000000012
    1.6500000000000012
    1.6600000000000013
    1.6700000000000013
    1.6800000000000013
    1.6900000000000013
    1.7000000000000013
    1.7100000000000013
    1.7200000000000013
    1.7300000000000013
    1.7400000000000013
    1.7500000000000013
    1.7600000000000013
    1.7700000000000014
    1.7800000000000014
    1.7900000000000014
    1.8000000000000014
    1.8100000000000014
    1.8200000000000014
    1.8300000000000014
    1.8400000000000014
    1.8500000000000014
    1.8600000000000014
    1.8700000000000014
    1.8800000000000014
    1.8900000000000015
    1.9000000000000015
    1.9100000000000015
    1.9200000000000015
    1.9300000000000015
    1.9400000000000015
    1.9500000000000015
    1.9600000000000015
    1.9700000000000015
    1.9800000000000015
    1.9900000000000015
    2.0000000000000013
    2.010000000000001
    2.020000000000001
    2.0300000000000007
    2.0400000000000005
    2.0500000000000003
    Thanks for answerers !
    Joseph

    This result is entirely unsurprising, and the flaw lies in your program, not in Java.
    Java represents numbers in 2's complement [SEM] form (read the Java Language Specification (JLS), according to agreed standards. When you specify a fractional number that appears to be nice and easy to work with, you are thinking in decimal notation, not binary, and you are giving it a number that cannot be precisely represented. It is a little like asking you to write down exactly what pi is (all its digits ;-)).
    So the number you get is not precisely what you asked for (one very insignificant error). But then you compound it by adding an inaccurately represented number to an inaccurately represented number, and so on, until the bit errors combine to make a very inaccurate number.
    The correct way to approach what you are trying to do would be to perform the addition using integers, and multiply each time you want to scale it to a double.
    This has been asked many times - I would suggest you:
    - Search the forums
    - Check out the language spec
    - or do a degree in CompSci :-)
    A calculator is a little more accurate because it does not have to conform to agreed standards, and so can use special logic to minimise such errors. The average pocket calulator also works to a much lower level of accuracy (usu 8 digits), and therefore masks the errors to you. You'd find that you got the same effect if you played with it long enough.
    Hope this helps

  • 8.1.7 jdbc driver: object types with double quotes

    Hi all,
    While switching from 8.1.6 to 8.1.7 I have trouble with the jdbc driver. It doesn't work
    as before: The function CallableStatement.registerOutParameter (and probably some other) doesn't take object type
    names in double quotes anymore. A test program is appended to this message. Using a 8.1.6 jdbc driver this program works fine but with a 8.1.7 jdbc driver it throws an exception.
    My questions are: Is this bug already filed?
    Is a bugfix already available somewhere?
    Thanks in advance for any information
    Joerg
    import java.sql.*;
    * create type "test_t" as object (atrb number(10));
    * create table "test" of "test_t" (atrb not null) oidindex();
    class test
    public static void main (String args [])
    throws SQLException
    String s = "begin insert into \"test\" t values (1)" +
    " returning ref(t) into ?; end;";
    try{
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@host:1521:orcl","joerg", "password");
    CallableStatement cs = conn.prepareCall( s );
    cs.registerOutParameter(1, Types.REF, "\"test_t\"");
    cs.execute();
    System.out.println("Statement returned:");
    System.out.println( cs.getObject(1) );
    cs.close();
    conn.commit();
    conn.close();
    catch(SQLException e){
    System.out.println("SQLException was thrown...");
    System.out.println(e.getMessage());
    }

    I believe that typenames are always treated as case sensitive (unless they are all uppercased).
    In your example you should write:
    cs.registerOutParameter(1, Types.REF, "test_t");
    If you had declared the type test_t in a case insensitive way (without "..."), then you'd have to write:
    cs.registerOutParameter(1, Types.REF, "TEST_T");
    If you have a schema-qualified name, use a ".":
    cs.registerOutParameter(1, Types.REF, "SCOTT.test_t");
    However, this behavior implies that you cannot use "." inside of quoted identifier names.

  • Update with double quotes

    Hi,
    How to include double quotes in a update statement?
    UPDATE sampletable
    SET description = '<p style="font-weight: bold; color:Red;"> Message to Employee </p>'
    WHERE empid = 1;
    Expected output with I query table,
    select description from sampletable WHERE empid = 1;
    <p style="font-weight: bold; color:Red;"> Error Message </p>
    Table definition:
    sampletable
    empid number
    description varchar2(200)
    Thanks

    Please use the {noformat}{noformat} tag at the beginning and end of your examples.SQL> create table sampletable( empid number, description varchar2(2000));
    Table created.
    SQL> insert into sampletable values (1, null);
    1 row created.
    SQL> UPDATE sampletable
    2 SET description = '<p style="font-weight: bold; color:Red;"> Message to Employee </p>'
    3 WHERE empid = 1;
    1 row updated.
    SQL> select * from sampletable;
    EMPID
    DESCRIPTION
    1
    <p style="font-weight: bold; color:Red;"> Message to Employee </p>
    Your question is not clear: why are you expecting "Error Message" instead of "Message to Employee"?
    What do the double quotes have to do with it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Compiler Problem with double. Need Help

    Hello,
    I am having a problem with WorkShop Compilers 5.0 98/12/15 C++ 5.0. There is a problem with declaring double inside a nested class which is nested 3 times. Below is the code what shows the problem. If you have Workshop 5.0 please cut and paste the program below and do a simple cc <filename> compile. Run it and you should see the problem.
    ---------------------------cut----------------------------
    #include <stdio.h>
    class myclass3
    public:
    myclass3() {}
    ~myclass3() {}
    short aaa;
    int bbb;
    double ccc;
    char ddd;
    class myclass2
    public:
    myclass2() {}
    ~myclass2() {}
    short aaa;
    int bbb;
    double ccc;
    char ddd;
    myclass3 m_myclass3[50];
    class myclass
    public:
    myclass() {}
    ~myclass() {}
    int a;
    char b;
    float c;
    short aa;
    double bb;
    myclass2 m_myclass2;
    int main()
    myclass m_myclass;
    m_myclass.m_myclass2.m_myclass3[1].ccc = 11111.1111;
    printf("<%f>\n",m_myclass.m_myclass2.m_myclass3[1].ccc);
    return 0;
    ---------------------------cut----------------------------
    The result I get on my machine is
    <-3100025845628125216032986949222617505819484589120973946744108811398502585541238252995581839380933130321904775653231251529249013141831370896782391931299571941247444654355877793201472387703486841059940760873131775588361546584668766208.000000>
    This is definitly incorrect. Does anyone have this problem? Is this a compiler bug? If you figure it out please email me at [email protected]
    Thanks
    Salman Ahmad

    Salman - I tested your program on an up to date version of the C++
    5.0 compiler and received the following results:
    a.out<11111.111100>
    That is what I would expect...
    Have you installed all of the patches for the 5.0 compiler? It is
    possible that this problem was found and fixed.
    The current basic patchid's for CC 5.0 on sparc are: 107311-12, 107357-11, and the libC patch for your version of the OS.

  • Query filters with double quotes fail

    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

    Also, in general, it is advantageous to separate variable content in a
    query out into parameters. This helps us out when maintaining our query
    compilation cache.
    -Patrick
    Stephen Kim wrote:
    Wolfgang,
    To do this in JDO you have to double escape it
    i.e. string== \"My name is \\\"Wolfgang\\\".\"
    Wolfgang Hutya wrote:
    Hi,
    when I to execute a query with a filter that contains double quotes on
    Kodo 3.0.3 I get an Exception.
    Filter:
    string == \"My name is \"Wolfgang\".\"
    Kodo interprets the double quotes (after 'is ' )as the end of the string
    and expects the next token ('Wolfgang') to be an attribute name.
    Is there an escape character for double quotes or any other solution?
    Exception:
    kodo.util.UserException: Attempt to query nonexistant or unm
    anaged field "Wolfgang" of type "de.logas.datenbank.jdo.BeispielKlasse1".
    at kodo.query.FilterParser.traversePath(FilterParser.java:1061)
    at kodo.query.FilterParser.eval(FilterParser.java:783)
    at kodo.query.FilterParser.getValue(FilterParser.java:999)
    at kodo.query.FilterParser.eval(FilterParser.java:813)
    at kodo.query.FilterParser.getExpression(FilterParser.java:1021)
    at kodo.query.FilterParser.parseFilter(FilterParser.java:204)
    at
    kodo.query.JDOQLQuery$DataStoreQueryExecutor.<init>(JDOQLQuery.java:4
    27)
    at
    kodo.query.JDOQLQuery.newDataStoreQueryExecutor(JDOQLQuery.java:99)
    at
    kodo.query.AbstractQuery.internalCompile(AbstractQuery.java:576)
    at kodo.query.AbstractQuery.compile(AbstractQuery.java:531)
    at
    kodo.datacache.CacheAwareQuery.compile(CacheAwareQuery.java:271)
    -- Wolfgang

  • View Columns with Double Quotes

    When Creating a view I specify Column Names, but when you look at the SQL tab it puts double quotes around the columns is there a preference to turn this off? Is there a reason for it operating this way?
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" (CUSTOMERS_ID, CUSTOMER_NAME) AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;
    becomes the following
    CREATE OR REPLACE FORCE VIEW "MCT"."V_USER_ORGANIZATIONS" ("CUSTOMERS_ID", "CUSTOMER_NAME") AS
    SELECT Customers_ID, Customer_Name FROM mct.Customers
    UNION ALL
    SELECT Proc_Offices_ID *-1 as Customers_ID, Proc_Office_Name as Customer_Name FROM mct.proc_offices;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The only control we have over the DDL that is generated are the options in Tools > Preferences > Database > ObjectViewer Parameters, which doesn't include an option to exclude unnecessary double quotes.
    The reason why they are put in when generating the DDL is to simplify the logic of generating the DDL - if they were not there, it would be necessary to check if names were in mixed case or not. For example, it would be possible to create a view as follows:
    CREATE OR REPLACE FORCE VIEW "My_View" ("Customer_ID", "Customer_Name") AS ...
    With this, I have explicitly said that my view and column names are case sensitive - and this is NOT equivalent to:
    CREATE OR REPLACE FORCE VIEW MY_VIEW (CUSTOMER_ID, CUSTOMER_NAME) AS ...
    That being said, as I understand it, SQL Developer uses the DBMS_METADATA package to generate the DDL and the inclusion of the double quotes is presumably the standard option with that.
    theFurryOne

  • Problem with single quote around ANYINTERACT

    CREATE TABLE JUNK
    as SELECT s.survey_id,s.shape,s.original_depth
    FROM bathyuser.sounding s,m_covr r
    WHERE SDO_GEOM.RELATE (s.shape, 'ANYINTERACT', R.geom, 0.5) = 'TRUE'
    AND R.DSNM=CNT.DSNM
    and
    s.SURVEY_ID in
    (SELECT unique s.survey_id FROM header s, m_covr r
    WHERE SDO_GEOM.RELATE (s.shape, 'ANYINTERACT', r.geom, 0.5) = 'TRUE'
    AND DSNM=CNT.DSNM)';
    This above SQL works fine in SQL prompt. But when I put it together in PL/SQL it gives me this error :
    WHERE SDO_GEOM.RELATE (s.shape, 'ANYINTERACT', R.geom, 0.5) = 'TRUE'
    ERROR at line 17:
    ORA-06550: line 17, column 39:
    PLS-00103: Encountered the symbol "ANYINTERACT" when expecting one of the
    following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
    Could someone help me fix this error. I know I have to try it with "EXECUTE IMMEDIATE" command, but I'm having problem with "||" (concatinate).
    Thanks so much
    Cuong

    This is how you go about debugging execute immediate statements. I am assuming that you fixed the first problem as marias suggested and cam up with something like this. Note, I changed the table in your surso to dual since I do not have your tables, but the effect is the same. I changed the EXECUTE IMMEDIATE to DBMS_OUTPUT.Put_Line so you can actually see what you are trying to execute. I also added some carriage returns to make the formatting a littel easier to see. This is what I got:
    SQL> DECLARE
      2     statement varchar2(1000);
      3  CURSOR C_DSNM5 IS
      4     SELECT dummy dsnm FROM dual;
      5  BEGIN
      6     FOR CNT IN C_DSNM5 LOOP
      7        STATEMENT := 'CREATE TABLE JUNK'||
      8                     ' AS SELECT s.survey_id,s.shape,s.original_depth'||CHR(10)||
      9                     ' FROM bathyuser.sounding s,m_covr r '||CHR(10)||
    10                     'WHERE SDO_GEOM.RELATE (s.shape, '||
    11                     '''ANYINTERACT'''||
    12                     ', R.geom, 0.5) = '||'''TRUE'''||CHR(10)||
    13                     ' AND R.DSNM = CNT.DSNM '||CHR(10)||
    14                     ' AND s.SURVEY_ID IN '||
    15                     ' (SELECT UNIQUE s.survey_id FROM HEADER s, m_covr r'||CHR(10)||
    16                     ' WHERE SDO_GEOM.RELATE (s.shape, '||
    17                     '''ANYINTERACT'''||
    18                     ', r.geom, 0.5) = '||
    19                     '''TRUE'''||CHR(10)||
    20                     ' AND R.DSNM = '||CNT.DSNM||' )';
    21        DBMS_OUTPUT.Put_Line (statement);
    22     END LOOP;
    23  END;
    24  /
    CREATE TABLE JUNK AS SELECT s.survey_id,s.shape,s.original_depth
    FROM bathyuser.sounding s,m_covr r
    WHERE SDO_GEOM.RELATE (s.shape, 'ANYINTERACT', R.geom, 0.5) = 'TRUE'
    AND R.DSNM = CNT.DSNM
    AND s.SURVEY_ID IN  (SELECT UNIQUE s.survey_id FROM HEADER s, m_covr r
    WHERE SDO_GEOM.RELATE (s.shape, 'ANYINTERACT', r.geom, 0.5) = 'TRUE'
    AND R.DSNM = X )
    PL/SQL procedure successfully completed.You have at least two issues with this CREATE TABLE statement. The last line needs to have the X (which came from dual) quoted since it is a string. You also still have a reference to CNT.DSNM, unless you fixed both occurences.
    Another major problem is that if your cursor will return more than one row, and by the structure of this I assume that it might, the on the second record you are going to get:
    ORA-00955: name is already used by an existing object.
    Although I see no reason why you need dynamic sql here, you really need to use bind variables whereever possible (everywhere you use a variable except ofr names of database objects. So, your procedure should look more like:
    DECLARE
       statement varchar2(1000);
       CURSOR C_DSNM5 IS
          SELECT distinct DSNM from M_COVR where dsnm like 'US5%';
    BEGIN
       FOR CNT IN C_DSNM5 LOOP
          STATEMENT := 'CREATE TABLE JUNK'||
                       ' AS SELECT s.survey_id,s.shape,s.original_depth'||
                       ' FROM bathyuser.sounding s,m_covr r '||
                       'WHERE SDO_GEOM.RELATE (s.shape, '||
                       '''ANYINTERACT'''||
                       ', R.geom, 0.5) = '||'''TRUE'''||
                       ' AND R.DSNM = :b1 '||
                       ' AND s.SURVEY_ID IN '||
                       ' (SELECT UNIQUE s.survey_id FROM HEADER s, m_covr r'||
                       ' WHERE SDO_GEOM.RELATE (s.shape, '||
                       '''ANYINTERACT'''||
                       ', r.geom, 0.5) = '||
                       '''TRUE'''||
                       ' AND R.DSNM = :b2 )';
          EXECUTE IMMEDIATE statement USING cnt.dsnm, cnt.dsnm
       END LOOP;
    END;But it is still very wrong.
    Perhaps if you can explain in words what you are trying to accomplish someone can provide a much better response.
    John

  • Encrypt() returns values with double quotes

    I'm using encrypt to hide my state variables, but the results
    have double
    quotes which is killing my forms. Any suggestions? Is there a
    range the
    seed needs to be in to not produce double quotes.
    Thanks,
    Jeff

    Experiment with a different key.

  • 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                                                                                                                                                                                                                                                               

Maybe you are looking for

  • RE:(URGENT)WebDynpro For Java

    hi all, I have done an application in webdynpro for java that i.e accesing a java Bean by creating a model. In my model i have taken three variables i.e a,b,c after that i have exported the jar file of that bean...and i have created model in my webdy

  • Undefined symbol error when calling stat from extproc

    Hi, I'm trying to call an external procedure written in C that calls stat, and am getting the following error. Note that we have other extprocs running, and we are on Oracle 8.1.7 on redhat 6.2... SQL Error: ORA-06520: PL/SQL: Error loading external

  • Managing cookies in Safari 3.1.2

    I am having trouble getting to my cookie information in Safari. I know I am supposed to click on Safari, then preferences and then security but I don't have anything that says security. The only window that comes up when I click on preferences is one

  • Internet Pricing Increase

    Kind of misleading. If a promotion is for $19, $29, or whatever for a year, that is what the customer is expecting to pay for a year regardless if the internet rates go up.

  • Rationale for transparent_hugepage support being enabled by default?

    So, my machine has always seemed to be a bit less responsive that it should be for the beefy 16G RAM, SSD, i7 quad core machine that is, but I could never really pinpoint why it was slow. Chrome/Chromium would always consume CPU and sometimes lead to