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

oracle connect error with weired number #36

Open
clojurians-org opened this issue Jun 1, 2018 · 3 comments
Open

oracle connect error with weired number #36

clojurians-org opened this issue Jun 1, 2018 · 3 comments

Comments

@clojurians-org
Copy link

i don't know what happened when i try to connect to oracle for weired number message.
i install oracle odbc driver and unixodbc library already?

oracleConnInfo = "Driver={Oracle ODBC Driver};DBP=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.129.35.238)(PORT=1521))(CONNECT_DATA=(SI
D=EDWDBUAT)));UID=XXX;PWD=YYY;"

connectODBC oracleConnInfo
*** Exception: SqlError {seState = "["*** Exception: Prelude.chr: bad argument: 3211312

@clojurians-org
Copy link
Author

solved.

  1. export LD_LIBRARY_PATH
  2. configure /etc/odbcinst.ini
  3. oracleConnInfo = "Driver={Oracle ODBC Driver};DBQ=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.129.35.238)(PORT=1521)))(CONNECT_D
    ATA=(SERVICE_NAME=EDWDBUAT)(SERVER=DEDICATED)));UID=XXX;PWD=YYY;"

@clojurians-org
Copy link
Author

Lib Lib> a <- connectODBC oracleConnInfo
Lib Lib> quickQuery a "select 1 from dual" []
[[SqlDouble 1.0]]
Lib Lib> disconnect a
*** Exception: SqlError {seState = "["
Exception: Prelude.chr: bad argument: 3473458

@clojurians-org
Copy link
Author

oraQuery1 :: IO [[SqlValue]]
oraQuery1 = bracket (connectODBC oracleConnInfo) (\x -> do {commit x; putStrLn "hello"; disconnect x}) $ \conn ->
quickQuery conn "select 1 + 1 as a, 2 + 2 as b from dual" []
λ> oraQuery1
hello
*** Exception: SqlError {seState = "[]", seNativeError = -2, seErrorMsg = "SQLNumResultCols: []"}

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

1 participant