Re: Oracle qouting ?

Re: Oracle qouting ?

am 08.11.2005 09:36:46 von Martin.Hall

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
>[mailto: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.
>
>
>