Skip to content
Oracle Database driver for Erlang
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Update test.exs.example Dec 19, 2018
include Update TNS.hrl Oct 27, 2018
lib Update jamdb_oracle_ecto.ex Feb 5, 2019
src fix query with starting new line character May 31, 2019
test Update test_helper.exs Dec 19, 2018
.gitignore
LICENSE First version Dec 31, 2015
Makefile Update jose version Mar 12, 2017
README.md Update README.md Dec 28, 2018
erlang.mk First version Dec 31, 2015
mix.exs Update mix.exs Feb 5, 2019
rebar.config Changes for hex.pm Mar 3, 2017

README.md

JamDB Oracle

Erlang driver and Ecto adapter for Oracle Database

Features

  • Using prepared statement functionality.
  • Using bind variables.
  • Calling stored procedure.
  • Calling stored function.
  • Using cursor variable.
  • Using returning clause.
  • Update batching.
  • Row prefetching.

Getting Started

%% Set connection options
1> Opts = [
    {host, "jamdb-oracle-dev.erlangbureau.dp.ua"},
    {port, 1521},
    {user, "jamdbtest"},
    {password, "jamdbtest"},
    {sid, "JAMDBTEST"},
    %%{service_name, "JAMDBTEST"},
    {app_name, "jamdbtest"}
].

%% Connect
2> {ok, Pid} = jamdb_oracle:start_link(Opts).
{ok,<0.37.0>}

%% Simple select
3> {ok, Result} = jamdb_oracle:sql_query(Pid, "select 1 as one, 2 as two, 3 as three from dual").
{ok,[{result_set,[<<"ONE">>,<<"TWO">>,<<"THREE">>],
                 [],
                 [[{1},{2},{3}]]}]}

%% Select with parameters
4> {ok, Result2} = jamdb_oracle:sql_query(Pid, {"select 1 as one, sysdate, rowid from dual where 1=:1 ",[1]}).
{ok,[{result_set,[<<"ONE">>,<<"SYSDATE">>,<<"ROWID">>],
                 [],
                 [[{1},{{2016,8,1},{13,14,15}},"AAAACOAABAAAAWJAAA"]]}]}

Running Tests

First, supply connection details for your test database in test/jamdb_oracle_test.hrl or config/test.exs. Once the connection configuration is saved, run the test suite with rebar3 ct or mix test.

Author

Donate Bitcoin

Mykhailo Vstavskyi

Contributors

Sergiy Kostyushkin

You can’t perform that action at this time.