activerecord-jdbc-plsql

activerecord-jdbc-plsql provide a Ruby wrapper to use PL/SQL with Active Record and JDBC


License
MIT
Install
gem install activerecord-jdbc-plsql -v 0.0.3

Documentation

activerecord-jdbc-plsql

activerecord-jdbc-plsql provide a Ruby wrapper to use PL/SQL with Active Record and JDBD.

Installation

Add this line to your application's Gemfile:

gem 'activerecord-jdbc-plsql'

And then execute:

$ bundle

Or install it yourself as:

$ gem install activerecord-jdbc-plsql

Usage

activerecord-jdbc-plsql provide a new method to call PL/SQL programs. Use call_procedure from your models. Example:

Standard

result = connection.call_procedure('my_procedure', 'value1', 'value2', :integer)

This call will return this ruby hash:

{
    3 => 'the expected value'
}

The key will be the parameter index starting at 1 ( accordance with JDBC API ).

With named parameters

result = connection.call_procedure('my_procedure', an_input_parameter: 'value1', an_other_input_parameter: 'value2', an_output_parameter: :integer)

This call will return this ruby hash:

{
    an_output_parameter: 'the expected value'
}

Supported types are:

:binary
:boolean
:date
:datetime
:decimal
:float
:integer
:string
:text
:time
:timestamp

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request