Insert string containing '&'

How to insert string containing '&' into a table
INSERT INTO TBL_CHANGES_ORGANISATIES(CHANGE_MANAGEMENT_ID, SUBMITTER) VALUES ('HM0000002147848|TK0000003121328','CS CSU S\&B Change Management')

if you're in sqlplus:
put set define offprior to running your insert.
if you're in Toad, either:
put set define offbefore your insert statement, and run both in as a script
OR
right mouseclick on the editor and untick the "Prompt for substitution variables", and you need never worry about the & again!

Similar Messages

  • Inserting strings over 2000 in length

    Hi,
    I'm trying to populate a database table which contains a long and
    I've been running into two Oracle errors:
    ORA-01462: cannot insert string literals longer than 2000
    characters
    and
    ORA-01489: result of string concatenation is too long
    Can someone point me to documentation or a solution of how you
    can get a 29k string into the database? I have code regarding how
    to use LOBs, but I'm unfamiliar with any stored procedures which
    will allow you to append to a long column with new content. I
    need to use long for the project I am working on.
    Thanks in advance for your help!
    Jill
    null

    Hi Ralf,
    If you read the documentation on
    http://java.sun.com/products/jdbc/index.html you will
    find a statement saying that the JdbcOdbcDriver is
    only for test and experimental use.Yes, but my and other's experiences with the JDBC-ODBC bridge itself are very well.
    Since it is only a bridge over the specific vendor's ODBC driver, you are limited to the capabilities of that.
    But the bridge is not to blame for this.
    For MS products you may reach efforts by updating to an actual MDAC version.
    Nethertheless, with MS ODBC there are some problems.
    Search the driver database (a link is on the above web
    page) for another (commercial) driver. I recommend the
    type 4 driver from i-net.Ok.
    Have you tried out that error David reported with the i-net driver?
    I use JDBC-ODBC with MS SQLServer 2000, actual MDAC, and I get that error with PreparedStatement.
    But it's all ok with a normal statement.
    So if you could test them both with the i-net driver, we would see if it's again the MS ODBC driver.
    Regards,
    Ralf SchumacherI think, I'm not the first you asks this:
    you are not the quick one we saw in Suzuka on Sunday, are you?

  • Inserting strings of printable and non printable characters

    I would very much appreciate some help with the following
    To handle an interface with a legacy system I need to create strings containing both printable and non-printabel ascii characters. And with non printable characters I mean in particular those in the range of ASCII 128 to 159.
    It seems it is not possible to insert a string containting both printable and not printable characters from the afore mentioned range into a VARCHAR2 table column as the following demonstrates:
    insert into test values(chr(156)); -- this inserts the 'œ' symbol.
    SQL> select test, ascii(test), length(test), substr(test,1,1), ascii(substr(test,1,1))from test;
    TEST       ASCII(TEST) LENGTH(TEST) SUBSTR(TEST,1,1) ASCII(SUBSTR(TEST,1,1))
    ┐                  156            1That the the character mapped is shown as '┐' and not 'œ' is not really issue for my application, what is important is that the ASCII value is shown as 156, which is the ASCII code of the character I inserted.
    What is however strange (actually probably not strange but has to do with the lack of understanding of the issue at hand) is that substr returns an empty string...
    Now I try to insert a concatenated string, first the "non printable" character then a printable character
    insert into test values(chr(156)||chr(65));
    SQL> select test, ascii(test), length(test), substr(test,1,1), ascii(substr(test,1,1))from test;
    TEST       ASCII(TEST) LENGTH(TEST) SUBSTR(TEST,1,1) ASCII(SUBSTR(TEST,1,1))
    A                   65            1 A                                     65For some reason the not printable character (chr(156)) is now not inserted or at least does not appear when I selected the data from the table, this effect seems to apply to all characters in the range of ASCII 128 to 159 (tried some but not all) However for instance CHR(13) can be inserted as part of a string as shown above .
    For our application I really don't care much what character is shown or not show, what is important is that I can retrieve the ASCII value and that this value matches the one I inserted which for some reason does not seem to work.
    This seems to be, at least to some extent a character set issue. I have also tested this on a database with character sets set as follows
    NLS_CHARACTERSET
    WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    With WE8MSWIN1252 the described issue does NOT occur, however unfortunately I must use NLS_CHARACTERSET AL32UTF8 which produces the results as described above!
    As said any insights would be much appreciated as I am slowly but surely starting to despair.
    For completions sake, character sets are set as follows (changing it is NOT an option):
    NLS_CHARACTERSET
    AL32UTF8
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    The test table is created as follows
    CREATE TABLE TEST
    TEST VARCHAR2(1000 BYTE)
    Database Version 11.2.0.3.0
    Edited by: helios.taraba on Dec 2, 2012 10:18 AM --Added database version
    Edited by: helios.taraba on Dec 2, 2012 10:24 AM Added description of test results using NLS_CHARACTERSET WE8MSWIN1252

    Hello Orafad,
    Thanks for your reply, at least I understand the effects I'm seeing i.e.
    +"For multibyte character sets, n must resolve to one entire code point. Invalid code points are not validated, and the result of specifying invalid code points is indeterminate."+
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions026.htm
    You are absolutely right I could use chr(50579) to get the ligature symbol. However as what we are trying to achieve is to implement a legacy interface to a 20+ years old subsystem we are actually not so much interested in the symbol itself but rather in the ascii value of that symbol (156 as you so rightly point out in the win-1252 characterset), this particular field represents the lenght of the message being sent to the subsystem and can vary from decimal 68 to 164 and is also considered in a checksum calculation which is part of the message.
    As changing the nls_characterset of the database is not an option I guess I only have one reasonable avenue to resolve this namely to push the functionality to added the "encoded" length of the message (and the calculation of the checksum) to the java driver which is responsible for sending the message (tcp/ip) to the subsystem. Here we should not have any issues adding a byte with the value 156 (or any other for that matter) to the datastream.
    Thankfully all other fields have characters with ascii values below 128 and above 31.
    I'm going to leave my question as un-answered for a bit longer in the hopes of someone coming up with a golden bullet, although not getting my hopes up.
    Thanks, Helios

  • Inserting strings in a database

    Hello all!
    I am trying to insert string values in a database with this metode.
        public void insertData(){
       try{
    String url = "jdbc:odbc":"+database;
    Connection connection = DriverManager.getConnection(url, user, password);
    Statement status = connection.createStatement();
    status.executeUpdate("INSERT INTO radiograhy (Title, Red, Green, Blue,"
    + "Hue,Saturation,Value,Color,Path,IdRadiography,Description) VALUES "
    +"("+Title+","+Red+","+ Green+","+ Blue +","
    + Hue+","+Saturation+","+Value+","+Color+","+Path+","
    +IdRadiography+","+Description+")");
    }catch(SQLException e){
    e.printStackTrace();
    System.out.println(e);
    but the metode throws me an exception :
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

    This has actually nothing to do with JDBC, but with basic SQL knowledge.
    Print the complete query using System.out.println and try to find out what's wrong with it. Play with it, execute it right on the DB, etcetera. If you don't understand it, then don't bother to read some SQL tutorials how to write clean SQL.
    Once you understand SQL, I would also recommend you to use PreparedStatement instead.

  • How to find out whether the String contains chinese characters

    I need to check if the string contains chinese characters in Java. Does anyone know how to do it? thx.

    Since Java strings contain UNICODE code points, check the content against the relevant page here - http://www.unicode.org/charts/ .

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

  • How to parse a string containing xml data

    Hi,
    Is it possible to parse a string containing xml data into a array list?
    my string contains xml data as <blood_group>
         <choice id ='1' value='A +ve'/>
         <choice id ='2' value='B +ve'/>
             <choice id ='3' value='O +ve'/>
    </blood_group>how can i get "value" into array list?

    There are lot of Java XML parsing API's available, e.g. JAXP, DOM4J, JXPath, etc.
    Of course you can also write it yourself. Look which methods the String API offers you, e.g. substring and *indexOf.                                                                                                                                                                                                                                                                                                                                                                                                               

  • Best way to split a single string containing 2 words into word1 and word2

    Whats the best way to take a string containing 2 words and split it into 2 strings ?
    eg. "red ferrari"
    string1 "red"
    string2 "ferrari"

    If your list is always going to have exactly two words, then yes.  Otherwise it depends on your requierments.

  • Problem in Inserting string in mysql databse

    Hi all,
    I am trying to insert string in mysql using java query.As I have taken field varchar,that should be in single quotes,whereas string is having double quotes...so as I am trying to insert data that gives null value all the time.
    I did like:
    String name=jTextFieldname.getText();
    String sql="insert into record_master values (name,orderno,email,dob,address,mobile)";Any pointers are appreciable.
    Regards,
    Palak

    Oh I got the sollution...Tat was something like:
    String sql = "INSERT INTO record_master (name, orderno,email,dob,address,mobile,imeino) " +
    "VALUES('" + name + "', '" + orderno + "','" + email + "','" + dob +"','" + address +"','" + mobile + "','" + imei + "')";
    Regards,
    Palak

  • Execute a string containing a PL/SQL block

    Hi,
    I would like to build a string containing a PL/SQL block and execute it dynamically. Is there way to do this.
    Note - The reason I want to this is because, based on certain table data dictionary views the declaration section of the PL/SQL block that I am building might vary
    I tried to use EXECUTE IMMEDIATE, it didn't work, pls let me know if I am missing something.
    DECLARE
    v_str VARCHAR2(1000);
    BEGIN
    v_str := 'BEGIN NULL; END';
    EXECUTE IMMEDIATE v_str;
    END;
    /

    Hi,
    Just happened to find it. EXECUTE IMMEDIATE can be used, the bug with my code was I didn't have a ; after the END statement. Corrected code is below, thanks for your time
    DECLARE
    v_str VARCHAR2(1000);
    BEGIN
    v_str := 'BEGIN NULL; END;';
    EXECUTE IMMEDIATE v_str;
    END;
    /

  • When i insert string text in hebrew i see ?????????

    hi
    when i insert string text in hebrew i see ????????? how to fix it ?
    i work on:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    Oracle Developer ver. 2.1.1.64
    thanks

    i try this, but still same problem :(
    my Settings:
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     IW8MSWIN1255
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION     11.2.0.1.0

  • Quick string question finding if a string contains a character

    hello peeps
    is there a quick way of checking if a string contains a specific character
    e.g.
    myString="test:test";
    myString.contains(":");
    would be true
    any ideas on a quick way of doing it

    is there a contains() method in 1.4.2? i couldnt see
    it in the docsNo there isn't. But the 1.5 has a contains(CharSequence s) method.

  • Is it possible to search for strings containing spaces and special characters?

    In our RoboHelp project, there are figures with text labels such as Figure 1, Figure 3-2, etc.
    When I search for "Figure 3" I get all pages containing "Figure" and "3", even if I surround it in quotes.  Similarly, searching for "3-2" treats the '-' character as a space and searches for all pages containing '3' or '2'.
    Is there a way to search for strings containing spaces and special characters?

    In that case I think the answer is no if you are using the standard search engine. However I believe that Zoom Search does allow this type of searching. Check out this link for further information.
    http://www.grainge.org/pages/authoring/zoomsearch/zoomsearch.htm
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • How to do string contains in drools.

    hi everyone
    i'm using drools for a project and have come to a problem. in two of my rules i need to check if a string contains some characters but can't seem to do get the rules to be excepted. if anyone could help me i would be very grateful.
    thanks in advance
    mike

    Display the rules.

  • Evalutate a string containing a numeric expression

    I need a function which would evaluate a string containing numbers and operators like "1+1" and return 2. The function should take into account precedence and all arithmetic and logical operators
    Thanks
    Mita

    Why don't you use the JDK compiler APIs (com.sun.javac.Main class) to compile on the fly a class implementing this interface:
    public interface Evaluator {
    public double evaluate() {
    return xxx;
    where xxx is your expression?
    Obviously, you build this class' source at runtime when you get the expression as input, and after you compile it you load it with Class.ForName(), instanciate it with newIstance() and the call the "evaluate" method.
    The advantage of this approach is that you can use "automagically" every expression available in java language. And with some extra effort of text-processing, even the Math functions!!!
    Giorgio Maone

Maybe you are looking for

  • Quick question about an exception problem

    Hi all, I'm doing a homework problem with exceptions and there is an outline I have to fill in with some exception handling. There are 2 parts of the problem I'm not sure about that deal with checked and unchecked exceptions and passing exceptions to

  • Plz help!!! USB driver cannot be detected in XP

    i followed the step to install XP and setup with the Mac driver disc in xp, all the hardware was successfully be detected (blue tooth, display, wireless) but one of the USB driver are not, i don't what is this,plz help!

  • Zoom/enlarge

    Sorry I have had so many questions.  Hopefully, this is my last one.  I have a few images that I want to zoom in on or enlarge.  (example: a far away shot that I would prefer to have as a close up)  Is there a way to do that? Thank you so much for yo

  • Validating PDF forms in QTP

    Hi Guys, I have an issue and I was wondering wether you can help me you with this. I am trying to use QTP with ADTT plug-in to test a pdf form. Recording is fine. However, when the script is played back Validation fails (after validate button is pres

  • Oracle Import and Export Utility

    Hello All, Could someone please explain me Oracle Import and Export Utility. I've gone through the below link and it has been mentioned to use keyword 'exp' but I'm not getting any idea where to use it. So kindly explain how the util works.