[prev in list] [next in list] [prev in thread] [next in thread]
List: odtug-sqlplus-l
Subject: RE: New Q ... on "the Q" Quote Operator ...
From: "Justin Cave (DDBC)" <jcave () ddbcinc ! com>
Date: 2010-10-05 2:37:00
Message-ID: 0EED88D7877711468B24315BDD622FB80F7711 () EXCHANGE ! ddbc ! local
[Download RAW message or body]
It should work the same way in SQL
SQL> create table a( col1 varchar2(13) );
Table created.
SQL> ed
Wrote file afiedt.buf
1* insert into a values( q'[Justin's Test]' )
SQL> /
1 row created.
SQL> select * from a;
COL1
-------------
Justin's Test
Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com
-----Original Message-----
From: odtug-sqlplus-l-bounce@fatcity.com [mailto:odtug-sqlplus-l-bounce@fatcity.com] \
On Behalf Of Michelle, Suzanne
Sent: Monday, October 04, 2010 10:22 PM
To: ODTUG-SQLPLUS-L@fatcity.com
Subject: RE: New Q ... on "the Q" Quote Operator ...
Justin, in my case, they DID seem to count against the limit.
You're showing assignment to a variable ... this is Insert into tab_X
(cols ...) values (...) where one of the values is Q delimited, and the
insert statement rejects it. We'll check again.
Suzanne (@ 2Bwy A13.32)
desk: 646-252-8663, cell: 347-907-1125
-----Original Message-----
From: odtug-sqlplus-l-bounce@fatcity.com
[mailto:odtug-sqlplus-l-bounce@fatcity.com] On Behalf Of Justin Cave
(DDBC)
Sent: Monday, October 4, 2010 20:25
To: ODTUG-SQLPLUS-L@fatcity.com
Subject: RE: New Q ... on "the Q" Quote Operator ...
No. The extra characters are not part of the string, so they don't
count against the limit. For example, a VARCHAR2(13) an store the
string "Justin's Test" using the quote operator
SQL> ed
Wrote file afiedt.buf
1 declare
2 a varchar2(13) := q'[Justin's Test]';
3 begin
4 p.l( a );
5 p.l( 'Length = ' || length(a) );
6* end;
SQL> /
Justin's Test
Length = 13
PL/SQL procedure successfully completed.
Justin Cave
Distributed Database Consulting, Inc.
http://www.ddbcinc.com
-----Original Message-----
From: odtug-sqlplus-l-bounce@fatcity.com
[mailto:odtug-sqlplus-l-bounce@fatcity.com] On Behalf Of Michelle,
Suzanne
Sent: Monday, October 04, 2010 5:54 PM
To: ODTUG-SQLPLUS-L@fatcity.com
Subject: New Q ... on "the Q" Quote Operator ...
I understand how the "q'[" yada yada yada "]'" is supposed to work.
However ... if one has a string of text X characters to be entered into
a column Y chars long ...
... and if the "original X" _was_ exactly Y chars long, and thus would
fit in column Y precisely ...
... adding q'[ and then ]' onto that X ... makes it X+5 chars, and thus
too long for Y.
WHICH MEANS ... the whole deal with trying to stuff string X (with
quotes inside it) into Location Y ... is STILL complicated.
Or did I miss something?
Thanks for your time.
Suzanne Michelle
TIS - Applications, UGOS
2 Broadway A13.32
desk: 646-252-8663
cell: 347-907-1125
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic