aam / oracledart

Let Dart talk to Oracle
BSD 2-Clause "Simplified" License
11 stars 2 forks source link

Max number of charcters can be read in the SQL statement #17

Open hasan3ysf opened 10 years ago

hasan3ysf commented 10 years ago

Hi.. In my SQL statement: var resultset = oracleConnection.select("select fullName from USERS_MAIN");

the oracledart could not read a field of more than 15 characters

I was able to read the name as: ''Hasan Abd Allah' [15 character] but could not read it as 'Hassan Abd Allah' [16 character]

I tried same with other fields, kept changing the number of characters, everything is fine upto 15 characters only!

thanks

aam commented 10 years ago

Hi Hasan,

what is your table schema from which you are trying to read >15 chars strings?

I just put quick test together and it seem to work fine. I created table emp1 with varchar2(255) character Name column, added 'First name and long name are very long' value there and was able to retrieve it:

SQL> create table emp1(name varchar2(255), age number);

Table created.

SQL> insert into emp1(name, age) values('First name and long name are very long'
, 43);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from emp1;

NAME
--------------------------------------------------------------------------------

       AGE
----------
First name and long name are very long
        43
F:\oracledart\odtest>type odtest1.dart
import 'package:oracledart/oracledart.dart';

void main() {
  print("Hello, World!");

  connect(
    "scott",
    "tiger",
    "(DESCRIPTION="
      "(ADDRESS=(PROTOCOL=TCP)(HOST=w8-32-12core)(PORT=1521))"
      "(CONNECT_DATA=(SERVICE_NAME=XE)(SERVER=DEDICATED)))")
    .then(
      (oracleConnection) {
        var resultset = oracleConnection.select("select name from emp1");
        resultset.next();
        print(resultset.getString(1));
      },
      onError: (error) {
        print("Failed to connect: $error");
      });
}
F:\oracledart\odtest>f:\g\dart-repo\dart\build\ReleaseIA32\dart odtest1.dart
Hello, World!
First name and long name are very long

F:\oracledart\odtest>
hasan3ysf commented 10 years ago

my table schema is:

DESCRIBE USERS_MAIN Name Null Type


ALIAS VARCHAR2(80)
FIRSTNAME VARCHAR2(80)
LASTNAME VARCHAR2(80)
PASSWORD VARCHAR2(40)
EMAIL VARCHAR2(80)
ROLES VARCHAR2(255)

aam commented 10 years ago

Initial code above selects 'fullName', but I don't see such column in your table schema.

hasan3ysf commented 10 years ago

I splitted it into first and last names :), before it was: LASTNAME VARCHAR2(80) FULLNAME VARCHAR2(255)

I just made same table you made, inserted same data, run same SQL code, my system hanged, and did not execute anything!

thanks

aam commented 10 years ago

Puzzling. Is this with Dart 32-bit or 64-bit?

hasan3ysf commented 10 years ago

DART 64 bit. but ORACLE XE itself is 32 bit.

aam commented 10 years ago

Tried odtest1 from above with Dart 64-bit and again it worked for me fine. (I also use Oracle 32-bit on Windows). What version of Oracle server you use?

hasan3ysf commented 10 years ago

Oracle Database XE 11.2

hasan3ysf commented 10 years ago

Hi Alex, I just got fresh install of ORACLE XE 11.2 x64 at fresh install of Windows 7 x64. and got same result, maximum number of characters is 15… otherwise select statement is hanging!!

Note: I run it using OCCI 32 bit, as could not get the x64 bit run in my laptop.