oracle_query 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/oracle_query.rb +15 -3
  2. metadata +2 -2
data/lib/oracle_query.rb CHANGED
@@ -15,11 +15,23 @@ class Oracle
15
15
  end
16
16
 
17
17
  #Set table name and values ["name = 'John', employee_id = 39994"]
18
- def insert (table, values)
19
- @oci.exec("INSERT INTO #{table} VALUES(#{values[0]})")
20
- @oci.commit
18
+ def insert (table, values, rollback)
19
+ if rollback == false
20
+ @oci.exec("INSERT INTO #{table} VALUES(#{values[0]})")
21
+ @oci.commit
22
+ else
23
+ @oci.exec("INSERT INTO #{table} VALUES(#{values[0]})")
24
+ end
21
25
  end
22
26
 
27
+ def commit()
28
+ @oci.commit
29
+ end
30
+
31
+ def rollback()
32
+ @oci.rollback
33
+ end
34
+
23
35
  #Set table name and values ["name = 'John', employee_id = 39994"]
24
36
  def append (table, values)
25
37
  @oci.exec("INSERT /*+ append */ INTO #{table} VALUES(#{values[0]})")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oracle_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
12
+ date: 2013-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-oci8