FAQ
Sorry for being "off topic" on this one, it's not DBI specific but I'd
rather not subscribe to an Oracle list for what will probably be a simple
answer. I have the following insert statement:

INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daem
on','err','modprobe: modprobe: Can\'t locate module
char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')

If I do:

# The above insert statement is the only thing in INSERT.sql and it is
formatted exactly like that
Oracle$ sqlplus < /spoodir/tmp/INSERT.sql

I get this output:
===================
SQL*Plus: Release 10.1.0.3.0 - Production on Mon Nov 7 11:09:43 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> 2 Disconnected from Oracle Database 10g Enterprise Edition Release
10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
===================
And nothing inserted into the database. If I knew what to google for I would
do that but at present I'm at a loss...

Search Discussions

  • Reidy, Ron at Nov 7, 2005 at 6:30 pm
    You are missing a ';' or a '/' character at the end of your statement.
    My guess here is that you cannot escape a "'" character as you are
    trying to do. Try enclosing that specific field in double quotes.

    --
    Ron Reidy
    Lead DBA
    Array BioPharma, Inc.

    -----Original Message-----
    From: Ward.P.Fontenot@wellsfargo.com

    Sent: Monday, November 07, 2005 11:16 AM
    To: dbi-users@perl.org
    Subject: Oracle qouting ?


    Sorry for being "off topic" on this one, it's not DBI specific but I'd
    rather not subscribe to an Oracle list for what will probably be a
    simple answer. I have the following insert statement:

    INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
    VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daem
    on','err','modprobe: modprobe: Can\'t locate module
    char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')

    If I do:

    # The above insert statement is the only thing in INSERT.sql and it is
    formatted exactly like that Oracle$ sqlplus < /spoodir/tmp/INSERT.sql

    I get this output:
    ===================
    SQL*Plus: Release 10.1.0.3.0 - Production on Mon Nov 7 11:09:43 2005

    Copyright (c) 1982, 2004, Oracle. All rights reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL> 2 Disconnected from Oracle Database 10g Enterprise Edition
    SQL> Release
    10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options ===================
    And nothing inserted into the database. If I knew what to google for I
    would do that but at present I'm at a loss...

    This electronic message transmission is a PRIVATE communication which contains
    information which may be confidential or privileged. The information is intended
    to be for the use of the individual or entity named above. If you are not the
    intended recipient, please be aware that any disclosure, copying, distribution
    or use of the contents of this information is prohibited. Please notify the
    sender of the delivery error by replying to this message, or notify us by
    telephone (877-633-2436, ext. 0), and then delete it from your system.
  • Martin Hall at Nov 8, 2005 at 8:37 am
    I usually use an additional single quote when I'm attempting to insert a
    single quote. E.g. 'don''t'. Alternatively, if it gets too difficult
    to read, I concatenate the appropriate ascii code (39).

    SQL> select 'don''t' from dual;

    'DON'
    -----
    don't

    SQL> select 'don'||chr(39)||'t' from dual;

    'DON'
    -----
    don't

    Martin
    Reidy, Ron wrote:
    You are missing a ';' or a '/' character at the end of your statement.
    My guess here is that you cannot escape a "'" character as you are
    trying to do. Try enclosing that specific field in double quotes.

    --
    Ron Reidy
    Lead DBA
    Array BioPharma, Inc.

    -----Original Message-----
    From: Ward.P.Fontenot@wellsfargo.com

    Sent: Monday, November 07, 2005 11:16 AM
    To: dbi-users@perl.org
    Subject: Oracle qouting ?


    Sorry for being "off topic" on this one, it's not DBI specific but I'd
    rather not subscribe to an Oracle list for what will probably be a
    simple answer. I have the following insert statement:

    INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
    VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daem
    on','err','modprobe: modprobe: Can\'t locate module
    char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')

    If I do:

    # The above insert statement is the only thing in INSERT.sql and it is
    formatted exactly like that Oracle$ sqlplus < /spoodir/tmp/INSERT.sql

    I get this output:
    ===================
    SQL*Plus: Release 10.1.0.3.0 - Production on Mon Nov 7 11:09:43 2005

    Copyright (c) 1982, 2004, Oracle. All rights reserved.


    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL> 2 Disconnected from Oracle Database 10g Enterprise Edition
    SQL> Release
    10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options ===================
    And nothing inserted into the database. If I knew what to google for I
    would do that but at present I'm at a loss...

    This electronic message transmission is a PRIVATE communication which contains
    information which may be confidential or privileged. The information is intended
    to be for the use of the individual or entity named above. If you are not the
    intended recipient, please be aware that any disclosure, copying, distribution
    or use of the contents of this information is prohibited. Please notify the
    sender of the delivery error by replying to this message, or notify us by
    telephone (877-633-2436, ext. 0), and then delete it from your system.

  • Ronald J Kimball at Nov 7, 2005 at 6:35 pm

    Ward.P.Fontenot@wellsfargo.com wrote:

    Sorry for being "off topic" on this one, it's not DBI specific but I'd
    rather not subscribe to an Oracle list for what will probably be a simple
    answer. I have the following insert statement:

    INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
    VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daem
    on','err','modprobe: modprobe: Can\'t locate module
    char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')
    In SQL (for Oracle, anyway), you escape a single quote with a single quote,
    not a backslash:

    INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
    VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daemon',
    'err','modprobe: modprobe: Can''t locate module
    char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')


    Ronald
  • Rutherdale, Will at Nov 7, 2005 at 7:14 pm
    Perhaps this was too obvious a point for others to bother mentioning, but
    there *is* a related DBI specific connection to your problem.

    If you choose to use DBI, you can make use of the $dbh->quote() method,
    which will transparently implement the correct quoting algorithm for your
    particular DBD (Oracle, in your case).

    Furthermore you can go a step further and avoid quotes by using bind values.
    Your DBI documentation explains how.

    -Will


    -----Original Message-----
    From: Ward.P.Fontenot@wellsfargo.com

    Sent: Monday 07 November 2005 13:16
    To: dbi-users@perl.org
    Subject: Oracle qouting ?


    Sorry for being "off topic" on this one, it's not DBI specific but I'd
    rather not subscribe to an Oracle list for what will probably be a simple
    answer. I have the following insert statement:

    INSERT INTO message(FULLDATE,HOSTNAME,FACILITY,PRIORITY,MESSAGE,SHA1)
    VALUES('2005-Oct-21 12:10:49','pkitest.wellsfargo.com','daem
    on','err','modprobe: modprobe: Can\'t locate module
    char-major-10-134','2aAdPM/NYOiPlatwJ1kps9C8iQE=')



    - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
    This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedNov 7, '05 at 6:16p
activeNov 8, '05 at 8:37a
posts5
users5
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase