How can i insert values with single quote (')

How can i insert a values like ABC's ?
Edited by: LuKKa on Oct 6, 2010 12:48 PM

LuKKa wrote:
I want to insert like this :-
INSERT INTO myTab values ('This is belong's to ABC's ');
Then how can i do ?In a old style you can do this
insert into mytab valeus('This is belong''s to ABC''s');

Similar Messages

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • 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 handle XML string with Single Quotes as a parameter to SP dynamically?

    Hi,
    I would like to know if there is a way to handle the Single Quotes in XML value when it is passed to Stored Procedure?
    I should be able to handle it without adding another Single Quote to it.
    Thanks,
    Chandra Shekar

    Hi Chandra,
    Your requirement is not precise. Based on my understanding and guessing, are you metioning something like the below sample?
    /*If the xml is generated you have no need to escape the singe quote(')*/
    DECLARE @xmlTbl TABLE (ID INT,name VARCHAR(99));
    INSERT INTO @xmlTbl VALUES(1,'Eric''s')
    INSERT INTO @xmlTbl VALUES(2,'Zhang''s')
    DECLARE @xmlDoc1 XML
    SELECT @xmlDoc1
    FROM @xmlTbl FOR XML PATH('PERSON'),ROOT('PERSONS')
    EXEC yourProcedure @xmlDoc1
    /*If your copy and paste the xml, you have to escape the single quote(') with 2s('')*/
    DECLARE @xmlDoc2 XML
    SET @xmlDoc2 = '<PERSONS>
    <PERSON>
    <ID>1</ID>
    <name>Eric''s</name>
    </PERSON>
    <PERSON>
    <ID>2</ID>
    <name>Zhang''s</name>
    </PERSON>
    </PERSONS>'
    EXEC yourProcedure @xmlDoc2
    If that is not regarding your requirement, please elaborate with more details.
    Eric Zhang
    TechNet Community Support

  • How can create registry value with GPO OR script

    Hi Friends
    I have around 45 registry entries in .REG file.. in HKLM and KHCU path as give below as example
    How can i create these registry entries through logon file with GPO or script..
    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\DT Research]
    [HKEY_CURRENT_USER\Software\DT Research\BtnManagement]
    @=""
    [HKEY_CURRENT_USER\Software\DT Research\BtnManagement\BtnFunc1]
    [HKEY_CURRENT_USER\Software\DT Research\BtnManagement\BtnFunc1\Button0]
    "strDescription"="Brightness"
    "iFunction"=dword:80010005
    "strAppPath"="DtrBrightness.exe"
    "strAppParameter"=""
    "vkcode"=dword:00000001
    "repeat"=dword:00000000
    [HKEY_CURRENT_USER\Software\DT Research\BtnManagement\BtnFunc1\Button1]
    "strDescription"="Brightness"
    "iFunction"=dword:80010005
    "strAppPath"="DtrBrightness.exe"
    "strAppParameter"=""
    "vkcode"=dword:00000002
    "repeat"=dword:00000000

    there are two ways you can achieve this.
    if you are using server 2008 or higher and if your clients are windows xp with latest updates and IE or higher you can use group policy preferences. You would need to configure the settings from your reg key using group policy editor under the preferences
    section. We can provide more detailed instructions for this if you need. 
    alternativley, a simpler option, but maybe less manageable, is to split your reg file into two sections - one for the user and one for the machine. This is required since i am assuming your users are not local admins on their computers - if they are then
    you don't need to split it. 
    once split you would need to create two batch file scripts which from memory you would use reg /s path_to_reg_file.reg 
    you need one computer startup script which applies the settings to the HKLM keys - as you need admin rights to do this, the script in the computer startup will run under the computer account which is privileged.
    you can then create the same batch file but point to your user settings reg file and put this as a user login script. 
    if you need further step by step please let us know. 
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    My Blog
    LinkedIn:

  • How to deal with single quote (') in a field value?

    I can successfully insert value with single quoet using
    Prepared statement with placeholder(?) construct .
    I can also successfuly use value with single quote(') in
    WHERE clause.
    My question is, is there a way to use string with single
    quote if a Statement like:
    String slqString ="INSERT INTO customers (name, address) VALUES ( 'O'Reilly Bob', 'St Mary's Street') ";
    Statement sqlStmt = con.createStatement();
    sqlStmt.executeUpdate(sqlString);
    The last statement will thow an SQLException because due to single quotes
    Any ideas?

    I think the question was regarding the ' in O'Reily. Use ' twice when using the Statement interface, i.e.
    ("O''Reilly Bob", "St Mary''s Street")
    So that's two single quotes, not a double quote, to successfully insert a single quote, if you know what I mean....
    But like you said PreparedStatement does things like this for you.

  • Importing excel files - problem with single quote

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

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

  • Insert value with quotes into the table

    Hi,
    How can I insert a value along with quotes into a table column of type varchar.
    Meaning..I want to insert the value 'TEST' including the single quotes.
    Regards,
    Murali Mohan

    It only a matter of using the correct number of quotes. to insert 'TEST' you use 3 quotes on each end
    example: '''TEST'''
    Hi,
    How can I insert a value along with quotes into a table column of type varchar.
    Meaning..I want to insert the value 'TEST' including the single quotes.
    Regards,
    Murali Mohan

  • How can i insert the variable value in MS ACCES Query

    i am creating one Query (query1) in MS ACCESS ( like we creaate Tables, Forms and Reports in MS ACCESS ) in this Query i have given 2 constent value in BETWEEN CLAUSE , after that i Created a CROSS QUERY which is based on the privious Query (query1).
    Now i want to insert the variable value using JSP and HTML in to Query(query1).
    Doing this i want to execute the Query (query1) with variable perameters and
    wants to get the risponce form CROSS QUERY.
    In this matter how can i insert the value in Query(query1) using JDBC and JSP.

    The query is
    Select ZMSGMAP.GROUP_CODE as 'group', ZMSDSTATE.STATE_DESC as 'state', ZMSTRN.YRMON, sum(ZMSTRN.CMAQTY) as 'qty' from ZMSDSTATE,ZMSGMAP,ZMSTRN Where ZMSTRN.STATE=ZMSDSTATE.STATE and ZMSTRN.PLANT=ZMSGMAP.PLANT_CODE and ZMSTRN.YRMON between "+p1+" and "+p2+" Group by ZMDGMAP.GROUP_CODE, ZMSDSTATE.STSTE_DESC, ZMSTRN.YRMONUsing this query i m trying to display the risult but the YRMON is displaying in a single column, i want to display it ia seperat columns. here p1 and p2 is YRMON(it is the yer month like 200102), for this solution i have created Cross table Query which is based on uper Query (query1) and design it column wise Display, it is givng the right display, but the problem is this i m not getting the technique throw which i can insert the variable values in to the query1 (which is designed in MS ACCESS).
    u can contact me on [email protected] for more details.

  • How can i insert pseudocolumn (sequencename.nextval) with oracleXmlSave?

    how can i insert pseudocolumn value (sequencename.nextval) with oracleXmlSave.insertXml(xmlfile)?
    if anyone know it, pls post the answer to the bbs or reply me: [email protected]
    thank u so much.

    You can create a trigger on the table and insert your sequence no from there or create a updateable view and create insted off trigger to populate your columns. I am new to XML, but I think this the way you can do it esealy. Or may be this the only way.

  • IF_IXML : How can i add encoding with value UTF-8 to the document object??

    Hi
    i want to create a xml file with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    i did this with the if_ixml interface and rendered the content in a file 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml
    <?xml version="1.0"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    BUT the document attribut(?) encoding="UTF-8"?> is missing!
    How can i add encoding with value UTF-8 to the document object?? it should look like:
    <?xml version="1.0" encoding="UTF-8"?>
    *here is my coding.
    TYPE-POOLS: ixml.
    CLASS cl_ixml DEFINITION LOAD.
    DATA: lo_ixml           TYPE REF TO if_ixml,
          lo_streamfactory  TYPE REF TO if_ixml_stream_factory,
          lo_document       TYPE REF TO if_ixml_document,
          lo_parent         TYPE REF TO if_ixml_element,
          lo_ostream        TYPE REF TO if_ixml_ostream,
          lo_renderer       TYPE REF TO if_ixml_renderer,
         lv_rc           TYPE i.
    lo_ixml = cl_ixml=>create( ).
    lo_streamfactory = lo_ixml->create_stream_factory( ).
    lo_document = lo_ixml->create_document( ).
    lo_parent = lo_document->create_simple_element( name   = 'OpenSearchDescription'  "root node
                                                    parent = lo_document ).
    lo_parent->set_attribute_ns( name   =  'xmlns'
                                 value  = 'http://....' ).
    *rausrendern in file
    lo_ostream = lo_streamfactory->create_ostream_uri( system_id = 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml' ).
    lo_renderer = lo_ixml->create_renderer( ostream  = lo_ostream
                                            document = lo_document ).
    lv_rc = lo_renderer->render( ).
    Thanks for help
    Britta

    Use the following code:
    set an document encoding
      l_encoding = l_ixml->create_encoding( character_set = 'UTF-8'
                                            byte_order = if_ixml_encoding=>co_none ).
      l_success  = l_ostream->set_encoding( encoding = l_encoding ).
    create a xml renderer
      l_renderer = l_ixml->create_renderer( document = l_doc ostream  = l_ostream ).

  • How can I insert a a chart made with Numbers, into a Pages document?

    Hallo. How can I insert a document of "pages" made a chart with "numbers"?

    Open the numbers file, select the chart, tap copy. Opne the Pages document, tap and hold for the menu, tap paste.

  • How can I shere office with my wife in a single Mac computer?

    How can I share office with my wife in a single Mac computer?

    If you install Office on one account, it should be on the others as well. Office is more of a system wide application more than a user specific one, if that makes sense

  • How can i split a long single video with many different scenes in it ?

    how can i split a long single video with many different scenes in it ? in premiere pro cs3

    Yep better ask in the Premeire Pro forums, but while loading their forum page check the cutter tool (C) it will allow you to cut your footage

  • Dynamic SQL and Data with Single Quotes in it.

    Hi There,
    I have a problem in that I am using dynamic SQL and it happens that one of the columns does contain single quotes (') in it as part of the data. This causes the resultant dynamic SQL to get confused as the single quote that is part of the data is taken to mean end of sting, when in fact its part of the data. This leaves out a dangling single quote that was meant to enclose the string. Here is my dynamic SQL and the result of the parsed SQL that I have captured:
    ****Dynamic SQL*****
    l_sql:='select NOTE_TEMPLATE_ID '||
    'FROM TMP_NOTE_TEMPLATE_VALUES '||
    'where TRIM(LEGACY_NOTE_CODE)='''||trim(fp_note_code)||''' '||
    'and TRIM(DISPLAY_VALUE)='''||trim(fp_note_text)||''' ';
    execute immediate l_sql INTO l_note_template_id;
    Because the column DISPLAY_VALUE contains data with single quotes, the resultant SQL is:
    ******PARSED SQL************
    select NOTE_TEMPLATE_ID
    FROM TMP_NOTE_TEMPLATE_VALUES
    where TRIM(LEGACY_NOTE_CODE)='INQ' and TRIM(DISPLAY_VALUE)='Cont'd'
    And the problem lies with the single quote between teh characters t and d in the data field for DISPLAY_ITEM. How can I handle this?
    Many thanks,

    I have been reliably informed that if one doesn't enclose char/varchar2 data items in quotes, the right indices may not be usedI am into oracle for past 4 years and for the first time i am hearing this.
    Your reliable source is just wrong. Bind variables are variables that store your value and which are used in SQL. They are the proper way to use values in your SQL. By default all variables in PL/SQL is bind variable.
    When you can do some thing in just straight SQL just do it. Dynamic SQL does not make any sense to me here.
    Thanks,
    Karthick.

Maybe you are looking for