Coder Social home page Coder Social logo

Comments (9)

c-bik avatar c-bik commented on June 16, 2024

UTF8 support is not very correct/complete yet. If you have time I can work with you on this and get it fixed.

{<<"NAME">>,'SQLT_CHR',30,0,0}
and
{<<"NAME">>,'SQLT_CHR',60,0,0}

are different size. May also be due to UTF8 issue. Can you please add a test case which I can try with?

from erloci.

homeway avatar homeway commented on June 16, 2024

@c-bik I am very grateful to you can do that !

I will add a test case soon : )

from erloci.

c-bik avatar c-bik commented on June 16, 2024

@homeway No problem at all!

from erloci.

homeway avatar homeway commented on June 16, 2024

hi @c-bik , can you tell me how you create your oracle instance and user grant for scott ?
I create a common utf8 instance, and don't through all test yet.

$ rebar eunit
==> erloci (eunit)
30:50.170934 [debug] {oci_logger,,66} ---- ERLOCI PORT PROCESS LOGGER ----
30:50.180668 [debug] {oci_port,,290} DYLD_LIBRARY_PATH = .../opt/oracle/instantclient_11_2
30:50.182460 [debug] {oci_port,,292} Extra Env :[{"NLS_LANG","GERMAN_SWITZERLAND.AL32UTF8"}]
30:50.182651 [debug] {oci_port,,302} Executable "/Users/homeway/erlang/research/erloci/priv/ocierl"
30:50.183020 [debug] {oci_port,,303} Options :[{packet,4},
          binary,exit_status,use_stdio,
          {args,["262144","true","59855"]},
          {env,[{"DYLD_LIBRARY_PATH",
                 "/opt/oracle/instantclient_11_2:/opt/oracle/instantclient_11_2"},
                {"NLS_LANG","GERMAN_SWITZERLAND.AL32UTF8"}]}]
30:50.183359 [debug] {oci_port,,314} started log enabled new port:
....
test/erloci_test.erl:204:<0.229.0>: 30:57.268086 +---------------------------------------------+
test/erloci_test.erl:205:<0.229.0>: 30:57.268219 |                   lob_test                  |
test/erloci_test.erl:206:<0.229.0>: 30:57.268291 +---------------------------------------------+
test/erloci_test.erl:223:<0.229.0>: 30:57.380745 created Directory alias /Users/homeway/erlang/research/erloci/.eunit
30:57.525790 [error] {c_src/erloci_lib/ocistmt.cpp,execute,277} failed OCIStmtExecute error ORA-00955: name is already used by an existing object
 (create table lobs(clobd clob, blobd blob, nclobd nclob, bfiled bfile))
test/erloci_test.erl:241:<0.229.0>: 30:58.699049 truncated table lobs
test/erloci_test.erl:257:<0.229.0>: 30:59.505424 inserted 5 rows into lobs
30:59.667891 [error] {c_src/erloci_lib/ocistmt.cpp,rows,870} failed OCILobGetLength for 0x7fdf9a8e97f8 row 1 column 3 reason ORA-22288: file or LOB operation GETLENGTH failed
ϵͳ?Ҳ???ָ?????ļ???
 (select * from lobs)
test/erloci_test.erl:648:<0.229.0>: 30:59.671079 +---------------------------------------------+
erloci_test: db_test_...test/erloci_test.erl:649:<0.229.0>: 30:59.671333 |               describe_test                 |
*failed*
in function erloci_test:lob_test/1 (test/erloci_test.erl, line 262)
**error:{badmatch,{error,{22288,
                  <<"ORA-22288: file or LOB operation GETLENGTH failed\nϵ"...>>}}}
test/erloci_test.erl:650:<0.229.0>: 30:59.671482 +---------------------------------------------+

...

test/erloci_test.erl:813:<0.229.0>: 31:03.115105 +---------------------------------------------+
test/erloci_test.erl:814:<0.229.0>: 31:03.115272 |       timestamp_interval_datatypes          |
test/erloci_test.erl:815:<0.229.0>: 31:03.115347 +---------------------------------------------+
31:03.646087 [debug] {c_src/erloci_drv/command.cpp,exec_stmt,525} Bounds 
31:04.063312 [debug] {c_src/erloci_drv/command.cpp,exec_stmt,525} Bounds 
31:04.380905 [error] {c_src/erloci_lib/ocistmt.cpp,execute,277} failed OCIStmtExecute error ORA-00942: table or view does not exist
 (drop table erloci_test_1)

=INFO REPORT==== 23-Apr-2015::21:31:04 ===
    application: erloci
    exited: stopped
    type: temporary
=======================================================
  Failed: 1.  Skipped: 0.  Passed: 54.
Cover analysis: /Users/homeway/erlang/research/erloci/.eunit/index.html
ERROR: One or more eunit tests failed.
ERROR: eunit failed while processing /Users/homeway/erlang/research/erloci: rebar_abort

from erloci.

c-bik avatar c-bik commented on June 16, 2024

@homeway

lob_test only works for a localhost Oracle Server with matching folder permission.

from erloci.

homeway avatar homeway commented on June 16, 2024

ok, I try it continue

from erloci.

c-bik avatar c-bik commented on June 16, 2024

@homeway accidental close?

from erloci.

homeway avatar homeway commented on June 16, 2024

@c-bik thanks for your help !

I tried some cases for utf8:

  1. insert utf8 string and select it in test case
  2. insert utf8 string from sqldeveloper and select it in test case

Then I found all the test passed ( I commented lob_test ).

So I guess my problem only happened with legacy database : )

from erloci.

c-bik avatar c-bik commented on June 16, 2024

Ok.
So that can not be solved by erloci, but perhaps the detection and handling of encoding can be improved or made more transparent (other than utf8 that is). It will be great if you can bring in some legacy support (like your scenario) into erloci. More erloci users will be benefited.

I am assuming this issue closed.

from erloci.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.