How to transfer a string with \' and \" to an Oracle table?

An MS Access column contains characters such like \' and \". How to transfer this column to an Oracle table? Thank you.
sqlCommand="insert into jobposition values (\'"+rsSrc.getString(1)+"\')";

Sure, as a Java programmer, I undertand
(1) All of \\, \' and \" are single characters,
but here you have to understant
(2) I'm making a SQL command (not a java statement!) with ' or " (not \) !!!
Please pay attention, I don't need \, I need ' ONLY!
So, the following sqlCommand can be run properly.
aString="programmer bad boss";
sqlCommand="insert into mytable values (\'"+aString+"\')";
But, the following sqlCommand can NOT be run properly?
aString="programmer\'s \"bad\" boss"; // programer's "bad" boss
sqlCommand="insert into mytable values (\'"+aString+"\')";
DO NOT tell me you want to modify them like this:
aString="programmer\'s \"bad\" boss"; // programer's "bad" boss
sqlCommand="insert into mytable values (\\'"+aString+"\\')";
PLEASE!
(If so, you can't get a correct SQL command!
Note: an incorrect SQL command is shown as following:
insert into mytable values (\'programmer\')
The \\ will give you a single \ in your String.
The \ is an escape character so in a String you must
double them.

Similar Messages

  • How to insert a string with \' and \" into an Oracle table?

    I'm transferring an MS Access column contains characters such like \' and \" to an Oracle table.
    The following statement can work PROPERLY while rsSrc.getString(1) does NOT contain \' and \".
    But when \' or \" occurs in rsSrc.getString(1), a SQLException was caught as "ORA-00917: missing comma".
    sqlCommand="insert into myTable values (\'"+rsSrc.getString(1)+"\')";
    How to solve this problem? Thank you.

    Thank you, San.
    Original statement is right...
    sqlCommand="insert into myTable values (\'"+rsSrc.getString(1)+"\')";
    Your statement will not work properly when rsSrc.getString(1) contains " or '.
    sqlCommand="insert into myTable values ('"+rsSrc.getString(1)+"')";
    The best solution should be preparedStatement. Please see another topic with the same topic name.
    Thank you, San, again.
    Hi,
    Original ...
    sqlCommand="insert into myTable values
    (\'"+rsSrc.getString(1)+"\')";
    change it to ...
    sqlCommand="insert into myTable values
    ('"+rsSrc.getString(1)+"')";
    Pls dont add \
    good luck !
    :-) san

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • How to create a String with a specific size?

    how to create a String with a specific size?
    For example I want to create different Strings with the size of 100 , 1000 or 63k byte?

    String are immutable so just initialize it with the number of characters you want.
    You might want to look at java.lang.StringBuffer and see if that's what you want.

  • How to transfer own -done with the iPad- movies from iPad to PC ?

    How to transfer own -done with the iPad- movies from iPad to PC ?
    The fotos are possible to transfer, but not the movies

    Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support

  • How to transfer a string from sub sequence to main sequence

    Hi,
    How to transfer a string from sub sequence to main sequence, My main sequence has included a sub sequence, the sub sequence is return a string value after running done, I need to get this string value from sub sequence to main sequence, I check the defined that look like seem the two
    sequence have themself local variable,but I don't know how to defined a globe variable to cover main sequence and sub sequence like VC++'s Main App ,Please kindly help me,thanks in advance...

    Hi,
    I hope this small example will help you.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏36 KB

  • I am going to buy a Mac desktop and want to know how to transfer all my purchases and uploaded music from my PC. How can I do this to ensure all videos and music transfer over and not just purchases?

    I am going to buy a Mac desktop and want to know how to transfer all my purchases and uploaded music from my PC. I originally started using iTunes on my PC so it has everything I have ever purchased or uploaded from my own collection of music.
    How can I do this to ensure all videos and music transfer over and not just purchases? Do they do it at the Apple Store or at Best Buy? help!

    Move iTunes Library from PC to MAC
    http://www.macworld.com/article/146958/2010/03/move_itunes_windows_mac.html
    Also, See here if you need to...  iTunes to an External Drive
    http://support.apple.com/kb/HT1751

  • I bought a used iphone 4 today. how to transfer all my old and important data including apps and email settings from old iphone 3gs to the used iphone 4?

    i bought a used iphone 4 today. how to transfer all my old and important data including apps and email settings from old iphone 3gs to the used iphone 4? that means, making the iphone 4 just like the iphone 3gs?

    Well, you sink everything on your 3GS onto your laptop/computer. Then you reset your iPhone 4. When you are restarting it, add all those apps music (ect)  On to it. It seems difucult but for more info call Apple. I did that and he lead me step by step on how to do it. Well hope this helped~~

  • How to transfer or copy video and movie onto iphone 4s? through itune cant.

    how to transfer or copy video and movie onto iphone 4s? through itune cant. I tried.

    See this Discussion...
    https://discussions.apple.com/message/17442206#17442206

  • How to concatenate a string with single quotes

    Hi all,
        how to concatenate a string with single quotes to a variable.
    Sathya

    Hi sathyabama,
    1. simple
    2. use TILDE character <b>(`)</b>
       (just left to the '1' key)
    <b> `'mystring'`</b>
    3. just copy paste
    report abc.
    data : m(100) type c.
    concatenate `'amit mittal'` 'hello' into m separated  by space.
    write m.
    regards,
    amit m.

  • How to print a string with out using main method??

    how to print a string with out using main method??
    if we can tell me with example?
    thanks in adavance
    raja

    Hi,
    actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
    If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
    Regards
    Dirk

  • How to transfer books between ipad and pc

    How to transfer books between ipad and the windows pc using iBooks.
    REGARDS
    Nadunbat.

    make sure the pc has the most current version of i tunes for windows, then simply sync your pad.  If it asks, upload purchases.  They will be there when you need them.

  • How to execute a string formula and assign the result to a number field

    How to execute a string formula and assign the result to a number field
    Hi,
    we have a function that returns a string like this:
    '(45+22)*78/23'
    After we should calculate this string and assign the value to a numeric block field
    Example:
    k number(16,3);
    k:=fun1('(45+22)*78/23'); where fun1 execute and translate to number the string.
    Does exist a function like fun1 ??
    How can we do ?
    Regards

    Hello,
    this is the code that does the job:
    SQL> set serveroutput on
    SQL> DECLARE
    2 ch VARCHAR2(20) :='22+10' ;
    3 i NUMBER ;
    4 BEGIN
    5 EXECUTE IMMEDIATE 'select ' || ch || ' from dual' INTO i;
    6 dbms_output.put_line ('i = ' || TO_CHAR(i));
    7 END ;
    8 /
    i = 32
    Procédure PL/SQL terminée avec succès.
    SQL>
    just you have to do is to create a small stored function that take the string to calculate and return the number result
    Francois

  • HT204291 how to transfer files between 5C and ipad

    how to transfer files between 5C and ipad data

    iCloud: http://www.apple.com/icloud/features/
    or using a computer, iTunes: http://support.apple.com/kb/ht1296

  • How to Transfer Contacts between Android and iPhone

    My new iPhone need all contatcs from my Samsung phone.How to Transfer Contacts between Android and iPhone?This is so important.I am wait you reply.

    Moving Android to iPhone:
    http://support.apple.com/kb/HT6407?viewlocale=en_US&locale=en_US
    Transfer Contacts from Android to iPhone 5

Maybe you are looking for

  • Help: How to create a query like this?

    I am working on a report and I am facing on a question like this: TABLE TEST has two columns A and B A B 2 INFO21 2 INFO22 3 INFO31 3 INFO32 3 INFO33 I'd like to create a query which will return A INFO 2 INFO21, INFO22 3 INFO31, INFO32, INFO33 Please

  • 17" MacBook Pro Core i5 Boot Camp Nvidia 64 bit driver install issue

    Can't get correct Nvidia driver to install on 17" MacBook Pro core i5. Windows 7 64 bit is installed and running but its using a standard VGA driver for the video card so the full resolution of the display is unatainable. I've loaded the snow leopard

  • Java for PI 7.1 EHP1 in Windows and SQL Server 2008

    Hi Gurus I try to install PI 7.1 EHP1 in Windows and SQL Server 2008. The questions is : What version of java is the correct for this installation??? And where i can download it?? Thanks and advance!!!

  • Site Redesign Production Tips

    A new version of one my sites is being developed in a subfolder of my webserver. The old site layout had image folders under a folder for each section. The new site will use a central images folder - paths will have to be changed by hand. How can Dre

  • What is apple Bluetooth USB host controller?

    I want to know functinalty of apple bluetooth usb host controller. What exactly it does ?