Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hasan3ysf opened this issue Oct 8, 2014 · 9 comments
Open

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

hasan3ysf opened this issue Oct 8, 2014 · 9 comments

Comments

@hasan3ysf
Copy link

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
Copy link
Owner

aam commented Oct 8, 2014

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
Copy link
Author

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
Copy link
Owner

aam commented Oct 8, 2014

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

@hasan3ysf
Copy link
Author

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
Copy link
Owner

aam commented Oct 8, 2014

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

@hasan3ysf
Copy link
Author

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

@aam
Copy link
Owner

aam commented Oct 8, 2014

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
Copy link
Author

Oracle Database XE 11.2

@hasan3ysf
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants