[cl-rdbms-devel] Fwd: hu, dwim.rdbms + oracle 10g express + utf8 + input/read problem

Attila Lendvai attila.lendvai at gmail.com
Tue Nov 2 13:08:46 UTC 2010


as a first step i'm forwarding this to the list, maybe someone has a
quick idea what's going wrong...

once i have some time, i'll also look into the situation.

- attila


---------- Forwarded message ----------
From: Marshall McLuhan <marshall.mcluhan at gmx.net>
Date: Tue, Nov 2, 2010 at 00:18
Subject: hu,dwim.rdbms + oracle 10g express + utf8 + input/read problem
To: attila.lendvai at gmail.com


Hi

using sbcl + hu.dwim.rdbms.oracle and wanting UTF I have a hard time
getting correct input:

When using slime it crashes and the debugger starts whenever I ask for
character data e.g. (execute [select "SYMTAG_KEY" symtag])
 where column symtag_key is of type varchar2 or nvarchar2. (tried both)

Maybe you have some quick pointers regarding hu.dwim.rdbms, oracle and utf
or should I just avoid the trouble for now and go with ascii?

When starting sbcl from the shell without emacs/slime I get empty
strings like this:
(Well now while in emacs preparing this mail some empty spaces show up
as asian characters others as empty boxes)

* (with-symdb (execute [select "SYMTAG_KEY" symtag]))
23:14 0           RDBMS DEBUG   About to BEGIN transaction in database
#<ORACLE {100434A001}>
23:14 0    &nbs p;      RDBMS DEBUG   Executing "SELECT SYMTAG_KEY FROM symtag"
STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"
STYLE-WARNING: Undefined alien: "OCIGetInstantClientPackageName"
23:14 0           RDBMS DEBUG   Connecting in transaction
#<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}>
23:14 0           RDBMS DEBUG   Logging on in transaction
#<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}>
23:14 0           RDBMS DEBUG   Preparing command: "SELECT SYMTAG_KEY
FROM symtag"
23:14 0           RDBMS DEBUG   Fetching "??????????" from buffer at inde x 0
23:14 0           RDBMS DEBUG   Fetched: "???"
23:14 0           RDBMS DEBUG   Fetching "??????????" from buffer at index 0
23:14 0           RDBMS DEBUG   Fetched: "????????"
23:14 0           RDBMS DEBUG   About to COMMIT transaction
#<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}>
23:14 0           RDBMS DEBUG   Cleaning up Oracle transaction
#<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}> to database #<ORACLE {100434A001}>
23:14 0           RDBMS DEBUG   Calling logoff in transac tion
#<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}>
23:14 0           RDBMS DEBUG   Freeing environment handle of
transaction #<#<STANDARD-CLASS NIL {1004CCC1A1}> :begin-executed-p #t
{1003BFB6F1}>
#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {1003CAF34F}>
* (setq a *)

;     (SETQ SYMARENA-ORACLE::A *)
;
; caught WARNING:
;   undefined variable: A
;
; compilation unit finished
;   Undefined variable:
;     A
;   caught 1 WARNING condition

#<(AND (VECTOR T 8) (NOT SIMPLE-ARRAY)) {1003CAF34F}>
* (elt a 0)

#<(AND (VECTOR T 1) (NOT SIMPLE-ARRAY)) {1003CAF46F}>
* (elt a 1)

#<(AND (VECTOR T 1) (NOT SIMPLE-ARRAY)) {1003CB4C6F}>
* (elt (elt a 1) 0)

"????????& quot;
* (length a)

2
* (length (elt (elt a 1) 0))

8
* (length (elt (elt a 0) 0))

3
*



Here are the relevant settings as I see it:


*** 1. SBCL

$ sb-impl::*default-external-format*
:UTF-16

$ (with-database *symdb*
     (with-transaction
       (let ((db (hu.dwim.rdbms::database-of *transaction*)))
          (lst
           (hu.dwim.rdbms.oracle::connection-encoding-of db)
           (hu.dwim.rdbms::encoding-of db)))))
(:UTF-16 :UTF-16)


**** 2. Oracle 10 Express - sqlplus

SQLPLUS> select symtag_key from symtag;

SYMTAG_KEY
----------------------
foo
chrismay

SQLPLUS>  describe symtag;
 Name                       Null?    Type
 ----------------------------------------- -------- ----------------------------
 SYMTAG_KEY                   NOT NULL NVARCHAR2(22)
 SYMTAG_CREATION_DATE               NOT NULL TIMESTAMP(6) WITH TIME ZONE

** 2.1 http://localhost:8080/apex - about database

National Language Parametersort by this column    Value
NLS_CALENDAR    GREGORIAN
NLS_CHARACTERSET    AL32UTF8
NLS_COMP    BINARY
NLS_CURRENCY    $
NLS_DATE_FORMAT    DD-MON-RR
NLS_DATE_LANGUAGE    AMERICAN
NLS_DUAL_CURRENCY    $
NLS_ISO_CURRENCY    AMERICA
NLS_LANGUAGE    AMERICAN
NLS_LENGTH_SEMANTICS    BYTE
NLS_NCHAR_CHARACTERSET    AL16UTF16
NLS_NCHAR_CONV_EXCP    FALSE
NLS_NUMERIC_CHARACTERS    .,
NLS_SORT    BINARY
NLS_TERRITORY    AMERICA
NLS_TIMESTAMP_FORMAT    DD-MON-RR HH.MI.SSXFF AM
NLS_TIMESTAMP_TZ_FORMAT    DD-MON-RR HH.MI.SSXFF AM TZR
NLS_TIME_FORMAT    HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT    HH.MI.SSXFF AM TZR

*** 3. Shell

chris at catch22:~$ locale
LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
chris at catch22:~$


Regards,
chris

!DSPAM:4ccf4ae148588202753979!




More information about the cl-rdbms-devel mailing list